--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+A copy of OpenGL headers from Mesa and Khronos. Needed on older Linux
+distros and for Windows.
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.0
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef __gl_h_
+#define __gl_h_
+
+#if defined(USE_MGL_NAMESPACE)
+#include "gl_mangle.h"
+#endif
+
+
+/**********************************************************************
+ * Begin system-specific stuff. Do not do any of this when building
+ * for SciTech SNAP, as this is all done before this header file is
+ * included.
+ */
+#if !defined(__SCITECH_SNAP__)
+
+#if defined(__BEOS__)
+#include <stdlib.h> /* to get some BeOS-isms */
+#endif
+
+#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
+#define OPENSTEP
+#endif
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# endif /* _STATIC_MESA support */
+# define GLAPIENTRY __stdcall
+#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
+# define GLAPI extern
+# define GLAPIENTRY __stdcall
+#elif defined(__GNUC__)
+# define GLAPI __attribute__((visibility("default")))
+# define GLAPIENTRY
+#endif /* WIN32 && !CYGWIN */
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \
+ && !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__)
+#include <GL/mesa_wgl.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+/* "P" suffix to be used for a pointer to a function */
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+#endif /* !__SCITECH_SNAP__ */
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define GL_VERSION_1_1 1
+#define GL_VERSION_1_2 1
+#define GL_VERSION_1_3 1
+#define GL_ARB_imaging 1
+
+
+/*
+ * Datatypes
+ */
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+
+
+/*
+ * Constants
+ */
+
+/* Boolean values */
+#define GL_FALSE 0x0
+#define GL_TRUE 0x1
+
+/* Data types */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+#define GL_DOUBLE 0x140A
+
+/* Primitives */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+
+/* Vertex Arrays */
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+
+/* Polygons */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+
+/* Display Lists */
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+
+/* Depth buffer */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
+
+/* Lighting */
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
+
+/* User clipping planes */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM 0x0100
+#define GL_ADD 0x0104
+#define GL_LOAD 0x0101
+#define GL_MULT 0x0103
+#define GL_RETURN 0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+
+/* Blending */
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#define GL_ZERO 0x0
+#define GL_ONE 0x1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+
+/* Render Mode */
+#define GL_FEEDBACK 0x1C01
+#define GL_RENDER 0x1C00
+#define GL_SELECT 0x1C02
+
+/* Feedback */
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+
+/* Fog */
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP 0x0BF1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_CLEAR 0x1500
+#define GL_SET 0x150F
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_NOOP 0x1505
+#define GL_INVERT 0x150A
+#define GL_AND 0x1501
+#define GL_NAND 0x150E
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_XOR 0x1506
+#define GL_EQUIV 0x1509
+#define GL_AND_REVERSE 0x1502
+#define GL_AND_INVERTED 0x1504
+#define GL_OR_REVERSE 0x150B
+#define GL_OR_INVERTED 0x150D
+
+/* Stencil */
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE 0x0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+/*GL_FRONT 0x0404 */
+/*GL_BACK 0x0405 */
+/*GL_FRONT_AND_BACK 0x0408 */
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_COEFF 0x0A00
+#define GL_ORDER 0x0A01
+#define GL_DOMAIN 0x0A02
+
+/* Hints */
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_FOG_HINT 0x0C54
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+
+/* Utility */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* Errors */
+#define GL_NO_ERROR 0x0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+
+
+/* OpenGL 1.1 */
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+
+
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
+
+
+GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */
+
+
+GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glPopAttrib( void );
+
+
+GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */
+
+
+GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY glGetError( void );
+
+GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY glFinish( void );
+
+GLAPI void GLAPIENTRY glFlush( void );
+
+GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY glPushMatrix( void );
+
+GLAPI void GLAPIENTRY glPopMatrix( void );
+
+GLAPI void GLAPIENTRY glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glRotated( GLdouble angle,
+ GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
+ GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY glEndList( void );
+
+GLAPI void GLAPIENTRY glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
+ const GLvoid *lists );
+
+GLAPI void GLAPIENTRY glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnd( void );
+
+
+GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY glIndexi( GLint c );
+GLAPI void GLAPIENTRY glIndexs( GLshort c );
+GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
+GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
+ GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
+ GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
+ GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
+ GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
+ GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
+ GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
+ GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Vertex Arrays (1.1)
+ */
+
+GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
+
+GLAPI void GLAPIENTRY glArrayElement( GLint i );
+
+GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
+
+GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
+ const GLvoid *pointer );
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
+ GLfloat *params );
+GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
+ const GLfloat *values );
+GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
+ const GLuint *values );
+GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
+ const GLushort *values );
+
+GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
+ GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
+ GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+
+/* 1.1 functions */
+
+GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
+ const GLuint *textures,
+ const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
+ const GLuint *textures,
+ GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
+
+
+GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y,
+ GLsizei width );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+ GLint stride,
+ GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+ GLint stride,
+ GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY glMap2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
+GLAPI void GLAPIENTRY glMap2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY glInitNames( void );
+
+GLAPI void GLAPIENTRY glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY glPopName( void );
+
+
+
+/*
+ * OpenGL 1.2
+ */
+
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_TEXTURE_BINDING_3D 0x806A
+
+GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
+ GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLint x,
+ GLint y, GLsizei width,
+ GLsizei height );
+
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_BLEND_EQUATION 0x8009
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_COLOR 0x8005
+
+
+GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *data );
+
+GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint *params);
+
+GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params);
+
+GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
+
+GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
+ GLenum internalformat, GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
+
+GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
+ GLenum format, GLenum type,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
+ GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
+
+GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
+ GLenum format, GLenum types,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+ const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
+ GLfloat params );
+
+GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
+ GLint params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width,
+ GLsizei height);
+
+GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *image );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column );
+
+GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+
+
+
+/*
+ * OpenGL 1.3
+ */
+
+/* multitexture */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+/* texture_cube_map */
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+/* texture_compression */
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+/* multisample */
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+/* transpose_matrix */
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+/* texture_env_combine */
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+/* texture_env_dot3 */
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+/* texture_border_clamp */
+#define GL_CLAMP_TO_BORDER 0x812D
+
+GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
+
+
+/*
+ * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
+ */
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+
+#endif /* GL_ARB_multitexture */
+
+
+
+/*
+ * Define this token if you want "old-style" header file behaviour (extensions
+ * defined in gl.h). Otherwise, extensions will be included from glext.h.
+ */
+#if defined(GL_GLEXT_LEGACY)
+
+/* All extensions that used to be here are now found in glext.h */
+
+#else /* GL_GLEXT_LEGACY */
+
+#include <GL/glext.h>
+
+#endif /* GL_GLEXT_LEGACY */
+
+
+
+#if GL_ARB_shader_objects
+
+#ifndef GL_MESA_shader_debug
+#define GL_MESA_shader_debug 1
+
+#define GL_DEBUG_OBJECT_MESA 0x8759
+#define GL_DEBUG_PRINT_MESA 0x875A
+#define GL_DEBUG_ASSERT_MESA 0x875B
+
+GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
+GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+ GLsizei *length, GLcharARB *debugLog);
+GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+
+#endif /* GL_MESA_shader_debug */
+
+#endif /* GL_ARB_shader_objects */
+
+
+/*
+ * ???. GL_MESA_packed_depth_stencil
+ * XXX obsolete
+ */
+#ifndef GL_MESA_packed_depth_stencil
+#define GL_MESA_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_MESA 0x8750
+#define GL_UNSIGNED_INT_24_8_MESA 0x8751
+#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
+#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
+#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
+
+#endif /* GL_MESA_packed_depth_stencil */
+
+
+#ifndef GL_MESA_program_debug
+#define GL_MESA_program_debug 1
+
+#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
+#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
+#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
+#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
+#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
+#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
+#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
+#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
+
+typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
+
+GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
+
+GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
+
+#endif /* GL_MESA_program_debug */
+
+
+#ifndef GL_ATI_blend_equation_separate
+#define GL_ATI_blend_equation_separate 1
+
+#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
+
+GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
+
+#endif /* GL_ATI_blend_equation_separate */
+
+
+
+/**
+ ** NOTE!!!!! If you add new functions to this file, or update
+ ** glext.h be sure to regenerate the gl_mangle.h file. See comments
+ ** in that file for details.
+ **/
+
+
+
+/**********************************************************************
+ * Begin system-specific stuff
+ */
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export off
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import off
+#endif
+/*
+ * End system-specific stuff
+ **********************************************************************/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
--- /dev/null
+#if 0
+#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
+#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
+ files="gl.h glext.h"
+#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
+ awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
+ echo ""
+#define GL_MANGLE_C4 get aliases
+ grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq
+ echo ""
+ echo "#endif /* GL_MANGLE_H */"
+ exit
+#endif /* REGENERATION */
+
+/*
+ * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link
+ * your application both with OpenGL and Mesa. The Mesa functions will
+ * be redefined so they are prefixed with "mgl" instead of "gl".
+ * Mgl contributed by Randy Frank (rfrank@rsinc.com)
+ * Regneration code contributed by Ray Tice (rayt@ma.ultra.net)
+ */
+
+#ifndef GL_MANGLE_H
+#define GL_MANGLE_H
+
+#ifndef MANGLE
+#define MANGLE(x) mgl##x
+#endif /*MANGLE*/
+
+/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
+
+#define glAccum MANGLE(Accum)
+#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
+#define glActiveTextureARB MANGLE(ActiveTextureARB)
+#define glActiveTexture MANGLE(ActiveTexture)
+#define glActiveVaryingNV MANGLE(ActiveVaryingNV)
+#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
+#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI)
+#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI)
+#define glAlphaFunc MANGLE(AlphaFunc)
+#define glApplyTextureEXT MANGLE(ApplyTextureEXT)
+#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV)
+#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT)
+#define glAreTexturesResident MANGLE(AreTexturesResident)
+#define glArrayElementEXT MANGLE(ArrayElementEXT)
+#define glArrayElement MANGLE(ArrayElement)
+#define glArrayObjectATI MANGLE(ArrayObjectATI)
+#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
+#define glAttachObjectARB MANGLE(AttachObjectARB)
+#define glAttachShader MANGLE(AttachShader)
+#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
+#define glBegin MANGLE(Begin)
+#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
+#define glBeginQueryARB MANGLE(BeginQueryARB)
+#define glBeginQuery MANGLE(BeginQuery)
+#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
+#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
+#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
+#define glBindAttribLocation MANGLE(BindAttribLocation)
+#define glBindBufferARB MANGLE(BindBufferARB)
+#define glBindBufferBaseNV MANGLE(BindBufferBaseNV)
+#define glBindBuffer MANGLE(BindBuffer)
+#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV)
+#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
+#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
+#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
+#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
+#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
+#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
+#define glBindParameterEXT MANGLE(BindParameterEXT)
+#define glBindProgramARB MANGLE(BindProgramARB)
+#define glBindProgramNV MANGLE(BindProgramNV)
+#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
+#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
+#define glBindTextureEXT MANGLE(BindTextureEXT)
+#define glBindTexture MANGLE(BindTexture)
+#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
+#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
+#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
+#define glBinormal3bEXT MANGLE(Binormal3bEXT)
+#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
+#define glBinormal3dEXT MANGLE(Binormal3dEXT)
+#define glBinormal3dvEXT MANGLE(Binormal3dvEXT)
+#define glBinormal3fEXT MANGLE(Binormal3fEXT)
+#define glBinormal3fvEXT MANGLE(Binormal3fvEXT)
+#define glBinormal3iEXT MANGLE(Binormal3iEXT)
+#define glBinormal3ivEXT MANGLE(Binormal3ivEXT)
+#define glBinormal3sEXT MANGLE(Binormal3sEXT)
+#define glBinormal3svEXT MANGLE(Binormal3svEXT)
+#define glBinormalPointerEXT MANGLE(BinormalPointerEXT)
+#define glBitmap MANGLE(Bitmap)
+#define glBlendColorEXT MANGLE(BlendColorEXT)
+#define glBlendColor MANGLE(BlendColor)
+#define glBlendEquationEXT MANGLE(BlendEquationEXT)
+#define glBlendEquation MANGLE(BlendEquation)
+#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
+#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
+#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
+#define glBlendFunc MANGLE(BlendFunc)
+#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
+#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
+#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
+#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
+#define glBufferDataARB MANGLE(BufferDataARB)
+#define glBufferData MANGLE(BufferData)
+#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
+#define glBufferSubDataARB MANGLE(BufferSubDataARB)
+#define glBufferSubData MANGLE(BufferSubData)
+#define glCallList MANGLE(CallList)
+#define glCallLists MANGLE(CallLists)
+#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
+#define glClampColorARB MANGLE(ClampColorARB)
+#define glClearAccum MANGLE(ClearAccum)
+#define glClearColorIiEXT MANGLE(ClearColorIiEXT)
+#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT)
+#define glClearColor MANGLE(ClearColor)
+#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
+#define glClearDepthdNV MANGLE(ClearDepthdNV)
+#define glClearDepth MANGLE(ClearDepth)
+#define glClearIndex MANGLE(ClearIndex)
+#define glClear MANGLE(Clear)
+#define glClearStencil MANGLE(ClearStencil)
+#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
+#define glClientActiveTexture MANGLE(ClientActiveTexture)
+#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
+#define glClipPlane MANGLE(ClipPlane)
+#define glColor3b MANGLE(Color3b)
+#define glColor3bv MANGLE(Color3bv)
+#define glColor3d MANGLE(Color3d)
+#define glColor3dv MANGLE(Color3dv)
+#define glColor3f MANGLE(Color3f)
+#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN)
+#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN)
+#define glColor3fv MANGLE(Color3fv)
+#define glColor3hNV MANGLE(Color3hNV)
+#define glColor3hvNV MANGLE(Color3hvNV)
+#define glColor3i MANGLE(Color3i)
+#define glColor3iv MANGLE(Color3iv)
+#define glColor3s MANGLE(Color3s)
+#define glColor3sv MANGLE(Color3sv)
+#define glColor3ub MANGLE(Color3ub)
+#define glColor3ubv MANGLE(Color3ubv)
+#define glColor3ui MANGLE(Color3ui)
+#define glColor3uiv MANGLE(Color3uiv)
+#define glColor3us MANGLE(Color3us)
+#define glColor3usv MANGLE(Color3usv)
+#define glColor4b MANGLE(Color4b)
+#define glColor4bv MANGLE(Color4bv)
+#define glColor4d MANGLE(Color4d)
+#define glColor4dv MANGLE(Color4dv)
+#define glColor4f MANGLE(Color4f)
+#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN)
+#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN)
+#define glColor4fv MANGLE(Color4fv)
+#define glColor4hNV MANGLE(Color4hNV)
+#define glColor4hvNV MANGLE(Color4hvNV)
+#define glColor4i MANGLE(Color4i)
+#define glColor4iv MANGLE(Color4iv)
+#define glColor4s MANGLE(Color4s)
+#define glColor4sv MANGLE(Color4sv)
+#define glColor4ub MANGLE(Color4ub)
+#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN)
+#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN)
+#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN)
+#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN)
+#define glColor4ubv MANGLE(Color4ubv)
+#define glColor4ui MANGLE(Color4ui)
+#define glColor4uiv MANGLE(Color4uiv)
+#define glColor4us MANGLE(Color4us)
+#define glColor4usv MANGLE(Color4usv)
+#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
+#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
+#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
+#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
+#define glColorMask MANGLE(ColorMask)
+#define glColorMaterial MANGLE(ColorMaterial)
+#define glColorPointerEXT MANGLE(ColorPointerEXT)
+#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
+#define glColorPointer MANGLE(ColorPointer)
+#define glColorPointervINTEL MANGLE(ColorPointervINTEL)
+#define glColorSubTableEXT MANGLE(ColorSubTableEXT)
+#define glColorSubTable MANGLE(ColorSubTable)
+#define glColorTableEXT MANGLE(ColorTableEXT)
+#define glColorTable MANGLE(ColorTable)
+#define glColorTableParameterfv MANGLE(ColorTableParameterfv)
+#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI)
+#define glColorTableParameteriv MANGLE(ColorTableParameteriv)
+#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI)
+#define glColorTableSGI MANGLE(ColorTableSGI)
+#define glCombinerInputNV MANGLE(CombinerInputNV)
+#define glCombinerOutputNV MANGLE(CombinerOutputNV)
+#define glCombinerParameterfNV MANGLE(CombinerParameterfNV)
+#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV)
+#define glCombinerParameteriNV MANGLE(CombinerParameteriNV)
+#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
+#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
+#define glCompileShaderARB MANGLE(CompileShaderARB)
+#define glCompileShader MANGLE(CompileShader)
+#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB)
+#define glCompressedTexImage1D MANGLE(CompressedTexImage1D)
+#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB)
+#define glCompressedTexImage2D MANGLE(CompressedTexImage2D)
+#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB)
+#define glCompressedTexImage3D MANGLE(CompressedTexImage3D)
+#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB)
+#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D)
+#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB)
+#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D)
+#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB)
+#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D)
+#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
+#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
+#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
+#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D)
+#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT)
+#define glConvolutionParameterf MANGLE(ConvolutionParameterf)
+#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT)
+#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv)
+#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT)
+#define glConvolutionParameteri MANGLE(ConvolutionParameteri)
+#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT)
+#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv)
+#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT)
+#define glCopyColorSubTable MANGLE(CopyColorSubTable)
+#define glCopyColorTable MANGLE(CopyColorTable)
+#define glCopyColorTableSGI MANGLE(CopyColorTableSGI)
+#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT)
+#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
+#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
+#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
+#define glCopyPixels MANGLE(CopyPixels)
+#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
+#define glCopyTexImage1D MANGLE(CopyTexImage1D)
+#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT)
+#define glCopyTexImage2D MANGLE(CopyTexImage2D)
+#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT)
+#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D)
+#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT)
+#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D)
+#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT)
+#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D)
+#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA)
+#define glCreateProgram MANGLE(CreateProgram)
+#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
+#define glCreateShader MANGLE(CreateShader)
+#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
+#define glCullFace MANGLE(CullFace)
+#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
+#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
+#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
+#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
+#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
+#define glDeformSGIX MANGLE(DeformSGIX)
+#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX)
+#define glDeleteBuffersARB MANGLE(DeleteBuffersARB)
+#define glDeleteBuffers MANGLE(DeleteBuffers)
+#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
+#define glDeleteFencesNV MANGLE(DeleteFencesNV)
+#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
+#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
+#define glDeleteLists MANGLE(DeleteLists)
+#define glDeleteObjectARB MANGLE(DeleteObjectARB)
+#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
+#define glDeleteProgram MANGLE(DeleteProgram)
+#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
+#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
+#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
+#define glDeleteQueries MANGLE(DeleteQueries)
+#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
+#define glDeleteShader MANGLE(DeleteShader)
+#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
+#define glDeleteTextures MANGLE(DeleteTextures)
+#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
+#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
+#define glDepthBoundsdNV MANGLE(DepthBoundsdNV)
+#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
+#define glDepthFunc MANGLE(DepthFunc)
+#define glDepthMask MANGLE(DepthMask)
+#define glDepthRangedNV MANGLE(DepthRangedNV)
+#define glDepthRange MANGLE(DepthRange)
+#define glDetachObjectARB MANGLE(DetachObjectARB)
+#define glDetachShader MANGLE(DetachShader)
+#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
+#define glDisableClientState MANGLE(DisableClientState)
+#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
+#define glDisable MANGLE(Disable)
+#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
+#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
+#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
+#define glDrawArraysEXT MANGLE(DrawArraysEXT)
+#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
+#define glDrawArrays MANGLE(DrawArrays)
+#define glDrawBuffer MANGLE(DrawBuffer)
+#define glDrawBuffersARB MANGLE(DrawBuffersARB)
+#define glDrawBuffersATI MANGLE(DrawBuffersATI)
+#define glDrawBuffers MANGLE(DrawBuffers)
+#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
+#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
+#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
+#define glDrawElements MANGLE(DrawElements)
+#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
+#define glDrawPixels MANGLE(DrawPixels)
+#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
+#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
+#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
+#define glDrawRangeElements MANGLE(DrawRangeElements)
+#define glEdgeFlag MANGLE(EdgeFlag)
+#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
+#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
+#define glEdgeFlagPointer MANGLE(EdgeFlagPointer)
+#define glEdgeFlagv MANGLE(EdgeFlagv)
+#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
+#define glElementPointerATI MANGLE(ElementPointerATI)
+#define glEnableClientState MANGLE(EnableClientState)
+#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
+#define glEnable MANGLE(Enable)
+#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
+#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
+#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
+#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
+#define glEndList MANGLE(EndList)
+#define glEnd MANGLE(End)
+#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
+#define glEndQueryARB MANGLE(EndQueryARB)
+#define glEndQuery MANGLE(EndQuery)
+#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
+#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
+#define glEvalCoord1d MANGLE(EvalCoord1d)
+#define glEvalCoord1dv MANGLE(EvalCoord1dv)
+#define glEvalCoord1f MANGLE(EvalCoord1f)
+#define glEvalCoord1fv MANGLE(EvalCoord1fv)
+#define glEvalCoord2d MANGLE(EvalCoord2d)
+#define glEvalCoord2dv MANGLE(EvalCoord2dv)
+#define glEvalCoord2f MANGLE(EvalCoord2f)
+#define glEvalCoord2fv MANGLE(EvalCoord2fv)
+#define glEvalMapsNV MANGLE(EvalMapsNV)
+#define glEvalMesh1 MANGLE(EvalMesh1)
+#define glEvalMesh2 MANGLE(EvalMesh2)
+#define glEvalPoint1 MANGLE(EvalPoint1)
+#define glEvalPoint2 MANGLE(EvalPoint2)
+#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
+#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
+#define glFeedbackBuffer MANGLE(FeedbackBuffer)
+#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
+#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
+#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
+#define glFinishFenceNV MANGLE(FinishFenceNV)
+#define glFinish MANGLE(Finish)
+#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE)
+#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
+#define glFlush MANGLE(Flush)
+#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
+#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
+#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
+#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
+#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV)
+#define glFogCoorddEXT MANGLE(FogCoorddEXT)
+#define glFogCoordd MANGLE(FogCoordd)
+#define glFogCoorddvEXT MANGLE(FogCoorddvEXT)
+#define glFogCoorddv MANGLE(FogCoorddv)
+#define glFogCoordfEXT MANGLE(FogCoordfEXT)
+#define glFogCoordf MANGLE(FogCoordf)
+#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
+#define glFogCoordfv MANGLE(FogCoordfv)
+#define glFogCoordhNV MANGLE(FogCoordhNV)
+#define glFogCoordhvNV MANGLE(FogCoordhvNV)
+#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT)
+#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM)
+#define glFogCoordPointer MANGLE(FogCoordPointer)
+#define glFogf MANGLE(Fogf)
+#define glFogFuncSGIS MANGLE(FogFuncSGIS)
+#define glFogfv MANGLE(Fogfv)
+#define glFogi MANGLE(Fogi)
+#define glFogiv MANGLE(Fogiv)
+#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX)
+#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX)
+#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX)
+#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX)
+#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX)
+#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX)
+#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX)
+#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX)
+#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX)
+#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX)
+#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
+#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
+#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
+#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
+#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
+#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
+#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
+#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
+#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
+#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
+#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
+#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
+#define glFrontFace MANGLE(FrontFace)
+#define glFrustum MANGLE(Frustum)
+#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
+#define glGenBuffersARB MANGLE(GenBuffersARB)
+#define glGenBuffers MANGLE(GenBuffers)
+#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
+#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
+#define glGenFencesNV MANGLE(GenFencesNV)
+#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
+#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
+#define glGenLists MANGLE(GenLists)
+#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
+#define glGenProgramsARB MANGLE(GenProgramsARB)
+#define glGenProgramsNV MANGLE(GenProgramsNV)
+#define glGenQueriesARB MANGLE(GenQueriesARB)
+#define glGenQueries MANGLE(GenQueries)
+#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
+#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
+#define glGenTexturesEXT MANGLE(GenTexturesEXT)
+#define glGenTextures MANGLE(GenTextures)
+#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
+#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
+#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
+#define glGetActiveAttrib MANGLE(GetActiveAttrib)
+#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
+#define glGetActiveUniform MANGLE(GetActiveUniform)
+#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV)
+#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI)
+#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI)
+#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB)
+#define glGetAttachedShaders MANGLE(GetAttachedShaders)
+#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
+#define glGetAttribLocation MANGLE(GetAttribLocation)
+#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
+#define glGetBooleanv MANGLE(GetBooleanv)
+#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
+#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
+#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
+#define glGetBufferPointerv MANGLE(GetBufferPointerv)
+#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB)
+#define glGetBufferSubData MANGLE(GetBufferSubData)
+#define glGetClipPlane MANGLE(GetClipPlane)
+#define glGetColorTableEXT MANGLE(GetColorTableEXT)
+#define glGetColorTable MANGLE(GetColorTable)
+#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT)
+#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv)
+#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI)
+#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT)
+#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv)
+#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI)
+#define glGetColorTableSGI MANGLE(GetColorTableSGI)
+#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV)
+#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV)
+#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV)
+#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV)
+#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV)
+#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
+#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
+#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
+#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
+#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
+#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv)
+#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT)
+#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
+#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
+#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
+#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
+#define glGetDoublev MANGLE(GetDoublev)
+#define glGetError MANGLE(GetError)
+#define glGetFenceivNV MANGLE(GetFenceivNV)
+#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
+#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
+#define glGetFloatv MANGLE(GetFloatv)
+#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
+#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
+#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
+#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
+#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
+#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
+#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
+#define glGetHandleARB MANGLE(GetHandleARB)
+#define glGetHistogramEXT MANGLE(GetHistogramEXT)
+#define glGetHistogram MANGLE(GetHistogram)
+#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT)
+#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv)
+#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT)
+#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv)
+#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP)
+#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
+#define glGetInfoLogARB MANGLE(GetInfoLogARB)
+#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
+#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
+#define glGetIntegerv MANGLE(GetIntegerv)
+#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
+#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
+#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT)
+#define glGetLightfv MANGLE(GetLightfv)
+#define glGetLightiv MANGLE(GetLightiv)
+#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX)
+#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX)
+#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT)
+#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT)
+#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT)
+#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV)
+#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV)
+#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV)
+#define glGetMapdv MANGLE(GetMapdv)
+#define glGetMapfv MANGLE(GetMapfv)
+#define glGetMapiv MANGLE(GetMapiv)
+#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV)
+#define glGetMapParameterivNV MANGLE(GetMapParameterivNV)
+#define glGetMaterialfv MANGLE(GetMaterialfv)
+#define glGetMaterialiv MANGLE(GetMaterialiv)
+#define glGetMinmaxEXT MANGLE(GetMinmaxEXT)
+#define glGetMinmax MANGLE(GetMinmax)
+#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT)
+#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
+#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
+#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
+#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
+#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
+#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
+#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
+#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
+#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
+#define glGetPixelMapfv MANGLE(GetPixelMapfv)
+#define glGetPixelMapuiv MANGLE(GetPixelMapuiv)
+#define glGetPixelMapusv MANGLE(GetPixelMapusv)
+#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS)
+#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS)
+#define glGetPointervEXT MANGLE(GetPointervEXT)
+#define glGetPointerv MANGLE(GetPointerv)
+#define glGetPolygonStipple MANGLE(GetPolygonStipple)
+#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
+#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
+#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
+#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV)
+#define glGetProgramInfoLog MANGLE(GetProgramInfoLog)
+#define glGetProgramivARB MANGLE(GetProgramivARB)
+#define glGetProgramiv MANGLE(GetProgramiv)
+#define glGetProgramivNV MANGLE(GetProgramivNV)
+#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
+#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
+#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV)
+#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV)
+#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV)
+#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
+#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
+#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
+#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
+#define glGetProgramStringARB MANGLE(GetProgramStringARB)
+#define glGetProgramStringNV MANGLE(GetProgramStringNV)
+#define glGetQueryivARB MANGLE(GetQueryivARB)
+#define glGetQueryiv MANGLE(GetQueryiv)
+#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
+#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
+#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
+#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
+#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
+#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
+#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
+#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
+#define glGetSeparableFilter MANGLE(GetSeparableFilter)
+#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
+#define glGetShaderiv MANGLE(GetShaderiv)
+#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
+#define glGetShaderSource MANGLE(GetShaderSource)
+#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
+#define glGetString MANGLE(GetString)
+#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
+#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
+#define glGetTexEnvfv MANGLE(GetTexEnvfv)
+#define glGetTexEnviv MANGLE(GetTexEnviv)
+#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS)
+#define glGetTexGendv MANGLE(GetTexGendv)
+#define glGetTexGenfv MANGLE(GetTexGenfv)
+#define glGetTexGeniv MANGLE(GetTexGeniv)
+#define glGetTexImage MANGLE(GetTexImage)
+#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv)
+#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
+#define glGetTexParameterfv MANGLE(GetTexParameterfv)
+#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT)
+#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
+#define glGetTexParameteriv MANGLE(GetTexParameteriv)
+#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
+#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
+#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
+#define glGetUniformfvARB MANGLE(GetUniformfvARB)
+#define glGetUniformfv MANGLE(GetUniformfv)
+#define glGetUniformivARB MANGLE(GetUniformivARB)
+#define glGetUniformiv MANGLE(GetUniformiv)
+#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
+#define glGetUniformLocation MANGLE(GetUniformLocation)
+#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
+#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
+#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
+#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
+#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
+#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
+#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
+#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
+#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV)
+#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
+#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI)
+#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
+#define glGetVertexAttribdv MANGLE(GetVertexAttribdv)
+#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV)
+#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
+#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
+#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
+#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT)
+#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT)
+#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
+#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
+#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
+#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
+#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
+#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
+#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN)
+#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN)
+#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN)
+#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN)
+#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN)
+#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN)
+#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN)
+#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN)
+#define glHint MANGLE(Hint)
+#define glHintPGI MANGLE(HintPGI)
+#define glHistogramEXT MANGLE(HistogramEXT)
+#define glHistogram MANGLE(Histogram)
+#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX)
+#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP)
+#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP)
+#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP)
+#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP)
+#define glIndexd MANGLE(Indexd)
+#define glIndexdv MANGLE(Indexdv)
+#define glIndexf MANGLE(Indexf)
+#define glIndexFuncEXT MANGLE(IndexFuncEXT)
+#define glIndexfv MANGLE(Indexfv)
+#define glIndexi MANGLE(Indexi)
+#define glIndexiv MANGLE(Indexiv)
+#define glIndexMask MANGLE(IndexMask)
+#define glIndexMaterialEXT MANGLE(IndexMaterialEXT)
+#define glIndexPointerEXT MANGLE(IndexPointerEXT)
+#define glIndexPointerListIBM MANGLE(IndexPointerListIBM)
+#define glIndexPointer MANGLE(IndexPointer)
+#define glIndexs MANGLE(Indexs)
+#define glIndexsv MANGLE(Indexsv)
+#define glIndexub MANGLE(Indexub)
+#define glIndexubv MANGLE(Indexubv)
+#define glInitNames MANGLE(InitNames)
+#define glInsertComponentEXT MANGLE(InsertComponentEXT)
+#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX)
+#define glInterleavedArrays MANGLE(InterleavedArrays)
+#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
+#define glIsBufferARB MANGLE(IsBufferARB)
+#define glIsBuffer MANGLE(IsBuffer)
+#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
+#define glIsEnabled MANGLE(IsEnabled)
+#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
+#define glIsFenceNV MANGLE(IsFenceNV)
+#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
+#define glIsList MANGLE(IsList)
+#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
+#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
+#define glIsProgramARB MANGLE(IsProgramARB)
+#define glIsProgram MANGLE(IsProgram)
+#define glIsProgramNV MANGLE(IsProgramNV)
+#define glIsQueryARB MANGLE(IsQueryARB)
+#define glIsQuery MANGLE(IsQuery)
+#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
+#define glIsShader MANGLE(IsShader)
+#define glIsTextureEXT MANGLE(IsTextureEXT)
+#define glIsTexture MANGLE(IsTexture)
+#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
+#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
+#define glLightEnviSGIX MANGLE(LightEnviSGIX)
+#define glLightf MANGLE(Lightf)
+#define glLightfv MANGLE(Lightfv)
+#define glLighti MANGLE(Lighti)
+#define glLightiv MANGLE(Lightiv)
+#define glLightModelf MANGLE(LightModelf)
+#define glLightModelfv MANGLE(LightModelfv)
+#define glLightModeli MANGLE(LightModeli)
+#define glLightModeliv MANGLE(LightModeliv)
+#define glLineStipple MANGLE(LineStipple)
+#define glLineWidth MANGLE(LineWidth)
+#define glLinkProgramARB MANGLE(LinkProgramARB)
+#define glLinkProgram MANGLE(LinkProgram)
+#define glListBase MANGLE(ListBase)
+#define glListParameterfSGIX MANGLE(ListParameterfSGIX)
+#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX)
+#define glListParameteriSGIX MANGLE(ListParameteriSGIX)
+#define glListParameterivSGIX MANGLE(ListParameterivSGIX)
+#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX)
+#define glLoadIdentity MANGLE(LoadIdentity)
+#define glLoadMatrixd MANGLE(LoadMatrixd)
+#define glLoadMatrixf MANGLE(LoadMatrixf)
+#define glLoadName MANGLE(LoadName)
+#define glLoadProgramNV MANGLE(LoadProgramNV)
+#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB)
+#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd)
+#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB)
+#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf)
+#define glLockArraysEXT MANGLE(LockArraysEXT)
+#define glLogicOp MANGLE(LogicOp)
+#define glMap1d MANGLE(Map1d)
+#define glMap1f MANGLE(Map1f)
+#define glMap2d MANGLE(Map2d)
+#define glMap2f MANGLE(Map2f)
+#define glMapBufferARB MANGLE(MapBufferARB)
+#define glMapBuffer MANGLE(MapBuffer)
+#define glMapControlPointsNV MANGLE(MapControlPointsNV)
+#define glMapGrid1d MANGLE(MapGrid1d)
+#define glMapGrid1f MANGLE(MapGrid1f)
+#define glMapGrid2d MANGLE(MapGrid2d)
+#define glMapGrid2f MANGLE(MapGrid2f)
+#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
+#define glMapParameterfvNV MANGLE(MapParameterfvNV)
+#define glMapParameterivNV MANGLE(MapParameterivNV)
+#define glMaterialf MANGLE(Materialf)
+#define glMaterialfv MANGLE(Materialfv)
+#define glMateriali MANGLE(Materiali)
+#define glMaterialiv MANGLE(Materialiv)
+#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB)
+#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
+#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
+#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
+#define glMatrixMode MANGLE(MatrixMode)
+#define glMinmaxEXT MANGLE(MinmaxEXT)
+#define glMinmax MANGLE(Minmax)
+#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
+#define glMultiDrawArrays MANGLE(MultiDrawArrays)
+#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
+#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
+#define glMultiDrawElements MANGLE(MultiDrawElements)
+#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
+#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
+#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
+#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB)
+#define glMultiTexCoord1d MANGLE(MultiTexCoord1d)
+#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB)
+#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv)
+#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB)
+#define glMultiTexCoord1f MANGLE(MultiTexCoord1f)
+#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB)
+#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv)
+#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV)
+#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV)
+#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB)
+#define glMultiTexCoord1i MANGLE(MultiTexCoord1i)
+#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB)
+#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv)
+#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB)
+#define glMultiTexCoord1s MANGLE(MultiTexCoord1s)
+#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB)
+#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv)
+#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB)
+#define glMultiTexCoord2d MANGLE(MultiTexCoord2d)
+#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB)
+#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv)
+#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB)
+#define glMultiTexCoord2f MANGLE(MultiTexCoord2f)
+#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB)
+#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv)
+#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV)
+#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV)
+#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB)
+#define glMultiTexCoord2i MANGLE(MultiTexCoord2i)
+#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB)
+#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv)
+#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB)
+#define glMultiTexCoord2s MANGLE(MultiTexCoord2s)
+#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB)
+#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv)
+#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB)
+#define glMultiTexCoord3d MANGLE(MultiTexCoord3d)
+#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB)
+#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv)
+#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB)
+#define glMultiTexCoord3f MANGLE(MultiTexCoord3f)
+#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB)
+#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv)
+#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV)
+#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV)
+#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB)
+#define glMultiTexCoord3i MANGLE(MultiTexCoord3i)
+#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB)
+#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv)
+#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB)
+#define glMultiTexCoord3s MANGLE(MultiTexCoord3s)
+#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB)
+#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv)
+#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB)
+#define glMultiTexCoord4d MANGLE(MultiTexCoord4d)
+#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB)
+#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv)
+#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB)
+#define glMultiTexCoord4f MANGLE(MultiTexCoord4f)
+#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB)
+#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv)
+#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV)
+#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV)
+#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB)
+#define glMultiTexCoord4i MANGLE(MultiTexCoord4i)
+#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB)
+#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv)
+#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB)
+#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
+#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
+#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
+#define glMultMatrixd MANGLE(MultMatrixd)
+#define glMultMatrixf MANGLE(MultMatrixf)
+#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
+#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd)
+#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
+#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
+#define glNewList MANGLE(NewList)
+#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
+#define glNormal3b MANGLE(Normal3b)
+#define glNormal3bv MANGLE(Normal3bv)
+#define glNormal3d MANGLE(Normal3d)
+#define glNormal3dv MANGLE(Normal3dv)
+#define glNormal3f MANGLE(Normal3f)
+#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN)
+#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN)
+#define glNormal3fv MANGLE(Normal3fv)
+#define glNormal3hNV MANGLE(Normal3hNV)
+#define glNormal3hvNV MANGLE(Normal3hvNV)
+#define glNormal3i MANGLE(Normal3i)
+#define glNormal3iv MANGLE(Normal3iv)
+#define glNormal3s MANGLE(Normal3s)
+#define glNormal3sv MANGLE(Normal3sv)
+#define glNormalPointerEXT MANGLE(NormalPointerEXT)
+#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
+#define glNormalPointer MANGLE(NormalPointer)
+#define glNormalPointervINTEL MANGLE(NormalPointervINTEL)
+#define glNormalStream3bATI MANGLE(NormalStream3bATI)
+#define glNormalStream3bvATI MANGLE(NormalStream3bvATI)
+#define glNormalStream3dATI MANGLE(NormalStream3dATI)
+#define glNormalStream3dvATI MANGLE(NormalStream3dvATI)
+#define glNormalStream3fATI MANGLE(NormalStream3fATI)
+#define glNormalStream3fvATI MANGLE(NormalStream3fvATI)
+#define glNormalStream3iATI MANGLE(NormalStream3iATI)
+#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
+#define glNormalStream3sATI MANGLE(NormalStream3sATI)
+#define glNormalStream3svATI MANGLE(NormalStream3svATI)
+#define glOrtho MANGLE(Ortho)
+#define glPassTexCoordATI MANGLE(PassTexCoordATI)
+#define glPassThrough MANGLE(PassThrough)
+#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
+#define glPixelMapfv MANGLE(PixelMapfv)
+#define glPixelMapuiv MANGLE(PixelMapuiv)
+#define glPixelMapusv MANGLE(PixelMapusv)
+#define glPixelStoref MANGLE(PixelStoref)
+#define glPixelStorei MANGLE(PixelStorei)
+#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS)
+#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS)
+#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS)
+#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS)
+#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX)
+#define glPixelTransferf MANGLE(PixelTransferf)
+#define glPixelTransferi MANGLE(PixelTransferi)
+#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT)
+#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT)
+#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT)
+#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT)
+#define glPixelZoom MANGLE(PixelZoom)
+#define glPNTrianglesfATI MANGLE(PNTrianglesfATI)
+#define glPNTrianglesiATI MANGLE(PNTrianglesiATI)
+#define glPointParameterfARB MANGLE(PointParameterfARB)
+#define glPointParameterfEXT MANGLE(PointParameterfEXT)
+#define glPointParameterf MANGLE(PointParameterf)
+#define glPointParameterfSGIS MANGLE(PointParameterfSGIS)
+#define glPointParameterfvARB MANGLE(PointParameterfvARB)
+#define glPointParameterfvEXT MANGLE(PointParameterfvEXT)
+#define glPointParameterfv MANGLE(PointParameterfv)
+#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS)
+#define glPointParameteri MANGLE(PointParameteri)
+#define glPointParameteriNV MANGLE(PointParameteriNV)
+#define glPointParameteriv MANGLE(PointParameteriv)
+#define glPointParameterivNV MANGLE(PointParameterivNV)
+#define glPointSize MANGLE(PointSize)
+#define glPollAsyncSGIX MANGLE(PollAsyncSGIX)
+#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX)
+#define glPolygonMode MANGLE(PolygonMode)
+#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT)
+#define glPolygonOffset MANGLE(PolygonOffset)
+#define glPolygonStipple MANGLE(PolygonStipple)
+#define glPopAttrib MANGLE(PopAttrib)
+#define glPopClientAttrib MANGLE(PopClientAttrib)
+#define glPopMatrix MANGLE(PopMatrix)
+#define glPopName MANGLE(PopName)
+#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV)
+#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
+#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
+#define glPrioritizeTextures MANGLE(PrioritizeTextures)
+#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
+#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
+#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
+#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
+#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
+#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
+#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
+#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
+#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV)
+#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV)
+#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV)
+#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV)
+#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT)
+#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV)
+#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV)
+#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
+#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
+#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
+#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
+#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV)
+#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV)
+#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV)
+#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV)
+#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT)
+#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV)
+#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV)
+#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV)
+#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV)
+#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV)
+#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV)
+#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV)
+#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
+#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
+#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
+#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
+#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
+#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
+#define glProgramStringARB MANGLE(ProgramStringARB)
+#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
+#define glPushAttrib MANGLE(PushAttrib)
+#define glPushClientAttrib MANGLE(PushClientAttrib)
+#define glPushMatrix MANGLE(PushMatrix)
+#define glPushName MANGLE(PushName)
+#define glRasterPos2d MANGLE(RasterPos2d)
+#define glRasterPos2dv MANGLE(RasterPos2dv)
+#define glRasterPos2f MANGLE(RasterPos2f)
+#define glRasterPos2fv MANGLE(RasterPos2fv)
+#define glRasterPos2i MANGLE(RasterPos2i)
+#define glRasterPos2iv MANGLE(RasterPos2iv)
+#define glRasterPos2s MANGLE(RasterPos2s)
+#define glRasterPos2sv MANGLE(RasterPos2sv)
+#define glRasterPos3d MANGLE(RasterPos3d)
+#define glRasterPos3dv MANGLE(RasterPos3dv)
+#define glRasterPos3f MANGLE(RasterPos3f)
+#define glRasterPos3fv MANGLE(RasterPos3fv)
+#define glRasterPos3i MANGLE(RasterPos3i)
+#define glRasterPos3iv MANGLE(RasterPos3iv)
+#define glRasterPos3s MANGLE(RasterPos3s)
+#define glRasterPos3sv MANGLE(RasterPos3sv)
+#define glRasterPos4d MANGLE(RasterPos4d)
+#define glRasterPos4dv MANGLE(RasterPos4dv)
+#define glRasterPos4f MANGLE(RasterPos4f)
+#define glRasterPos4fv MANGLE(RasterPos4fv)
+#define glRasterPos4i MANGLE(RasterPos4i)
+#define glRasterPos4iv MANGLE(RasterPos4iv)
+#define glRasterPos4s MANGLE(RasterPos4s)
+#define glRasterPos4sv MANGLE(RasterPos4sv)
+#define glReadBuffer MANGLE(ReadBuffer)
+#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
+#define glReadPixels MANGLE(ReadPixels)
+#define glRectd MANGLE(Rectd)
+#define glRectdv MANGLE(Rectdv)
+#define glRectf MANGLE(Rectf)
+#define glRectfv MANGLE(Rectfv)
+#define glRecti MANGLE(Recti)
+#define glRectiv MANGLE(Rectiv)
+#define glRects MANGLE(Rects)
+#define glRectsv MANGLE(Rectsv)
+#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
+#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
+#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
+#define glRenderMode MANGLE(RenderMode)
+#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
+#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
+#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN)
+#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN)
+#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN)
+#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN)
+#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN)
+#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN)
+#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN)
+#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN)
+#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN)
+#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN)
+#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN)
+#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN)
+#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV)
+#define glResetHistogramEXT MANGLE(ResetHistogramEXT)
+#define glResetHistogram MANGLE(ResetHistogram)
+#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
+#define glResetMinmax MANGLE(ResetMinmax)
+#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
+#define glRotated MANGLE(Rotated)
+#define glRotatef MANGLE(Rotatef)
+#define glSampleCoverageARB MANGLE(SampleCoverageARB)
+#define glSampleCoverage MANGLE(SampleCoverage)
+#define glSampleMapATI MANGLE(SampleMapATI)
+#define glSampleMaskEXT MANGLE(SampleMaskEXT)
+#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
+#define glSamplePatternEXT MANGLE(SamplePatternEXT)
+#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
+#define glScaled MANGLE(Scaled)
+#define glScalef MANGLE(Scalef)
+#define glScissor MANGLE(Scissor)
+#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
+#define glSecondaryColor3b MANGLE(SecondaryColor3b)
+#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT)
+#define glSecondaryColor3bv MANGLE(SecondaryColor3bv)
+#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT)
+#define glSecondaryColor3d MANGLE(SecondaryColor3d)
+#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT)
+#define glSecondaryColor3dv MANGLE(SecondaryColor3dv)
+#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT)
+#define glSecondaryColor3f MANGLE(SecondaryColor3f)
+#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT)
+#define glSecondaryColor3fv MANGLE(SecondaryColor3fv)
+#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV)
+#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV)
+#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT)
+#define glSecondaryColor3i MANGLE(SecondaryColor3i)
+#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT)
+#define glSecondaryColor3iv MANGLE(SecondaryColor3iv)
+#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT)
+#define glSecondaryColor3s MANGLE(SecondaryColor3s)
+#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT)
+#define glSecondaryColor3sv MANGLE(SecondaryColor3sv)
+#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT)
+#define glSecondaryColor3ub MANGLE(SecondaryColor3ub)
+#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT)
+#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv)
+#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT)
+#define glSecondaryColor3ui MANGLE(SecondaryColor3ui)
+#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT)
+#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv)
+#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT)
+#define glSecondaryColor3us MANGLE(SecondaryColor3us)
+#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
+#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
+#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
+#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
+#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
+#define glSelectBuffer MANGLE(SelectBuffer)
+#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT)
+#define glSeparableFilter2D MANGLE(SeparableFilter2D)
+#define glSetFenceAPPLE MANGLE(SetFenceAPPLE)
+#define glSetFenceNV MANGLE(SetFenceNV)
+#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI)
+#define glSetInvariantEXT MANGLE(SetInvariantEXT)
+#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
+#define glShadeModel MANGLE(ShadeModel)
+#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
+#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
+#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
+#define glShaderSourceARB MANGLE(ShaderSourceARB)
+#define glShaderSource MANGLE(ShaderSource)
+#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS)
+#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX)
+#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX)
+#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX)
+#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX)
+#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX)
+#define glStencilClearTagEXT MANGLE(StencilClearTagEXT)
+#define glStencilFunc MANGLE(StencilFunc)
+#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI)
+#define glStencilFuncSeparate MANGLE(StencilFuncSeparate)
+#define glStencilMask MANGLE(StencilMask)
+#define glStencilMaskSeparate MANGLE(StencilMaskSeparate)
+#define glStencilOp MANGLE(StencilOp)
+#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
+#define glStencilOpSeparate MANGLE(StencilOpSeparate)
+#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
+#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
+#define glSwizzleEXT MANGLE(SwizzleEXT)
+#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
+#define glTangent3bEXT MANGLE(Tangent3bEXT)
+#define glTangent3bvEXT MANGLE(Tangent3bvEXT)
+#define glTangent3dEXT MANGLE(Tangent3dEXT)
+#define glTangent3dvEXT MANGLE(Tangent3dvEXT)
+#define glTangent3fEXT MANGLE(Tangent3fEXT)
+#define glTangent3fvEXT MANGLE(Tangent3fvEXT)
+#define glTangent3iEXT MANGLE(Tangent3iEXT)
+#define glTangent3ivEXT MANGLE(Tangent3ivEXT)
+#define glTangent3sEXT MANGLE(Tangent3sEXT)
+#define glTangent3svEXT MANGLE(Tangent3svEXT)
+#define glTangentPointerEXT MANGLE(TangentPointerEXT)
+#define glTbufferMask3DFX MANGLE(TbufferMask3DFX)
+#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
+#define glTestFenceNV MANGLE(TestFenceNV)
+#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
+#define glTexBufferEXT MANGLE(TexBufferEXT)
+#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
+#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
+#define glTexCoord1d MANGLE(TexCoord1d)
+#define glTexCoord1dv MANGLE(TexCoord1dv)
+#define glTexCoord1f MANGLE(TexCoord1f)
+#define glTexCoord1fv MANGLE(TexCoord1fv)
+#define glTexCoord1hNV MANGLE(TexCoord1hNV)
+#define glTexCoord1hvNV MANGLE(TexCoord1hvNV)
+#define glTexCoord1i MANGLE(TexCoord1i)
+#define glTexCoord1iv MANGLE(TexCoord1iv)
+#define glTexCoord1s MANGLE(TexCoord1s)
+#define glTexCoord1sv MANGLE(TexCoord1sv)
+#define glTexCoord2d MANGLE(TexCoord2d)
+#define glTexCoord2dv MANGLE(TexCoord2dv)
+#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN)
+#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN)
+#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN)
+#define glTexCoord2f MANGLE(TexCoord2f)
+#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN)
+#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN)
+#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN)
+#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN)
+#define glTexCoord2fv MANGLE(TexCoord2fv)
+#define glTexCoord2hNV MANGLE(TexCoord2hNV)
+#define glTexCoord2hvNV MANGLE(TexCoord2hvNV)
+#define glTexCoord2i MANGLE(TexCoord2i)
+#define glTexCoord2iv MANGLE(TexCoord2iv)
+#define glTexCoord2s MANGLE(TexCoord2s)
+#define glTexCoord2sv MANGLE(TexCoord2sv)
+#define glTexCoord3d MANGLE(TexCoord3d)
+#define glTexCoord3dv MANGLE(TexCoord3dv)
+#define glTexCoord3f MANGLE(TexCoord3f)
+#define glTexCoord3fv MANGLE(TexCoord3fv)
+#define glTexCoord3hNV MANGLE(TexCoord3hNV)
+#define glTexCoord3hvNV MANGLE(TexCoord3hvNV)
+#define glTexCoord3i MANGLE(TexCoord3i)
+#define glTexCoord3iv MANGLE(TexCoord3iv)
+#define glTexCoord3s MANGLE(TexCoord3s)
+#define glTexCoord3sv MANGLE(TexCoord3sv)
+#define glTexCoord4d MANGLE(TexCoord4d)
+#define glTexCoord4dv MANGLE(TexCoord4dv)
+#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN)
+#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN)
+#define glTexCoord4f MANGLE(TexCoord4f)
+#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN)
+#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN)
+#define glTexCoord4fv MANGLE(TexCoord4fv)
+#define glTexCoord4hNV MANGLE(TexCoord4hNV)
+#define glTexCoord4hvNV MANGLE(TexCoord4hvNV)
+#define glTexCoord4i MANGLE(TexCoord4i)
+#define glTexCoord4iv MANGLE(TexCoord4iv)
+#define glTexCoord4s MANGLE(TexCoord4s)
+#define glTexCoord4sv MANGLE(TexCoord4sv)
+#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
+#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
+#define glTexCoordPointer MANGLE(TexCoordPointer)
+#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL)
+#define glTexEnvf MANGLE(TexEnvf)
+#define glTexEnvfv MANGLE(TexEnvfv)
+#define glTexEnvi MANGLE(TexEnvi)
+#define glTexEnviv MANGLE(TexEnviv)
+#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS)
+#define glTexGend MANGLE(TexGend)
+#define glTexGendv MANGLE(TexGendv)
+#define glTexGenf MANGLE(TexGenf)
+#define glTexGenfv MANGLE(TexGenfv)
+#define glTexGeni MANGLE(TexGeni)
+#define glTexGeniv MANGLE(TexGeniv)
+#define glTexImage1D MANGLE(TexImage1D)
+#define glTexImage2D MANGLE(TexImage2D)
+#define glTexImage3DEXT MANGLE(TexImage3DEXT)
+#define glTexImage3D MANGLE(TexImage3D)
+#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
+#define glTexParameterf MANGLE(TexParameterf)
+#define glTexParameterfv MANGLE(TexParameterfv)
+#define glTexParameterIivEXT MANGLE(TexParameterIivEXT)
+#define glTexParameteri MANGLE(TexParameteri)
+#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT)
+#define glTexParameteriv MANGLE(TexParameteriv)
+#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
+#define glTexSubImage1D MANGLE(TexSubImage1D)
+#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT)
+#define glTexSubImage2D MANGLE(TexSubImage2D)
+#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
+#define glTexSubImage3D MANGLE(TexSubImage3D)
+#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
+#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
+#define glTextureLightEXT MANGLE(TextureLightEXT)
+#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
+#define glTextureNormalEXT MANGLE(TextureNormalEXT)
+#define glTrackMatrixNV MANGLE(TrackMatrixNV)
+#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
+#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
+#define glTranslated MANGLE(Translated)
+#define glTranslatef MANGLE(Translatef)
+#define glUniform1fARB MANGLE(Uniform1fARB)
+#define glUniform1f MANGLE(Uniform1f)
+#define glUniform1fvARB MANGLE(Uniform1fvARB)
+#define glUniform1fv MANGLE(Uniform1fv)
+#define glUniform1iARB MANGLE(Uniform1iARB)
+#define glUniform1i MANGLE(Uniform1i)
+#define glUniform1ivARB MANGLE(Uniform1ivARB)
+#define glUniform1iv MANGLE(Uniform1iv)
+#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
+#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
+#define glUniform2fARB MANGLE(Uniform2fARB)
+#define glUniform2f MANGLE(Uniform2f)
+#define glUniform2fvARB MANGLE(Uniform2fvARB)
+#define glUniform2fv MANGLE(Uniform2fv)
+#define glUniform2iARB MANGLE(Uniform2iARB)
+#define glUniform2i MANGLE(Uniform2i)
+#define glUniform2ivARB MANGLE(Uniform2ivARB)
+#define glUniform2iv MANGLE(Uniform2iv)
+#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
+#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
+#define glUniform3fARB MANGLE(Uniform3fARB)
+#define glUniform3f MANGLE(Uniform3f)
+#define glUniform3fvARB MANGLE(Uniform3fvARB)
+#define glUniform3fv MANGLE(Uniform3fv)
+#define glUniform3iARB MANGLE(Uniform3iARB)
+#define glUniform3i MANGLE(Uniform3i)
+#define glUniform3ivARB MANGLE(Uniform3ivARB)
+#define glUniform3iv MANGLE(Uniform3iv)
+#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
+#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
+#define glUniform4fARB MANGLE(Uniform4fARB)
+#define glUniform4f MANGLE(Uniform4f)
+#define glUniform4fvARB MANGLE(Uniform4fvARB)
+#define glUniform4fv MANGLE(Uniform4fv)
+#define glUniform4iARB MANGLE(Uniform4iARB)
+#define glUniform4i MANGLE(Uniform4i)
+#define glUniform4ivARB MANGLE(Uniform4ivARB)
+#define glUniform4iv MANGLE(Uniform4iv)
+#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
+#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
+#define glUniformBufferEXT MANGLE(UniformBufferEXT)
+#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
+#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
+#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
+#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
+#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
+#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
+#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
+#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
+#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
+#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
+#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
+#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
+#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
+#define glUnmapBufferARB MANGLE(UnmapBufferARB)
+#define glUnmapBuffer MANGLE(UnmapBuffer)
+#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
+#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
+#define glUseProgram MANGLE(UseProgram)
+#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
+#define glValidateProgramARB MANGLE(ValidateProgramARB)
+#define glValidateProgram MANGLE(ValidateProgram)
+#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
+#define glVariantbvEXT MANGLE(VariantbvEXT)
+#define glVariantdvEXT MANGLE(VariantdvEXT)
+#define glVariantfvEXT MANGLE(VariantfvEXT)
+#define glVariantivEXT MANGLE(VariantivEXT)
+#define glVariantPointerEXT MANGLE(VariantPointerEXT)
+#define glVariantsvEXT MANGLE(VariantsvEXT)
+#define glVariantubvEXT MANGLE(VariantubvEXT)
+#define glVariantuivEXT MANGLE(VariantuivEXT)
+#define glVariantusvEXT MANGLE(VariantusvEXT)
+#define glVertex2d MANGLE(Vertex2d)
+#define glVertex2dv MANGLE(Vertex2dv)
+#define glVertex2f MANGLE(Vertex2f)
+#define glVertex2fv MANGLE(Vertex2fv)
+#define glVertex2hNV MANGLE(Vertex2hNV)
+#define glVertex2hvNV MANGLE(Vertex2hvNV)
+#define glVertex2i MANGLE(Vertex2i)
+#define glVertex2iv MANGLE(Vertex2iv)
+#define glVertex2s MANGLE(Vertex2s)
+#define glVertex2sv MANGLE(Vertex2sv)
+#define glVertex3d MANGLE(Vertex3d)
+#define glVertex3dv MANGLE(Vertex3dv)
+#define glVertex3f MANGLE(Vertex3f)
+#define glVertex3fv MANGLE(Vertex3fv)
+#define glVertex3hNV MANGLE(Vertex3hNV)
+#define glVertex3hvNV MANGLE(Vertex3hvNV)
+#define glVertex3i MANGLE(Vertex3i)
+#define glVertex3iv MANGLE(Vertex3iv)
+#define glVertex3s MANGLE(Vertex3s)
+#define glVertex3sv MANGLE(Vertex3sv)
+#define glVertex4d MANGLE(Vertex4d)
+#define glVertex4dv MANGLE(Vertex4dv)
+#define glVertex4f MANGLE(Vertex4f)
+#define glVertex4fv MANGLE(Vertex4fv)
+#define glVertex4hNV MANGLE(Vertex4hNV)
+#define glVertex4hvNV MANGLE(Vertex4hvNV)
+#define glVertex4i MANGLE(Vertex4i)
+#define glVertex4iv MANGLE(Vertex4iv)
+#define glVertex4s MANGLE(Vertex4s)
+#define glVertex4sv MANGLE(Vertex4sv)
+#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
+#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
+#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
+#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
+#define glVertexAttrib1d MANGLE(VertexAttrib1d)
+#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
+#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB)
+#define glVertexAttrib1dv MANGLE(VertexAttrib1dv)
+#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV)
+#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB)
+#define glVertexAttrib1f MANGLE(VertexAttrib1f)
+#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV)
+#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB)
+#define glVertexAttrib1fv MANGLE(VertexAttrib1fv)
+#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV)
+#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV)
+#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV)
+#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB)
+#define glVertexAttrib1s MANGLE(VertexAttrib1s)
+#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV)
+#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB)
+#define glVertexAttrib1sv MANGLE(VertexAttrib1sv)
+#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV)
+#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB)
+#define glVertexAttrib2d MANGLE(VertexAttrib2d)
+#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV)
+#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB)
+#define glVertexAttrib2dv MANGLE(VertexAttrib2dv)
+#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV)
+#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB)
+#define glVertexAttrib2f MANGLE(VertexAttrib2f)
+#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV)
+#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB)
+#define glVertexAttrib2fv MANGLE(VertexAttrib2fv)
+#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV)
+#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV)
+#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV)
+#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB)
+#define glVertexAttrib2s MANGLE(VertexAttrib2s)
+#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV)
+#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB)
+#define glVertexAttrib2sv MANGLE(VertexAttrib2sv)
+#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV)
+#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB)
+#define glVertexAttrib3d MANGLE(VertexAttrib3d)
+#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV)
+#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB)
+#define glVertexAttrib3dv MANGLE(VertexAttrib3dv)
+#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV)
+#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB)
+#define glVertexAttrib3f MANGLE(VertexAttrib3f)
+#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV)
+#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB)
+#define glVertexAttrib3fv MANGLE(VertexAttrib3fv)
+#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV)
+#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV)
+#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV)
+#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB)
+#define glVertexAttrib3s MANGLE(VertexAttrib3s)
+#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV)
+#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB)
+#define glVertexAttrib3sv MANGLE(VertexAttrib3sv)
+#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV)
+#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB)
+#define glVertexAttrib4bv MANGLE(VertexAttrib4bv)
+#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB)
+#define glVertexAttrib4d MANGLE(VertexAttrib4d)
+#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV)
+#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB)
+#define glVertexAttrib4dv MANGLE(VertexAttrib4dv)
+#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV)
+#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB)
+#define glVertexAttrib4f MANGLE(VertexAttrib4f)
+#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV)
+#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB)
+#define glVertexAttrib4fv MANGLE(VertexAttrib4fv)
+#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV)
+#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV)
+#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV)
+#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB)
+#define glVertexAttrib4iv MANGLE(VertexAttrib4iv)
+#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB)
+#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv)
+#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB)
+#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv)
+#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB)
+#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv)
+#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB)
+#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub)
+#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB)
+#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv)
+#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB)
+#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv)
+#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB)
+#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv)
+#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB)
+#define glVertexAttrib4s MANGLE(VertexAttrib4s)
+#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV)
+#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB)
+#define glVertexAttrib4sv MANGLE(VertexAttrib4sv)
+#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV)
+#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV)
+#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB)
+#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv)
+#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV)
+#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB)
+#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv)
+#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
+#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
+#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
+#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
+#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
+#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT)
+#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT)
+#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT)
+#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT)
+#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT)
+#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT)
+#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT)
+#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT)
+#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT)
+#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT)
+#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT)
+#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT)
+#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT)
+#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT)
+#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT)
+#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT)
+#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT)
+#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
+#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
+#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
+#define glVertexAttribPointer MANGLE(VertexAttribPointer)
+#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
+#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV)
+#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV)
+#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV)
+#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV)
+#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV)
+#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV)
+#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV)
+#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV)
+#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV)
+#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV)
+#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV)
+#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV)
+#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV)
+#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV)
+#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV)
+#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV)
+#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV)
+#define glVertexBlendARB MANGLE(VertexBlendARB)
+#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
+#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
+#define glVertexPointerEXT MANGLE(VertexPointerEXT)
+#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
+#define glVertexPointer MANGLE(VertexPointer)
+#define glVertexPointervINTEL MANGLE(VertexPointervINTEL)
+#define glVertexStream1dATI MANGLE(VertexStream1dATI)
+#define glVertexStream1dvATI MANGLE(VertexStream1dvATI)
+#define glVertexStream1fATI MANGLE(VertexStream1fATI)
+#define glVertexStream1fvATI MANGLE(VertexStream1fvATI)
+#define glVertexStream1iATI MANGLE(VertexStream1iATI)
+#define glVertexStream1ivATI MANGLE(VertexStream1ivATI)
+#define glVertexStream1sATI MANGLE(VertexStream1sATI)
+#define glVertexStream1svATI MANGLE(VertexStream1svATI)
+#define glVertexStream2dATI MANGLE(VertexStream2dATI)
+#define glVertexStream2dvATI MANGLE(VertexStream2dvATI)
+#define glVertexStream2fATI MANGLE(VertexStream2fATI)
+#define glVertexStream2fvATI MANGLE(VertexStream2fvATI)
+#define glVertexStream2iATI MANGLE(VertexStream2iATI)
+#define glVertexStream2ivATI MANGLE(VertexStream2ivATI)
+#define glVertexStream2sATI MANGLE(VertexStream2sATI)
+#define glVertexStream2svATI MANGLE(VertexStream2svATI)
+#define glVertexStream3dATI MANGLE(VertexStream3dATI)
+#define glVertexStream3dvATI MANGLE(VertexStream3dvATI)
+#define glVertexStream3fATI MANGLE(VertexStream3fATI)
+#define glVertexStream3fvATI MANGLE(VertexStream3fvATI)
+#define glVertexStream3iATI MANGLE(VertexStream3iATI)
+#define glVertexStream3ivATI MANGLE(VertexStream3ivATI)
+#define glVertexStream3sATI MANGLE(VertexStream3sATI)
+#define glVertexStream3svATI MANGLE(VertexStream3svATI)
+#define glVertexStream4dATI MANGLE(VertexStream4dATI)
+#define glVertexStream4dvATI MANGLE(VertexStream4dvATI)
+#define glVertexStream4fATI MANGLE(VertexStream4fATI)
+#define glVertexStream4fvATI MANGLE(VertexStream4fvATI)
+#define glVertexStream4iATI MANGLE(VertexStream4iATI)
+#define glVertexStream4ivATI MANGLE(VertexStream4ivATI)
+#define glVertexStream4sATI MANGLE(VertexStream4sATI)
+#define glVertexStream4svATI MANGLE(VertexStream4svATI)
+#define glVertexWeightfEXT MANGLE(VertexWeightfEXT)
+#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT)
+#define glVertexWeighthNV MANGLE(VertexWeighthNV)
+#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
+#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
+#define glViewport MANGLE(Viewport)
+#define glWeightbvARB MANGLE(WeightbvARB)
+#define glWeightdvARB MANGLE(WeightdvARB)
+#define glWeightfvARB MANGLE(WeightfvARB)
+#define glWeightivARB MANGLE(WeightivARB)
+#define glWeightPointerARB MANGLE(WeightPointerARB)
+#define glWeightsvARB MANGLE(WeightsvARB)
+#define glWeightubvARB MANGLE(WeightubvARB)
+#define glWeightuivARB MANGLE(WeightuivARB)
+#define glWeightusvARB MANGLE(WeightusvARB)
+#define glWindowPos2dARB MANGLE(WindowPos2dARB)
+#define glWindowPos2d MANGLE(WindowPos2d)
+#define glWindowPos2dMESA MANGLE(WindowPos2dMESA)
+#define glWindowPos2dvARB MANGLE(WindowPos2dvARB)
+#define glWindowPos2dv MANGLE(WindowPos2dv)
+#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA)
+#define glWindowPos2fARB MANGLE(WindowPos2fARB)
+#define glWindowPos2f MANGLE(WindowPos2f)
+#define glWindowPos2fMESA MANGLE(WindowPos2fMESA)
+#define glWindowPos2fvARB MANGLE(WindowPos2fvARB)
+#define glWindowPos2fv MANGLE(WindowPos2fv)
+#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA)
+#define glWindowPos2iARB MANGLE(WindowPos2iARB)
+#define glWindowPos2i MANGLE(WindowPos2i)
+#define glWindowPos2iMESA MANGLE(WindowPos2iMESA)
+#define glWindowPos2ivARB MANGLE(WindowPos2ivARB)
+#define glWindowPos2iv MANGLE(WindowPos2iv)
+#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA)
+#define glWindowPos2sARB MANGLE(WindowPos2sARB)
+#define glWindowPos2s MANGLE(WindowPos2s)
+#define glWindowPos2sMESA MANGLE(WindowPos2sMESA)
+#define glWindowPos2svARB MANGLE(WindowPos2svARB)
+#define glWindowPos2sv MANGLE(WindowPos2sv)
+#define glWindowPos2svMESA MANGLE(WindowPos2svMESA)
+#define glWindowPos3dARB MANGLE(WindowPos3dARB)
+#define glWindowPos3d MANGLE(WindowPos3d)
+#define glWindowPos3dMESA MANGLE(WindowPos3dMESA)
+#define glWindowPos3dvARB MANGLE(WindowPos3dvARB)
+#define glWindowPos3dv MANGLE(WindowPos3dv)
+#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA)
+#define glWindowPos3fARB MANGLE(WindowPos3fARB)
+#define glWindowPos3f MANGLE(WindowPos3f)
+#define glWindowPos3fMESA MANGLE(WindowPos3fMESA)
+#define glWindowPos3fvARB MANGLE(WindowPos3fvARB)
+#define glWindowPos3fv MANGLE(WindowPos3fv)
+#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA)
+#define glWindowPos3iARB MANGLE(WindowPos3iARB)
+#define glWindowPos3i MANGLE(WindowPos3i)
+#define glWindowPos3iMESA MANGLE(WindowPos3iMESA)
+#define glWindowPos3ivARB MANGLE(WindowPos3ivARB)
+#define glWindowPos3iv MANGLE(WindowPos3iv)
+#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA)
+#define glWindowPos3sARB MANGLE(WindowPos3sARB)
+#define glWindowPos3s MANGLE(WindowPos3s)
+#define glWindowPos3sMESA MANGLE(WindowPos3sMESA)
+#define glWindowPos3svARB MANGLE(WindowPos3svARB)
+#define glWindowPos3sv MANGLE(WindowPos3sv)
+#define glWindowPos3svMESA MANGLE(WindowPos3svMESA)
+#define glWindowPos4dMESA MANGLE(WindowPos4dMESA)
+#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA)
+#define glWindowPos4fMESA MANGLE(WindowPos4fMESA)
+#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA)
+#define glWindowPos4iMESA MANGLE(WindowPos4iMESA)
+#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA)
+#define glWindowPos4sMESA MANGLE(WindowPos4sMESA)
+#define glWindowPos4svMESA MANGLE(WindowPos4svMESA)
+#define glWriteMaskEXT MANGLE(WriteMaskEXT)
+
+#endif /* GL_MANGLE_H */
--- /dev/null
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#ifndef __glu_h__
+#define __glu_h__
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glu_mangle.h"
+#endif
+
+#include <GL/gl.h>
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
+# undef GLAPI
+# define GLAPI __declspec(dllexport)
+#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
+/* tag specifying we're building for DLL runtime support */
+# undef GLAPI
+# define GLAPI __declspec(dllimport)
+#elif !defined(GLAPI)
+/* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+#endif /* _STATIC_MESA support */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*************************************************************/
+
+/* Extensions */
+#define GLU_EXT_object_space_tess 1
+#define GLU_EXT_nurbs_tessellator 1
+
+/* Boolean */
+#define GLU_FALSE 0
+#define GLU_TRUE 1
+
+/* Version */
+#define GLU_VERSION_1_1 1
+#define GLU_VERSION_1_2 1
+#define GLU_VERSION_1_3 1
+
+/* StringName */
+#define GLU_VERSION 100800
+#define GLU_EXTENSIONS 100801
+
+/* ErrorCode */
+#define GLU_INVALID_ENUM 100900
+#define GLU_INVALID_VALUE 100901
+#define GLU_OUT_OF_MEMORY 100902
+#define GLU_INCOMPATIBLE_GL_VERSION 100903
+#define GLU_INVALID_OPERATION 100904
+
+/* NurbsDisplay */
+/* GLU_FILL */
+#define GLU_OUTLINE_POLYGON 100240
+#define GLU_OUTLINE_PATCH 100241
+
+/* NurbsCallback */
+#define GLU_NURBS_ERROR 100103
+#define GLU_ERROR 100103
+#define GLU_NURBS_BEGIN 100164
+#define GLU_NURBS_BEGIN_EXT 100164
+#define GLU_NURBS_VERTEX 100165
+#define GLU_NURBS_VERTEX_EXT 100165
+#define GLU_NURBS_NORMAL 100166
+#define GLU_NURBS_NORMAL_EXT 100166
+#define GLU_NURBS_COLOR 100167
+#define GLU_NURBS_COLOR_EXT 100167
+#define GLU_NURBS_TEXTURE_COORD 100168
+#define GLU_NURBS_TEX_COORD_EXT 100168
+#define GLU_NURBS_END 100169
+#define GLU_NURBS_END_EXT 100169
+#define GLU_NURBS_BEGIN_DATA 100170
+#define GLU_NURBS_BEGIN_DATA_EXT 100170
+#define GLU_NURBS_VERTEX_DATA 100171
+#define GLU_NURBS_VERTEX_DATA_EXT 100171
+#define GLU_NURBS_NORMAL_DATA 100172
+#define GLU_NURBS_NORMAL_DATA_EXT 100172
+#define GLU_NURBS_COLOR_DATA 100173
+#define GLU_NURBS_COLOR_DATA_EXT 100173
+#define GLU_NURBS_TEXTURE_COORD_DATA 100174
+#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
+#define GLU_NURBS_END_DATA 100175
+#define GLU_NURBS_END_DATA_EXT 100175
+
+/* NurbsError */
+#define GLU_NURBS_ERROR1 100251
+#define GLU_NURBS_ERROR2 100252
+#define GLU_NURBS_ERROR3 100253
+#define GLU_NURBS_ERROR4 100254
+#define GLU_NURBS_ERROR5 100255
+#define GLU_NURBS_ERROR6 100256
+#define GLU_NURBS_ERROR7 100257
+#define GLU_NURBS_ERROR8 100258
+#define GLU_NURBS_ERROR9 100259
+#define GLU_NURBS_ERROR10 100260
+#define GLU_NURBS_ERROR11 100261
+#define GLU_NURBS_ERROR12 100262
+#define GLU_NURBS_ERROR13 100263
+#define GLU_NURBS_ERROR14 100264
+#define GLU_NURBS_ERROR15 100265
+#define GLU_NURBS_ERROR16 100266
+#define GLU_NURBS_ERROR17 100267
+#define GLU_NURBS_ERROR18 100268
+#define GLU_NURBS_ERROR19 100269
+#define GLU_NURBS_ERROR20 100270
+#define GLU_NURBS_ERROR21 100271
+#define GLU_NURBS_ERROR22 100272
+#define GLU_NURBS_ERROR23 100273
+#define GLU_NURBS_ERROR24 100274
+#define GLU_NURBS_ERROR25 100275
+#define GLU_NURBS_ERROR26 100276
+#define GLU_NURBS_ERROR27 100277
+#define GLU_NURBS_ERROR28 100278
+#define GLU_NURBS_ERROR29 100279
+#define GLU_NURBS_ERROR30 100280
+#define GLU_NURBS_ERROR31 100281
+#define GLU_NURBS_ERROR32 100282
+#define GLU_NURBS_ERROR33 100283
+#define GLU_NURBS_ERROR34 100284
+#define GLU_NURBS_ERROR35 100285
+#define GLU_NURBS_ERROR36 100286
+#define GLU_NURBS_ERROR37 100287
+
+/* NurbsProperty */
+#define GLU_AUTO_LOAD_MATRIX 100200
+#define GLU_CULLING 100201
+#define GLU_SAMPLING_TOLERANCE 100203
+#define GLU_DISPLAY_MODE 100204
+#define GLU_PARAMETRIC_TOLERANCE 100202
+#define GLU_SAMPLING_METHOD 100205
+#define GLU_U_STEP 100206
+#define GLU_V_STEP 100207
+#define GLU_NURBS_MODE 100160
+#define GLU_NURBS_MODE_EXT 100160
+#define GLU_NURBS_TESSELLATOR 100161
+#define GLU_NURBS_TESSELLATOR_EXT 100161
+#define GLU_NURBS_RENDERER 100162
+#define GLU_NURBS_RENDERER_EXT 100162
+
+/* NurbsSampling */
+#define GLU_OBJECT_PARAMETRIC_ERROR 100208
+#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
+#define GLU_OBJECT_PATH_LENGTH 100209
+#define GLU_OBJECT_PATH_LENGTH_EXT 100209
+#define GLU_PATH_LENGTH 100215
+#define GLU_PARAMETRIC_ERROR 100216
+#define GLU_DOMAIN_DISTANCE 100217
+
+/* NurbsTrim */
+#define GLU_MAP1_TRIM_2 100210
+#define GLU_MAP1_TRIM_3 100211
+
+/* QuadricDrawStyle */
+#define GLU_POINT 100010
+#define GLU_LINE 100011
+#define GLU_FILL 100012
+#define GLU_SILHOUETTE 100013
+
+/* QuadricCallback */
+/* GLU_ERROR */
+
+/* QuadricNormal */
+#define GLU_SMOOTH 100000
+#define GLU_FLAT 100001
+#define GLU_NONE 100002
+
+/* QuadricOrientation */
+#define GLU_OUTSIDE 100020
+#define GLU_INSIDE 100021
+
+/* TessCallback */
+#define GLU_TESS_BEGIN 100100
+#define GLU_BEGIN 100100
+#define GLU_TESS_VERTEX 100101
+#define GLU_VERTEX 100101
+#define GLU_TESS_END 100102
+#define GLU_END 100102
+#define GLU_TESS_ERROR 100103
+#define GLU_TESS_EDGE_FLAG 100104
+#define GLU_EDGE_FLAG 100104
+#define GLU_TESS_COMBINE 100105
+#define GLU_TESS_BEGIN_DATA 100106
+#define GLU_TESS_VERTEX_DATA 100107
+#define GLU_TESS_END_DATA 100108
+#define GLU_TESS_ERROR_DATA 100109
+#define GLU_TESS_EDGE_FLAG_DATA 100110
+#define GLU_TESS_COMBINE_DATA 100111
+
+/* TessContour */
+#define GLU_CW 100120
+#define GLU_CCW 100121
+#define GLU_INTERIOR 100122
+#define GLU_EXTERIOR 100123
+#define GLU_UNKNOWN 100124
+
+/* TessProperty */
+#define GLU_TESS_WINDING_RULE 100140
+#define GLU_TESS_BOUNDARY_ONLY 100141
+#define GLU_TESS_TOLERANCE 100142
+
+/* TessError */
+#define GLU_TESS_ERROR1 100151
+#define GLU_TESS_ERROR2 100152
+#define GLU_TESS_ERROR3 100153
+#define GLU_TESS_ERROR4 100154
+#define GLU_TESS_ERROR5 100155
+#define GLU_TESS_ERROR6 100156
+#define GLU_TESS_ERROR7 100157
+#define GLU_TESS_ERROR8 100158
+#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
+#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
+#define GLU_TESS_MISSING_END_POLYGON 100153
+#define GLU_TESS_MISSING_END_CONTOUR 100154
+#define GLU_TESS_COORD_TOO_LARGE 100155
+#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
+
+/* TessWinding */
+#define GLU_TESS_WINDING_ODD 100130
+#define GLU_TESS_WINDING_NONZERO 100131
+#define GLU_TESS_WINDING_POSITIVE 100132
+#define GLU_TESS_WINDING_NEGATIVE 100133
+#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
+
+/*************************************************************/
+
+
+#ifdef __cplusplus
+class GLUnurbs;
+class GLUquadric;
+class GLUtesselator;
+#else
+typedef struct GLUnurbs GLUnurbs;
+typedef struct GLUquadric GLUquadric;
+typedef struct GLUtesselator GLUtesselator;
+#endif
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+#define GLU_TESS_MAX_COORD 1.0e150
+
+/* Internal convenience typedefs */
+typedef void (GLAPIENTRYP _GLUfuncptr)();
+
+GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
+GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
+GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
+GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
+GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
+GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
+GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
+GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
+GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
+GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
+GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
+GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
+GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
+GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
+GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
+GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
+GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
+GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glu_h__ */
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.0
+ * Copyright (C) 1995-1998 Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#ifndef GLU_MANGLE_H
+#define GLU_MANGLE_H
+
+
+#define gluLookAt mgluLookAt
+#define gluOrtho2D mgluOrtho2D
+#define gluPerspective mgluPerspective
+#define gluPickMatrix mgluPickMatrix
+#define gluProject mgluProject
+#define gluUnProject mgluUnProject
+#define gluErrorString mgluErrorString
+#define gluScaleImage mgluScaleImage
+#define gluBuild1DMipmaps mgluBuild1DMipmaps
+#define gluBuild2DMipmaps mgluBuild2DMipmaps
+#define gluNewQuadric mgluNewQuadric
+#define gluDeleteQuadric mgluDeleteQuadric
+#define gluQuadricDrawStyle mgluQuadricDrawStyle
+#define gluQuadricOrientation mgluQuadricOrientation
+#define gluQuadricNormals mgluQuadricNormals
+#define gluQuadricTexture mgluQuadricTexture
+#define gluQuadricCallback mgluQuadricCallback
+#define gluCylinder mgluCylinder
+#define gluSphere mgluSphere
+#define gluDisk mgluDisk
+#define gluPartialDisk mgluPartialDisk
+#define gluNewNurbsRenderer mgluNewNurbsRenderer
+#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
+#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
+#define gluNurbsProperty mgluNurbsProperty
+#define gluGetNurbsProperty mgluGetNurbsProperty
+#define gluBeginCurve mgluBeginCurve
+#define gluEndCurve mgluEndCurve
+#define gluNurbsCurve mgluNurbsCurve
+#define gluBeginSurface mgluBeginSurface
+#define gluEndSurface mgluEndSurface
+#define gluNurbsSurface mgluNurbsSurface
+#define gluBeginTrim mgluBeginTrim
+#define gluEndTrim mgluEndTrim
+#define gluPwlCurve mgluPwlCurve
+#define gluNurbsCallback mgluNurbsCallback
+#define gluNewTess mgluNewTess
+#define gluDeleteTess mgluDeleteTess
+#define gluTessBeginPolygon mgluTessBeginPolygon
+#define gluTessBeginContour mgluTessBeginContour
+#define gluTessVertex mgluTessVertex
+#define gluTessEndPolygon mgluTessEndPolygon
+#define gluTessEndContour mgluTessEndContour
+#define gluTessProperty mgluTessProperty
+#define gluTessNormal mgluTessNormal
+#define gluTessCallback mgluTessCallback
+#define gluGetTessProperty mgluGetTessProperty
+#define gluBeginPolygon mgluBeginPolygon
+#define gluNextContour mgluNextContour
+#define gluEndPolygon mgluEndPolygon
+#define gluGetString mgluGetString
+#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
+#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
+#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
+#define gluBuild3DMipmaps mgluBuild3DMipmaps
+#define gluCheckExtension mgluCheckExtension
+#define gluUnProject4 mgluUnProject4
+#define gluNurbsCallbackData mgluNurbsCallbackData
+#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
+
+#endif
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_H
+#define GLX_H
+
+
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+# ifdef __cplusplus
+/* VMS Xlib.h gives problems with C++.
+ * this avoids a bunch of trivial warnings */
+#pragma message disable nosimpint
+#endif
+#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#ifdef __VMS
+# ifdef __cplusplus
+#pragma message enable nosimpint
+#endif
+#endif
+#include <GL/gl.h>
+
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glx_mangle.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+#define GLX_EXTENSION_NAME "GLX"
+
+
+
+/*
+ * Tokens for glXChooseVisual and glXGetConfig:
+ */
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
+
+
+/*
+ * Error codes returned by glXGetConfig:
+ */
+#define GLX_BAD_SCREEN 1
+#define GLX_BAD_ATTRIBUTE 2
+#define GLX_NO_EXTENSION 3
+#define GLX_BAD_VISUAL 4
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+
+
+/*
+ * GLX 1.1 and later:
+ */
+#define GLX_VENDOR 1
+#define GLX_VERSION 2
+#define GLX_EXTENSIONS 3
+
+
+/*
+ * GLX 1.3 and later:
+ */
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
+#define GLX_SAMPLES 0x186a1 /*100001*/
+
+
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+
+
+extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
+ int *attribList );
+
+extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
+ GLXContext shareList, Bool direct );
+
+extern void glXDestroyContext( Display *dpy, GLXContext ctx );
+
+extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
+ GLXContext ctx);
+
+extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+ unsigned long mask );
+
+extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
+
+extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
+ Pixmap pixmap );
+
+extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
+
+extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
+
+extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
+
+extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
+ int attrib, int *value );
+
+extern GLXContext glXGetCurrentContext( void );
+
+extern GLXDrawable glXGetCurrentDrawable( void );
+
+extern void glXWaitGL( void );
+
+extern void glXWaitX( void );
+
+extern void glXUseXFont( Font font, int first, int count, int list );
+
+
+
+/* GLX 1.1 and later */
+extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+
+extern const char *glXQueryServerString( Display *dpy, int screen, int name );
+
+extern const char *glXGetClientString( Display *dpy, int name );
+
+
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value );
+
+extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
+ int *nelements );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+ GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+ Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+ Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList,
+ Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+ int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask );
+
+
+/* GLX 1.4 and later */
+extern void (*glXGetProcAddress(const GLubyte *procname))( void );
+
+
+#ifndef GLX_GLXEXT_LEGACY
+
+#include <GL/glxext.h>
+
+#else
+
+
+
+/*
+ * ARB 2. GLX_ARB_get_proc_address
+ */
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+
+typedef void (*__GLXextFuncPtr)(void);
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+
+#endif /* GLX_ARB_get_proc_address */
+
+
+
+#endif /* GLX_GLXEXT_LEGACY */
+
+
+/**
+ ** The following aren't in glxext.h yet.
+ **/
+
+
+/*
+ * ???. GLX_NV_vertex_array_range
+ */
+#ifndef GLX_NV_vertex_array_range
+#define GLX_NV_vertex_array_range
+
+extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void glXFreeMemoryNV(GLvoid *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
+
+#endif /* GLX_NV_vertex_array_range */
+
+
+/*
+ * ???. GLX_MESA_allocate_memory
+ */
+#ifndef GLX_MESA_allocate_memory
+#define GLX_MESA_allocate_memory 1
+
+extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
+extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
+extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
+typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
+typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
+
+#endif /* GLX_MESA_allocate_memory */
+
+
+/*
+ * ARB ?. GLX_ARB_render_texture
+ * XXX This was never finalized!
+ */
+#ifndef GLX_ARB_render_texture
+#define GLX_ARB_render_texture 1
+
+extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
+
+#endif /* GLX_ARB_render_texture */
+
+
+/*
+ * Remove this when glxext.h is updated.
+ */
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+
+#endif /* GLX_NV_float_buffer */
+
+
+
+/*
+ * #?. GLX_MESA_swap_frame_usage
+ */
+#ifndef GLX_MESA_swap_frame_usage
+#define GLX_MESA_swap_frame_usage 1
+
+extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
+extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
+typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+#endif /* GLX_MESA_swap_frame_usage */
+
+
+
+/*
+ * #?. GLX_MESA_swap_control
+ */
+#ifndef GLX_MESA_swap_control
+#define GLX_MESA_swap_control 1
+
+extern int glXSwapIntervalMESA(unsigned int interval);
+extern int glXGetSwapIntervalMESA(void);
+
+typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
+typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
+
+#endif /* GLX_MESA_swap_control */
+
+
+
+/*
+ * #?. GLX_EXT_texture_from_pixmap
+ * XXX not finished?
+ */
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
+
+
+
+/*** Should these go here, or in another header? */
+/*
+** GLX Events
+*/
+typedef struct {
+ int event_type; /* GLX_DAMAGED or GLX_SAVED */
+ int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* XID of Drawable */
+ unsigned int buffer_mask; /* mask indicating which buffers are affected */
+ unsigned int aux_buffer; /* which aux buffer was affected */
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXPbufferClobberEvent;
+
+typedef union __GLXEvent {
+ GLXPbufferClobberEvent glxpbufferclobber;
+ long pad[24];
+} GLXEvent;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_MANGLE_H
+#define GLX_MANGLE_H
+
+#define glXChooseVisual mglXChooseVisual
+#define glXCreateContext mglXCreateContext
+#define glXDestroyContext mglXDestroyContext
+#define glXMakeCurrent mglXMakeCurrent
+#define glXCopyContext mglXCopyContext
+#define glXSwapBuffers mglXSwapBuffers
+#define glXCreateGLXPixmap mglXCreateGLXPixmap
+#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
+#define glXQueryExtension mglXQueryExtension
+#define glXQueryVersion mglXQueryVersion
+#define glXIsDirect mglXIsDirect
+#define glXGetConfig mglXGetConfig
+#define glXGetCurrentContext mglXGetCurrentContext
+#define glXGetCurrentDrawable mglXGetCurrentDrawable
+#define glXWaitGL mglXWaitGL
+#define glXWaitX mglXWaitX
+#define glXUseXFont mglXUseXFont
+#define glXQueryExtensionsString mglXQueryExtensionsString
+#define glXQueryServerString mglXQueryServerString
+#define glXGetClientString mglXGetClientString
+#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
+#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
+#define glXCopySubBufferMESA mglXCopySubBufferMESA
+#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
+#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
+
+/* GLX 1.2 */
+#define glXGetCurrentDisplay mglXGetCurrentDisplay
+
+/* GLX 1.3 */
+#define glXChooseFBConfig mglXChooseFBConfig
+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
+#define glXGetFBConfigs mglXGetFBConfigs
+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
+#define glXCreateWindow mglXCreateWindow
+#define glXDestroyWindow mglXDestroyWindow
+#define glXCreatePixmap mglXCreatePixmap
+#define glXDestroyPixmap mglXDestroyPixmap
+#define glXCreatePbuffer mglXCreatePbuffer
+#define glXDestroyPbuffer mglXDestroyPbuffer
+#define glXQueryDrawable mglXQueryDrawable
+#define glXCreateNewContext mglXCreateNewContext
+#define glXMakeContextCurrent mglXMakeContextCurrent
+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
+#define glXQueryContext mglXQueryContext
+#define glXSelectEvent mglXSelectEvent
+#define glXGetSelectedEvent mglXGetSelectedEvent
+
+/* GLX 1.4 */
+#define glXGetProcAddress mglXGetProcAddress
+
+
+#endif
--- /dev/null
+#ifndef __glxext_h_
+#define __glxext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glxext.h last updated 2007/04/21 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GLX_GLXEXT_VERSION 19
+
+#ifndef GLX_VERSION_1_3
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_SAMPLE_BUFFERS 100000
+#define GLX_SAMPLES 100001
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+#define GLX_SAMPLES_ARB 100001
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
+#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS 100000
+#define GLX_SAMPLES_SGIS 100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT 0x800A
+#define GLX_VISUAL_ID_EXT 0x800B
+#define GLX_SCREEN_EXT 0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX 0x00000001
+#define GLX_PIXMAP_BIT_SGIX 0x00000002
+#define GLX_RGBA_BIT_SGIX 0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX 0x8010
+#define GLX_RENDER_TYPE_SGIX 0x8011
+#define GLX_X_RENDERABLE_SGIX 0x8012
+#define GLX_FBCONFIG_ID_SGIX 0x8013
+#define GLX_RGBA_TYPE_SGIX 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX 0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
+#define GLX_LARGEST_PBUFFER_SGIX 0x801C
+#define GLX_WIDTH_SGIX 0x801D
+#define GLX_HEIGHT_SGIX 0x801E
+#define GLX_EVENT_MASK_SGIX 0x801F
+#define GLX_DAMAGED_SGIX 0x8020
+#define GLX_SAVED_SGIX 0x8021
+#define GLX_WINDOW_SGIX 0x8022
+#define GLX_PBUFFER_SGIX 0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX 0x00000000
+#define GLX_SYNC_SWAP_SGIX 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS 0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
+#define GLX_SAMPLES_3DFX 0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA 0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML 0x8060
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
+#define GLX_BAD_HYPERPIPE_SGIX 92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
+#define GLX_PIPE_RECT_SGIX 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
+#define GLX_HYPERPIPE_ID_SGIX 0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+#endif
+
+
+/*************************************************************/
+
+#ifndef GLX_ARB_get_proc_address
+typedef void (*__GLXextFuncPtr)(void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* i.d. of Drawable */
+ int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+ int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+ unsigned int mask; /* mask indicating which buffers are affected*/
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS )
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <inttypes.h> /* Fallback option */
+#endif
+#endif
+
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
+extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
+extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
+extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
+extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
+extern void glXDestroyWindow (Display *, GLXWindow);
+extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
+extern void glXDestroyPixmap (Display *, GLXPixmap);
+extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
+extern void glXDestroyPbuffer (Display *, GLXPbuffer);
+extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
+extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
+extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawable (void);
+extern Display * glXGetCurrentDisplay (void);
+extern int glXQueryContext (Display *, GLXContext, int, int *);
+extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_ARB_fbconfig_float 1
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *);
+extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
+extern GLXContextID glXGetContextIDEXT (const GLXContext);
+extern GLXContext glXImportContextEXT (Display *, GLXContextID);
+extern void glXFreeContextEXT (Display *, GLXContext);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
+extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
+extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
+extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *, Window, float);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
+extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
+extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
+extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
+extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
+extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
+extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int channel;
+ unsigned int
+ participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
+extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
+extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
+extern int glXBindHyperpipeSGIX (Display *, int);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
+extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
+extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_EXT_fbconfig_packed_float 1
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *);
+extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/***************************************************************************
+ * *
+ * Author : Jouk Jansen (joukj@hrem.nano.tudelft.nl) *
+ * *
+ * Last revision : 31 August 2006 *
+ * *
+ * Repair definitions of Runtime library functions when compiling with *
+ * /name=(as_is) on OpenVMS *
+ * *
+ ***************************************************************************/
+
+#ifndef VMS_X_FIX
+#define VMS_X_FIX
+
+#define decw$_select DECW$_SELECT
+#define DtSaverGetWindows DTSAVERGETWINDOWS
+#define MrmFetchWidget MRMFETCHWIDGET
+#define MrmInitialize MRMINITIALIZE
+#define MrmOpenHierarchy MRMOPENHIERARCHY
+#define MrmRegisterNames MRMREGISTERNAMES
+#define XAddExtension XADDEXTENSION
+#define XAddHosts XADDHOSTS
+#define XAllocClassHint XALLOCCLASSHINT
+#define XAllocColor XALLOCCOLOR
+#define XAllocColorCells XALLOCCOLORCELLS
+#define XAllocIconSize XALLOCICONSIZE
+#define XAllocNamedColor XALLOCNAMEDCOLOR
+#define XAllocSizeHints XALLOCSIZEHINTS
+#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
+#define XAllocWMHints XALLOCWMHINTS
+#define XAllowEvents XALLOWEVENTS
+#define XAutoRepeatOff XAUTOREPEATOFF
+#define XAutoRepeatOn XAUTOREPEATON
+#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
+#define XBell XBELL
+#define XBitmapPad XBITMAPPAD
+#define XBlackPixel XBLACKPIXEL
+#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
+#define XCellsOfScreen XCELLSOFSCREEN
+#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
+#define XChangeGC XCHANGEGC
+#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
+#define XChangePointerControl XCHANGEPOINTERCONTROL
+#define XChangeProperty XCHANGEPROPERTY
+#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
+#define XCheckIfEvent XCHECKIFEVENT
+#define XCheckMaskEvent XCHECKMASKEVENT
+#define XCheckTypedEvent XCHECKTYPEDEVENT
+#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
+#define XCheckWindowEvent XCHECKWINDOWEVENT
+#define XClearArea XCLEARAREA
+#define XClearWindow XCLEARWINDOW
+#define XClipBox XCLIPBOX
+#define XCloseDisplay XCLOSEDISPLAY
+#define XCloseIM XCLOSEIM
+#define XConfigureWindow XCONFIGUREWINDOW
+#define XConvertSelection XCONVERTSELECTION
+#define XCopyArea XCOPYAREA
+#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
+#define XCopyGC XCOPYGC
+#define XCopyPlane XCOPYPLANE
+#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
+#define XCreateColormap XCREATECOLORMAP
+#define XCreateFontCursor XCREATEFONTCURSOR
+#define XCreateFontSet XCREATEFONTSET
+#define XCreateGC XCREATEGC
+#define XCreateGlyphCursor XCREATEGLYPHCURSOR
+#define XCreateIC XCREATEIC
+#define XCreateImage XCREATEIMAGE
+#define XCreatePixmap XCREATEPIXMAP
+#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
+#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
+#define XCreateRegion XCREATEREGION
+#define XCreateSimpleWindow XCREATESIMPLEWINDOW
+#define XCreateWindow XCREATEWINDOW
+#define XDefaultColormap XDEFAULTCOLORMAP
+#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
+#define XDefaultDepth XDEFAULTDEPTH
+#define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN
+#define XDefaultGC XDEFAULTGC
+#define XDefaultRootWindow XDEFAULTROOTWINDOW
+#define XDefaultScreen XDEFAULTSCREEN
+#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
+#define XDefaultVisual XDEFAULTVISUAL
+#define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN
+#define XDefineCursor XDEFINECURSOR
+#define XDeleteContext XDELETECONTEXT
+#define XDeleteProperty XDELETEPROPERTY
+#define XDestroyIC XDESTROYIC
+#define XDestroyRegion XDESTROYREGION
+#define XDestroySubwindows XDESTROYSUBWINDOWS
+#define XDestroyWindow XDESTROYWINDOW
+#define XDisableAccessControl XDISABLEACCESSCONTROL
+#define XDisplayCells XDISPLAYCELLS
+#define XDisplayHeight XDISPLAYHEIGHT
+#define XDisplayKeycodes XDISPLAYKEYCODES
+#define XDisplayName XDISPLAYNAME
+#define XDisplayOfIM XDISPLAYOFIM
+#define XDisplayOfScreen XDISPLAYOFSCREEN
+#define XDisplayString XDISPLAYSTRING
+#define XDisplayWidth XDISPLAYWIDTH
+#define XDoesBackingStore XDOESBACKINGSTORE
+#define XDrawArc XDRAWARC
+#define XDrawArcs XDRAWARCS
+#define XDrawImageString XDRAWIMAGESTRING
+#define XDrawImageString16 XDRAWIMAGESTRING16
+#define XDrawLine XDRAWLINE
+#define XDrawLines XDRAWLINES
+#define XDrawPoint XDRAWPOINT
+#define XDrawPoints XDRAWPOINTS
+#define XDrawRectangle XDRAWRECTANGLE
+#define XDrawRectangles XDRAWRECTANGLES
+#define XDrawSegments XDRAWSEGMENTS
+#define XDrawString XDRAWSTRING
+#define XDrawString16 XDRAWSTRING16
+#define XDrawText XDRAWTEXT
+#define XDrawText16 XDRAWTEXT16
+#define XESetCloseDisplay XESETCLOSEDISPLAY
+#define XEmptyRegion XEMPTYREGION
+#define XEnableAccessControl XENABLEACCESSCONTROL
+#define XEqualRegion XEQUALREGION
+#define XEventsQueued XEVENTSQUEUED
+#define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE
+#define XExtentsOfFontSet XEXTENTSOFFONTSET
+#define XFetchBuffer XFETCHBUFFER
+#define XFetchBytes XFETCHBYTES
+#define XFetchName XFETCHNAME
+#define XFillArc XFILLARC
+#define XFillArcs XFILLARCS
+#define XFillPolygon XFILLPOLYGON
+#define XFillRectangle XFILLRECTANGLE
+#define XFillRectangles XFILLRECTANGLES
+#define XFilterEvent XFILTEREVENT
+#define XFindContext XFINDCONTEXT
+#define XFlush XFLUSH
+#define XFontsOfFontSet XFONTSOFFONTSET
+#define XForceScreenSaver XFORCESCREENSAVER
+#define XFree XFREE
+#define XFreeColormap XFREECOLORMAP
+#define XFreeColors XFREECOLORS
+#define XFreeCursor XFREECURSOR
+#define XFreeDeviceList XFREEDEVICELIST
+#define XFreeDeviceState XFREEDEVICESTATE
+#define XFreeFont XFREEFONT
+#define XFreeFontInfo XFREEFONTINFO
+#define XFreeFontNames XFREEFONTNAMES
+#define XFreeFontSet XFREEFONTSET
+#define XFreeGC XFREEGC
+#define XFreeModifiermap XFREEMODIFIERMAP
+#define XFreePixmap XFREEPIXMAP
+#define XFreeStringList XFREESTRINGLIST
+#define XGContextFromGC XGCONTEXTFROMGC
+#define XGeometry XGEOMETRY
+#define XGetAtomName XGETATOMNAME
+#define XGetClassHint XGETCLASSHINT
+#define XGetCommand XGETCOMMAND
+#define XGetDefault XGETDEFAULT
+#define XGetErrorDatabaseText XGETERRORDATABASETEXT
+#define XGetErrorText XGETERRORTEXT
+#define XGetExtensionVersion XGETEXTENSIONVERSION
+#define XGetFontProperty XGETFONTPROPERTY
+#define XGetGCValues XGETGCVALUES
+#define XGetGeometry XGETGEOMETRY
+#define XGetICValues XGETICVALUES
+#define XGetIMValues XGETIMVALUES
+#define XGetIconName XGETICONNAME
+#define XGetIconSizes XGETICONSIZES
+#define XGetImage XGETIMAGE
+#define XGetInputFocus XGETINPUTFOCUS
+#define XGetKeyboardControl XGETKEYBOARDCONTROL
+#define XGetKeyboardMapping XGETKEYBOARDMAPPING
+#define XGetModifierMapping XGETMODIFIERMAPPING
+#define XGetMotionEvents XGETMOTIONEVENTS
+#define XGetNormalHints XGETNORMALHINTS
+#define XGetPointerControl XGETPOINTERCONTROL
+#define XGetPointerMapping XGETPOINTERMAPPING
+#define XGetRGBColormaps XGETRGBCOLORMAPS
+#define XGetScreenSaver XGETSCREENSAVER
+#define XGetSelectionOwner XGETSELECTIONOWNER
+#define XGetStandardColormap XGETSTANDARDCOLORMAP
+#define XGetSubImage XGETSUBIMAGE
+#define XGetTextProperty XGETTEXTPROPERTY
+#define XGetVisualInfo XGETVISUALINFO
+#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
+#define XGetWMHints XGETWMHINTS
+#define XGetWMIconName XGETWMICONNAME
+#define XGetWMName XGETWMNAME
+#define XGetWMNormalHints XGETWMNORMALHINTS
+#define XGetWindowAttributes XGETWINDOWATTRIBUTES
+#define XGetWindowProperty XGETWINDOWPROPERTY
+#define XGrabButton XGRABBUTTON
+#define XGrabKeyboard XGRABKEYBOARD
+#define XGrabPointer XGRABPOINTER
+#define XGrabServer XGRABSERVER
+#define XHeightMMOfScreen XHEIGHTMMOFSCREEN
+#define XHeightOfScreen XHEIGHTOFSCREEN
+#define XIconifyWindow XICONIFYWINDOW
+#define XIfEvent XIFEVENT
+#define XInitExtension XINITEXTENSION
+#define XInitImage XINITIMAGE
+#define XInstallColormap XINSTALLCOLORMAP
+#define XInternAtom XINTERNATOM
+#define XInternAtoms XINTERNATOMS
+#define XIntersectRegion XINTERSECTREGION
+#define XKeycodeToKeysym XKEYCODETOKEYSYM
+#define XKeysymToKeycode XKEYSYMTOKEYCODE
+#define XKeysymToString XKEYSYMTOSTRING
+#define XKillClient XKILLCLIENT
+#define XListDepths XLISTDEPTHS
+#define XListFonts XLISTFONTS
+#define XListFontsWithInfo XLISTFONTSWITHINFO
+#define XListHosts XLISTHOSTS
+#define XListInputDevices XLISTINPUTDEVICES
+#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
+#define XListPixmapFormats XLISTPIXMAPFORMATS
+#define XListProperties XLISTPROPERTIES
+#define XLoadFont XLOADFONT
+#define XLoadQueryFont XLOADQUERYFONT
+#define XLookupColor XLOOKUPCOLOR
+#define XLookupKeysym XLOOKUPKEYSYM
+#define XLookupString XLOOKUPSTRING
+#define XLowerWindow XLOWERWINDOW
+#define XMapRaised XMAPRAISED
+#define XMapSubwindows XMAPSUBWINDOWS
+#define XMapWindow XMAPWINDOW
+#define XMaskEvent XMASKEVENT
+#define XMatchVisualInfo XMATCHVISUALINFO
+#define XMaxRequestSize XMAXREQUESTSIZE
+#define XMissingExtension XMISSINGEXTENSION
+#define XMoveResizeWindow XMOVERESIZEWINDOW
+#define XMoveWindow XMOVEWINDOW
+#define XNextEvent XNEXTEVENT
+#define XNextRequest XNEXTREQUEST
+#define XNoOp XNOOP
+#define XOffsetRegion XOFFSETREGION
+#define XOpenDevice XOPENDEVICE
+#define XOpenDisplay XOPENDISPLAY
+#define XOpenIM XOPENIM
+#define XParseColor XPARSECOLOR
+#define XParseGeometry XPARSEGEOMETRY
+#define XPeekEvent XPEEKEVENT
+#define XPeekIfEvent XPEEKIFEVENT
+#define XPending XPENDING
+#define XPointInRegion XPOINTINREGION
+#define XPolygonRegion XPOLYGONREGION
+#define XPutBackEvent XPUTBACKEVENT
+#define XPutImage XPUTIMAGE
+#define XQLength XQLENGTH
+#define XQueryBestCursor XQUERYBESTCURSOR
+#define XQueryBestStipple XQUERYBESTSTIPPLE
+#define XQueryColor XQUERYCOLOR
+#define XQueryColors XQUERYCOLORS
+#define XQueryDeviceState XQUERYDEVICESTATE
+#define XQueryExtension XQUERYEXTENSION
+#define XQueryFont XQUERYFONT
+#define XQueryKeymap XQUERYKEYMAP
+#define XQueryPointer XQUERYPOINTER
+#define XQueryTree XQUERYTREE
+#define XRaiseWindow XRAISEWINDOW
+#define XReadBitmapFile XREADBITMAPFILE
+#define XRecolorCursor XRECOLORCURSOR
+#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
+#define XRectInRegion XRECTINREGION
+#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
+#define XRemoveHosts XREMOVEHOSTS
+#define XReparentWindow XREPARENTWINDOW
+#define XResetScreenSaver XRESETSCREENSAVER
+#define XResizeWindow XRESIZEWINDOW
+#define XResourceManagerString XRESOURCEMANAGERSTRING
+#define XRestackWindows XRESTACKWINDOWS
+#define XRotateBuffers XROTATEBUFFERS
+#define XRootWindow XROOTWINDOW
+#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
+#define XSaveContext XSAVECONTEXT
+#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
+#define XScreenOfDisplay XSCREENOFDISPLAY
+#define XSelectAsyncEvent XSELECTASYNCEVENT
+#define XSelectAsyncInput XSELECTASYNCINPUT
+#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
+#define XSelectInput XSELECTINPUT
+#define XSendEvent XSENDEVENT
+#define XServerVendor XSERVERVENDOR
+#define XSetArcMode XSETARCMODE
+#define XSetBackground XSETBACKGROUND
+#define XSetClassHint XSETCLASSHINT
+#define XSetClipMask XSETCLIPMASK
+#define XSetClipOrigin XSETCLIPORIGIN
+#define XSetClipRectangles XSETCLIPRECTANGLES
+#define XSetCloseDownMode XSETCLOSEDOWNMODE
+#define XSetCommand XSETCOMMAND
+#define XSetDashes XSETDASHES
+#define XSetErrorHandler XSETERRORHANDLER
+#define XSetExtensionErrorHandler XSETEXTENSIONERRORHANDLER
+#define XSetFillRule XSETFILLRULE
+#define XSetFillStyle XSETFILLSTYLE
+#define XSetFont XSETFONT
+#define XSetForeground XSETFOREGROUND
+#define XSetFunction XSETFUNCTION
+#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
+#define XSetICFocus XSETICFOCUS
+#define XSetICValues XSETICVALUES
+#define XSetIOErrorHandler XSETIOERRORHANDLER
+#define XSetIconName XSETICONNAME
+#define XSetInputFocus XSETINPUTFOCUS
+#define XSetLineAttributes XSETLINEATTRIBUTES
+#define XSetLocaleModifiers XSETLOCALEMODIFIERS
+#define XSetNormalHints XSETNORMALHINTS
+#define XSetPlaneMask XSETPLANEMASK
+#define XSetRegion XSETREGION
+#define XSetRGBColormaps XSETRGBCOLORMAPS
+#define XSetScreenSaver XSETSCREENSAVER
+#define XSetSelectionOwner XSETSELECTIONOWNER
+#define XSetStandardProperties XSETSTANDARDPROPERTIES
+#define XSetState XSETSTATE
+#define XSetStipple XSETSTIPPLE
+#define XSetSubwindowMode XSETSUBWINDOWMODE
+#define XSetTSOrigin XSETTSORIGIN
+#define XSetTextProperty XSETTEXTPROPERTY
+#define XSetTile XSETTILE
+#define XSetTransientForHint XSETTRANSIENTFORHINT
+#define XSetWMClientMachine XSETWMCLIENTMACHINE
+#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
+#define XSetWMHints XSETWMHINTS
+#define XSetWMIconName XSETWMICONNAME
+#define XSetWMName XSETWMNAME
+#define XSetWMNormalHints XSETWMNORMALHINTS
+#define XSetWMProperties XSETWMPROPERTIES
+#define XSetWMProtocols XSETWMPROTOCOLS
+#define XSetWMSizeHints XSETWMSIZEHINTS
+#define XSetWindowBackground XSETWINDOWBACKGROUND
+#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
+#define XSetWindowBorder XSETWINDOWBORDER
+#define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP
+#define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH
+#define XSetWindowColormap XSETWINDOWCOLORMAP
+#define XShapeCombineMask XSHAPECOMBINEMASK
+#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
+#define XShapeGetRectangles XSHAPEGETRECTANGLES
+#define XShapeQueryExtension XSHAPEQUERYEXTENSION
+#define XShmAttach XSHMATTACH
+#define XShmCreateImage XSHMCREATEIMAGE
+#define XShmCreatePixmap XSHMCREATEPIXMAP
+#define XShmDetach XSHMDETACH
+#define XShmGetEventBase XSHMGETEVENTBASE
+#define XShmPutImage XSHMPUTIMAGE
+#define XShmQueryExtension XSHMQUERYEXTENSION
+#define XShmQueryVersion XSHMQUERYVERSION
+#define XShrinkRegion XSHRINKREGION
+#define XStoreBuffer XSTOREBUFFER
+#define XStoreBytes XSTOREBYTES
+#define XStoreColor XSTORECOLOR
+#define XStoreColors XSTORECOLORS
+#define XStoreName XSTORENAME
+#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
+#define XStringToKeysym XSTRINGTOKEYSYM
+#define XSubtractRegion XSUBTRACTREGION
+#define XSupportsLocale XSUPPORTSLOCALE
+#define XSync XSYNC
+#define XSynchronize XSYNCHRONIZE
+#define XTextExtents XTEXTEXTENTS
+#define XTextExtents16 XTEXTEXTENTS16
+#define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST
+#define XTextWidth XTEXTWIDTH
+#define XTextWidth16 XTEXTWIDTH16
+#define XTranslateCoordinates XTRANSLATECOORDINATES
+#define XUndefineCursor XUNDEFINECURSOR
+#define XUngrabButton XUNGRABBUTTON
+#define XUngrabKeyboard XUNGRABKEYBOARD
+#define XUngrabPointer XUNGRABPOINTER
+#define XUngrabServer XUNGRABSERVER
+#define XUninstallColormap XUNINSTALLCOLORMAP
+#define XUnionRectWithRegion XUNIONRECTWITHREGION
+#define XUnionRegion XUNIONREGION
+#define XUniqueContext XUNIQUECONTEXT
+#define XUnloadFont XUNLOADFONT
+#define XUnmapWindow XUNMAPWINDOW
+#define XUnsetICFocus XUNSETICFOCUS
+#define XVaCreateNestedList XVACREATENESTEDLIST
+#define XVisualIDFromVisual XVISUALIDFROMVISUAL
+#define XWMGeometry XWMGEOMETRY
+#define XWarpPointer XWARPPOINTER
+#define XWhitePixel XWHITEPIXEL
+#define XWhitePixelOfScreen XWHITEPIXELOFSCREEN
+#define XWidthMMOfScreen XWIDTHMMOFSCREEN
+#define XWidthOfScreen XWIDTHOFSCREEN
+#define XWindowEvent XWINDOWEVENT
+#define XWithdrawWindow XWITHDRAWWINDOW
+#define XXorRegion XXORREGION
+#define XcmsQueryColor XCMSQUERYCOLOR
+#define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME
+#define XdbeFreeVisualInfo XDBEFREEVISUALINFO
+#define XdbeGetVisualInfo XDBEGETVISUALINFO
+#define XdbeQueryExtension XDBEQUERYEXTENSION
+#define XdbeSwapBuffers XDBESWAPBUFFERS
+#define XextAddDisplay XEXTADDDISPLAY
+#define XextFindDisplay XEXTFINDDISPLAY
+#define XextRemoveDisplay XEXTREMOVEDISPLAY
+#define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT
+#define XmActivateProtocol XMACTIVATEPROTOCOL
+#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
+#define XmAddProtocols XMADDPROTOCOLS
+#define XmChangeColor XMCHANGECOLOR
+#define XmClipboardCopy XMCLIPBOARDCOPY
+#define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME
+#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
+#define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE
+#define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT
+#define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT
+#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
+#define XmClipboardLock XMCLIPBOARDLOCK
+#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
+#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
+#define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE
+#define XmClipboardUnlock XMCLIPBOARDUNLOCK
+#define XmCommandError XMCOMMANDERROR
+#define XmCommandGetChild XMCOMMANDGETCHILD
+#define XmCommandSetValue XMCOMMANDSETVALUE
+#define XmCreateArrowButton XMCREATEARROWBUTTON
+#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
+#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
+#define XmCreateCascadeButton XMCREATECASCADEBUTTON
+#define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET
+#define XmCreateDialogShell XMCREATEDIALOGSHELL
+#define XmCreateDragIcon XMCREATEDRAGICON
+#define XmCreateDrawingArea XMCREATEDRAWINGAREA
+#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
+#define XmCreateErrorDialog XMCREATEERRORDIALOG
+#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
+#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
+#define XmCreateForm XMCREATEFORM
+#define XmCreateFormDialog XMCREATEFORMDIALOG
+#define XmCreateFrame XMCREATEFRAME
+#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
+#define XmCreateLabel XMCREATELABEL
+#define XmCreateLabelGadget XMCREATELABELGADGET
+#define XmCreateList XMCREATELIST
+#define XmCreateMainWindow XMCREATEMAINWINDOW
+#define XmCreateMenuBar XMCREATEMENUBAR
+#define XmCreateMessageBox XMCREATEMESSAGEBOX
+#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
+#define XmCreateOptionMenu XMCREATEOPTIONMENU
+#define XmCreatePanedWindow XMCREATEPANEDWINDOW
+#define XmCreatePopupMenu XMCREATEPOPUPMENU
+#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
+#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
+#define XmCreatePushButton XMCREATEPUSHBUTTON
+#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
+#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
+#define XmCreateRadioBox XMCREATERADIOBOX
+#define XmCreateRowColumn XMCREATEROWCOLUMN
+#define XmCreateScale XMCREATESCALE
+#define XmCreateScrollBar XMCREATESCROLLBAR
+#define XmCreateScrolledList XMCREATESCROLLEDLIST
+#define XmCreateScrolledText XMCREATESCROLLEDTEXT
+#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
+#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
+#define XmCreateSeparator XMCREATESEPARATOR
+#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
+#define XmCreateSimpleMenuBar XMCREATESIMPLEMENUBAR
+#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
+#define XmCreateText XMCREATETEXT
+#define XmCreateTextField XMCREATETEXTFIELD
+#define XmCreateToggleButton XMCREATETOGGLEBUTTON
+#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
+#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
+#define XmCvtCTToXmString XMCVTCTTOXMSTRING
+#define XmDestroyPixmap XMDESTROYPIXMAP
+#define XmDragStart XMDRAGSTART
+#define XmDropSiteRegister XMDROPSITEREGISTER
+#define XmDropSiteUnregister XMDROPSITEUNREGISTER
+#define XmDropSiteUpdate XMDROPSITEUPDATE
+#define XmDropTransferStart XMDROPTRANSFERSTART
+#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
+#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
+#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
+#define XmFontListCopy XMFONTLISTCOPY
+#define XmFontListCreate XMFONTLISTCREATE
+#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
+#define XmFontListEntryFree XMFONTLISTENTRYFREE
+#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
+#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
+#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
+#define XmFontListFree XMFONTLISTFREE
+#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
+#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
+#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
+#define XmFontListNextEntry XMFONTLISTNEXTENTRY
+#define XmGetColors XMGETCOLORS
+#define XmGetColorCalculation XMGETCOLORCALCULATION
+#define XmGetFocusWidget XMGETFOCUSWIDGET
+#define XmGetMenuCursor XMGETMENUCURSOR
+#define XmGetPixmap XMGETPIXMAP
+#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
+#define XmGetTearOffControl XMGETTEAROFFCONTROL
+#define XmGetXmDisplay XMGETXMDISPLAY
+#define XmImMbLookupString XMIMMBLOOKUPSTRING
+#define XmImRegister XMIMREGISTER
+#define XmImSetFocusValues XMIMSETFOCUSVALUES
+#define XmImSetValues XMIMSETVALUES
+#define XmImUnregister XMIMUNREGISTER
+#define XmImUnsetFocus XMIMUNSETFOCUS
+#define XmInstallImage XMINSTALLIMAGE
+#define XmInternAtom XMINTERNATOM
+#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
+#define XmListAddItem XMLISTADDITEM
+#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
+#define XmListAddItems XMLISTADDITEMS
+#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
+#define XmListDeleteAllItems XMLISTDELETEALLITEMS
+#define XmListDeleteItem XMLISTDELETEITEM
+#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
+#define XmListDeletePos XMLISTDELETEPOS
+#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
+#define XmListDeselectPos XMLISTDESELECTPOS
+#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
+#define XmListGetMatchPos XMLISTGETMATCHPOS
+#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
+#define XmListItemExists XMLISTITEMEXISTS
+#define XmListItemPos XMLISTITEMPOS
+#define XmListPosSelected XMLISTPOSSELECTED
+#define XmListReplaceItems XMLISTREPLACEITEMS
+#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
+#define XmListSelectItem XMLISTSELECTITEM
+#define XmListSelectPos XMLISTSELECTPOS
+#define XmListSetBottomPos XMLISTSETBOTTOMPOS
+#define XmListSetItem XMLISTSETITEM
+#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
+#define XmListSetPos XMLISTSETPOS
+#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
+#define XmMenuPosition XMMENUPOSITION
+#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
+#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
+#define XmOptionLabelGadget XMOPTIONLABELGADGET
+#define XmProcessTraversal XMPROCESSTRAVERSAL
+#define XmQmotif XMQMOTIF
+#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
+#define XmRemoveProtocols XMREMOVEPROTOCOLS
+#define XmRemoveTabGroup XMREMOVETABGROUP
+#define XmRepTypeGetId XMREPTYPEGETID
+#define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON
+#define XmRepTypeRegister XMREPTYPEREGISTER
+#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
+#define XmScrollBarGetValues XMSCROLLBARGETVALUES
+#define XmScrollBarSetValues XMSCROLLBARSETVALUES
+#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
+#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
+#define XmSetColorCalculation XMSETCOLORCALCULATION
+#define XmStringByteCompare XMSTRINGBYTECOMPARE
+#define XmStringCompare XMSTRINGCOMPARE
+#define XmStringConcat XMSTRINGCONCAT
+#define XmStringCopy XMSTRINGCOPY
+#define XmStringCreate XMSTRINGCREATE
+#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
+#define XmStringCreateLtoR XMSTRINGCREATELTOR
+#define XmStringCreateSimple XMSTRINGCREATESIMPLE
+#define XmStringDraw XMSTRINGDRAW
+#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
+#define XmStringExtent XMSTRINGEXTENT
+#define XmStringFree XMSTRINGFREE
+#define XmStringFreeContext XMSTRINGFREECONTEXT
+#define XmStringGetLtoR XMSTRINGGETLTOR
+#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
+#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
+#define XmStringInitContext XMSTRINGINITCONTEXT
+#define XmStringLength XMSTRINGLENGTH
+#define XmStringLtoRCreate XMSTRINGLTORCREATE
+#define XmStringNConcat XMSTRINGNCONCAT
+#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
+#define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE
+#define XmStringWidth XMSTRINGWIDTH
+#define XmTextClearSelection XMTEXTCLEARSELECTION
+#define XmTextCopy XMTEXTCOPY
+#define XmTextCut XMTEXTCUT
+#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
+#define XmTextFieldCopy XMTEXTFIELDCOPY
+#define XmTextFieldCut XMTEXTFIELDCUT
+#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
+#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
+#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
+#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
+#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
+#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
+#define XmTextFieldGetString XMTEXTFIELDGETSTRING
+#define XmTextFieldInsert XMTEXTFIELDINSERT
+#define XmTextFieldPaste XMTEXTFIELDPASTE
+#define XmTextFieldRemove XMTEXTFIELDREMOVE
+#define XmTextFieldReplace XMTEXTFIELDREPLACE
+#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
+#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
+#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
+#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
+#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
+#define XmTextFieldSetString XMTEXTFIELDSETSTRING
+#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
+#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
+#define XmTextGetEditable XMTEXTGETEDITABLE
+#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
+#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
+#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
+#define XmTextGetSelection XMTEXTGETSELECTION
+#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
+#define XmTextGetString XMTEXTGETSTRING
+#define XmTextInsert XMTEXTINSERT
+#define XmTextPaste XMTEXTPASTE
+#define XmTextPosToXY XMTEXTPOSTOXY
+#define XmTextRemove XMTEXTREMOVE
+#define XmTextReplace XMTEXTREPLACE
+#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
+#define XmTextSetEditable XMTEXTSETEDITABLE
+#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
+#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
+#define XmTextSetSelection XMTEXTSETSELECTION
+#define XmTextSetString XMTEXTSETSTRING
+#define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER
+#define XmTextShowPosition XMTEXTSHOWPOSITION
+#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
+#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
+#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
+#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
+#define XmUninstallImage XMUNINSTALLIMAGE
+#define XmUpdateDisplay XMUPDATEDISPLAY
+#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
+#define XmbDrawString XMBDRAWSTRING
+#define XmbLookupString XMBLOOKUPSTRING
+#define XmbResetIC XMBRESETIC
+#define XmbSetWMProperties XMBSETWMPROPERTIES
+#define XmbTextEscapement XMBTEXTESCAPEMENT
+#define XmbTextExtents XMBTEXTEXTENTS
+#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
+#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
+#define XmbufCreateBuffers XMBUFCREATEBUFFERS
+#define XmbufDestroyBuffers XMBUFDESTROYBUFFERS
+#define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS
+#define XmbufQueryExtension XMBUFQUERYEXTENSION
+#define Xmemory_free XMEMORY_FREE
+#define Xmemory_malloc XMEMORY_MALLOC
+#define XmuClientWindow XMUCLIENTWINDOW
+#define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION
+#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
+#define XmuInternAtom XMUINTERNATOM
+#define XmuInternStrings XMUINTERNSTRINGS
+#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
+#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
+#define XrmCombineDatabase XRMCOMBINEDATABASE
+#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
+#define XrmDestroyDatabase XRMDESTROYDATABASE
+#define XrmGetDatabase XRMGETDATABASE
+#define XrmGetFileDatabase XRMGETFILEDATABASE
+#define XrmGetResource XRMGETRESOURCE
+#define XrmGetStringDatabase XRMGETSTRINGDATABASE
+#define XrmInitialize XRMINITIALIZE
+#define XrmMergeDatabases XRMMERGEDATABASES
+#define XrmParseCommand XRMPARSECOMMAND
+#define XrmPermStringToQuark XRMPERMSTRINGTOQUARK
+#define XrmPutFileDatabase XRMPUTFILEDATABASE
+#define XrmPutLineResource XRMPUTLINERESOURCE
+#define XrmPutStringResource XRMPUTSTRINGRESOURCE
+#define XrmQGetResource XRMQGETRESOURCE
+#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
+#define XrmQuarkToString XRMQUARKTOSTRING
+#define XrmSetDatabase XRMSETDATABASE
+#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XtAddCallback XTADDCALLBACK
+#define XtAddCallbacks XTADDCALLBACKS
+#define XtAddConverter XTADDCONVERTER
+#define XtAddEventHandler XTADDEVENTHANDLER
+#define XtAddExposureToRegion XTADDEXPOSURETOREGION
+#define XtAddGrab XTADDGRAB
+#define XtAddRawEventHandler XTADDRAWEVENTHANDLER
+#define XtAllocateGC XTALLOCATEGC
+#define XtAppAddActions XTAPPADDACTIONS
+#define XtAppAddInput XTAPPADDINPUT
+#define XtAppAddTimeOut XTAPPADDTIMEOUT
+#define XtAppAddWorkProc XTAPPADDWORKPROC
+#define XtAppCreateShell XTAPPCREATESHELL
+#define XtAppError XTAPPERROR
+#define XtAppErrorMsg XTAPPERRORMSG
+#define XtAppGetErrorDatabase XTAPPGETERRORDATABASE
+#define XtAppGetErrorDatabaseText XTAPPGETERRORDATABASETEXT
+#define XtAppSetErrorMsgHandler XTAPPSETERRORMSGHANDLER
+#define XtAppInitialize XTAPPINITIALIZE
+#define XtAppMainLoop XTAPPMAINLOOP
+#define XtAppNextEvent XTAPPNEXTEVENT
+#define XtAppPeekEvent XTAPPPEEKEVENT
+#define XtAppPending XTAPPPENDING
+#define XtAppProcessEvent XTAPPPROCESSEVENT
+#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
+#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
+#define XtAppSetTypeConverter XTAPPSETTYPECONVERTER
+#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
+#define XtAppWarningMsg XTAPPWARNINGMSG
+#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
+#define XtAppWarning XTAPPWARNING
+#define XtAugmentTranslations XTAUGMENTTRANSLATIONS
+#define XtCallActionProc XTCALLACTIONPROC
+#define XtCallCallbackList XTCALLCALLBACKLIST
+#define XtCallCallbacks XTCALLCALLBACKS
+#define XtCallConverter XTCALLCONVERTER
+#define XtCalloc XTCALLOC
+#ifndef NOXTDISPLAY
+#define XtClass XTCLASS
+#endif
+#define XtCloseDisplay XTCLOSEDISPLAY
+#define XtConfigureWidget XTCONFIGUREWIDGET
+#define XtConvert XTCONVERT
+#define XtConvertAndStore XTCONVERTANDSTORE
+#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
+#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
+#define XtCreatePopupShell XTCREATEPOPUPSHELL
+#define XtCreateWidget XTCREATEWIDGET
+#define XtCreateWindow XTCREATEWINDOW
+#define XtCvtStringToFont XTCVTSTRINGTOFONT
+#define XtDatabase XTDATABASE
+#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
+#define XtDestroyWidget XTDESTROYWIDGET
+#define XtDisownSelection XTDISOWNSELECTION
+#define XtDispatchEvent XTDISPATCHEVENT
+#ifndef NOXTDISPLAY
+#define XtDisplay XTDISPLAY
+#endif
+#define XtDisplayInitialize XTDISPLAYINITIALIZE
+#define XtDisplayOfObject XTDISPLAYOFOBJECT
+#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
+#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
+#define XtError XTERROR
+#define XtErrorMsg XTERRORMSG
+#define XtFree XTFREE
+#define XtGetActionKeysym XTGETACTIONKEYSYM
+#define XtGetActionList XTGETACTIONLIST
+#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
+#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
+#define XtGetClassExtension XTGETCLASSEXTENSION
+#define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST
+#define XtGetGC XTGETGC
+#define XtGetMultiClickTime XTGETMULTICLICKTIME
+#define XtGetResourceList XTGETRESOURCELIST
+#define XtGetSelectionValue XTGETSELECTIONVALUE
+#define XtGetSelectionValues XTGETSELECTIONVALUES
+#define XtGetSubresources XTGETSUBRESOURCES
+#define XtGetValues XTGETVALUES
+#define XtGrabButton XTGRABBUTTON
+#define XtGrabKeyboard XTGRABKEYBOARD
+#define XtGrabPointer XTGRABPOINTER
+#define XtHasCallbacks XTHASCALLBACKS
+#define XtInitialize XTINITIALIZE
+#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
+#define XtInsertEventHandler XTINSERTEVENTHANDLER
+#define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER
+#define XtInstallAccelerators XTINSTALLACCELERATORS
+#define XtIsManaged XTISMANAGED
+#define XtIsObject XTISOBJECT
+#ifndef NOXTDISPLAY
+#define XtIsRealized XTISREALIZED
+#endif
+#define XtIsSensitive XTISSENSITIVE
+#define XtIsSubclass XTISSUBCLASS
+#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
+#define XtMainLoop XTMAINLOOP
+#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
+#define XtMakeResizeRequest XTMAKERESIZEREQUEST
+#define XtMalloc XTMALLOC
+#define XtManageChild XTMANAGECHILD
+#define XtManageChildren XTMANAGECHILDREN
+#define XtMergeArgLists XTMERGEARGLISTS
+#define XtMoveWidget XTMOVEWIDGET
+#define XtName XTNAME
+#define XtNameToWidget XTNAMETOWIDGET
+#define XtOpenApplication XTOPENAPPLICATION
+#define XtOpenDisplay XTOPENDISPLAY
+#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
+#define XtOwnSelection XTOWNSELECTION
+#ifndef NOXTDISPLAY
+#define XtParent XTPARENT
+#endif
+#define XtParseAcceleratorTable XTPARSEACCELERATORTABLE
+#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
+#define XtPopdown XTPOPDOWN
+#define XtPopup XTPOPUP
+#define XtPopupSpringLoaded XTPOPUPSPRINGLOADED
+#define XtQueryGeometry XTQUERYGEOMETRY
+#define XtRealizeWidget XTREALIZEWIDGET
+#define XtRealloc XTREALLOC
+#define XtRegisterDrawable _XTREGISTERWINDOW
+#define XtRegisterGrabAction XTREGISTERGRABACTION
+#define XtReleaseGC XTRELEASEGC
+#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
+#define XtRemoveCallback XTREMOVECALLBACK
+#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
+#define XtRemoveGrab XTREMOVEGRAB
+#define XtRemoveInput XTREMOVEINPUT
+#define XtRemoveTimeOut XTREMOVETIMEOUT
+#define XtRemoveWorkProc XTREMOVEWORKPROC
+#define XtResizeWidget XTRESIZEWIDGET
+#define XtResolvePathname XTRESOLVEPATHNAME
+#ifndef NOXTDISPLAY
+#define XtScreen XTSCREEN
+#endif
+#define XtScreenDatabase XTSCREENDATABASE
+#define XtScreenOfObject XTSCREENOFOBJECT
+#define XtSessionReturnToken XTSESSIONRETURNTOKEN
+#define XtSetErrorHandler XTSETERRORHANDLER
+#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
+#define XtSetLanguageProc XTSETLANGUAGEPROC
+#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
+#define XtSetSensitive XTSETSENSITIVE
+#define XtSetTypeConverter XTSETTYPECONVERTER
+#define XtSetValues XTSETVALUES
+#define XtShellStrings XTSHELLSTRINGS
+#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING
+#define XtStrings XTSTRINGS
+#define XtToolkitInitialize XTTOOLKITINITIALIZE
+#define XtTranslateCoords XTTRANSLATECOORDS
+#define XtTranslateKeycode XTTRANSLATEKEYCODE
+#define XtUngrabButton XTUNGRABBUTTON
+#define XtUngrabKeyboard XTUNGRABKEYBOARD
+#define XtUngrabPointer XTUNGRABPOINTER
+#define XtUnmanageChild XTUNMANAGECHILD
+#define XtUnmanageChildren XTUNMANAGECHILDREN
+#define XtUnrealizeWidget XTUNREALIZEWIDGET
+#define XtUnregisterDrawable _XTUNREGISTERWINDOW
+#define XtVaAppCreateShell XTVAAPPCREATESHELL
+#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
+#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
+#define XtVaCreateWidget XTVACREATEWIDGET
+#define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES
+#define XtVaGetValues XTVAGETVALUES
+#define XtVaSetValues XTVASETVALUES
+#define XtWarning XTWARNING
+#define XtWarningMsg XTWARNINGMSG
+#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
+#ifndef NOXTDISPLAY
+#define XtWindow XTWINDOW
+#endif
+#define XtWindowOfObject XTWINDOWOFOBJECT
+#define XtWindowToWidget XTWINDOWTOWIDGET
+#define XwcDrawImageString XWCDRAWIMAGESTRING
+#define XwcDrawString XWCDRAWSTRING
+#define XwcFreeStringList XWCFREESTRINGLIST
+#define XwcTextEscapement XWCTEXTESCAPEMENT
+#define XwcTextExtents XWCTEXTEXTENTS
+#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
+#define XwcLookupString XWCLOOKUPSTRING
+#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
+#define _XAllocTemp _XALLOCTEMP
+#define _XDeqAsyncHandler _XDEQASYNCHANDLER
+#define _XEatData _XEATDATA
+#define _XFlush _XFLUSH
+#define _XFreeTemp _XFREETEMP
+#define _XGetAsyncReply _XGETASYNCREPLY
+#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS
+#define _XRead _XREAD
+#define _XReadPad _XREADPAD
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
+#define _XReply _XREPLY
+#define _XSend _XSEND
+#define _XUnregisterFilter _XUNREGISTERFILTER
+#define _XVIDtoVisual _XVIDTOVISUAL
+#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
+#define _XmClearBorder _XMCLEARBORDER
+#define _XmConfigureObject _XMCONFIGUREOBJECT
+#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
+#define _XmDrawArrow _XMDRAWARROW
+#define _XmDrawShadows _XMDRAWSHADOWS
+#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
+#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
+#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
+#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
+#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
+#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
+#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
+#define _XmGrabKeyboard _XMGRABKEYBOARD
+#define _XmGrabPointer _XMGRABPOINTER
+#define _XmInheritClass _XMINHERITCLASS
+#define _XmInputForGadget _XMINPUTFORGADGET
+#define _XmInputInGadget _XMINPUTINGADGET
+#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
+#define _XmMenuPopDown _XMMENUPOPDOWN
+#define _XmMoveObject _XMMOVEOBJECT
+#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
+#define _XmOSBuildFileList _XMOSBUILDFILELIST
+#define _XmOSFileCompare _XMOSFILECOMPARE
+#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
+#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
+#define _XmPostPopupMenu _XMPOSTPOPUPMENU
+#define _XmPrimitiveEnter _XMPRIMITIVEENTER
+#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
+#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
+#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
+#define _XmStringDraw _XMSTRINGDRAW
+#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
+#define _XmStrings _XMSTRINGS
+#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
+#define _XmToVerticalPixels _XMTOVERTICALPIXELS
+#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
+#define _Xm_fastPtr _XM_FASTPTR
+#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
+#define _XtCopyFromArg _XTCOPYFROMARG
+#define _XtCountVaList _XTCOUNTVALIST
+#define _XtInherit _XTINHERIT
+#define _XtInheritTranslations _XTINHERITTRANSLATIONS
+#define _XtIsSubclassOf _XTISSUBCLASSOF
+#define _XtVaToArgList _XTVATOARGLIST
+#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
+#define cli$dcl_parse CLI$DCL_PARSE
+#define cli$get_value CLI$GET_VALUE
+#define cli$present CLI$PRESENT
+#define compositeClassRec COMPOSITECLASSREC
+#define compositeWidgetClass COMPOSITEWIDGETCLASS
+#define constraintClassRec CONSTRAINTCLASSREC
+#define constraintWidgetClass CONSTRAINTWIDGETCLASS
+#define coreWidgetClass COREWIDGETCLASS
+#define exe$getspi EXE$GETSPI
+#define lbr$close LBR$CLOSE
+#define lbr$get_header LBR$GET_HEADER
+#define lbr$get_index LBR$GET_INDEX
+#define lbr$get_record LBR$GET_RECORD
+#define lbr$ini_control LBR$INI_CONTROL
+#define lbr$lookup_key LBR$LOOKUP_KEY
+#define lbr$open LBR$OPEN
+#define lbr$output_help LBR$OUTPUT_HELP
+#define lib$add_times LIB$ADD_TIMES
+#define lib$addx LIB$ADDX
+#define lib$create_dir LIB$CREATE_DIR
+#define lib$create_vm_zone LIB$CREATE_VM_ZONE
+#define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME
+#define lib$cvt_htb LIB$CVT_HTB
+#define lib$cvt_vectim LIB$CVT_VECTIM
+#define lib$day LIB$DAY
+#define lib$day_of_week LIB$DAY_OF_WEEK
+#define lib$delete_symbol LIB$DELETE_SYMBOL
+#define lib$delete_vm_zone LIB$DELETE_VM_ZONE
+#define lib$disable_ctrl LIB$DISABLE_CTRL
+#define lib$ediv LIB$EDIV
+#define lib$emul LIB$EMUL
+#define lib$enable_ctrl LIB$ENABLE_CTRL
+#define lib$find_vm_zone LIB$FIND_VM_ZONE
+#define lib$format_date_time LIB$FORMAT_DATE_TIME
+#define lib$free_timer LIB$FREE_TIMER
+#define lib$free_vm LIB$FREE_VM
+#define lib$get_ef LIB$GET_EF
+#define lib$get_foreign LIB$GET_FOREIGN
+#define lib$get_input LIB$GET_INPUT
+#define lib$get_users_language LIB$GET_USERS_LANGUAGE
+#define lib$get_vm LIB$GET_VM
+#define lib$get_symbol LIB$GET_SYMBOL
+#define lib$getdvi LIB$GETDVI
+#define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT
+#define lib$init_timer LIB$INIT_TIMER
+#define lib$find_file LIB$FIND_FILE
+#define lib$find_file_end LIB$FIND_FILE_END
+#define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL
+#define lib$mult_delta_time LIB$MULT_DELTA_TIME
+#define lib$put_output LIB$PUT_OUTPUT
+#define lib$rename_file LIB$RENAME_FILE
+#define lib$reset_vm_zone LIB$RESET_VM_ZONE
+#define lib$set_symbol LIB$SET_SYMBOL
+#define lib$sfree1_dd LIB$SFREE1_DD
+#define lib$show_vm LIB$SHOW_VM
+#define lib$show_vm_zone LIB$SHOW_VM_ZONE
+#define lib$spawn LIB$SPAWN
+#define lib$stat_timer LIB$STAT_TIMER
+#define lib$subx LIB$SUBX
+#define lib$sub_times LIB$SUB_TIMES
+#define lib$wait LIB$WAIT
+#define mail$send_add_address MAIL$SEND_ADD_ADDRESS
+#define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE
+#define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART
+#define mail$send_begin MAIL$SEND_BEGIN
+#define mail$send_end MAIL$SEND_END
+#define mail$send_message MAIL$SEND_MESSAGE
+#define ncs$convert NCS$CONVERT
+#define ncs$get_cf NCS$GET_CF
+#define objectClass OBJECTCLASS
+#define objectClassRec OBJECTCLASSREC
+#define overrideShellClassRec OVERRIDESHELLCLASSREC
+#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
+#define pthread_attr_create PTHREAD_ATTR_CREATE
+#define pthread_attr_delete PTHREAD_ATTR_DELETE
+#define pthread_attr_destroy PTHREAD_ATTR_DESTROY
+#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP
+#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP
+#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED
+#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
+#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
+#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
+#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
+#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
+#define pthread_attr_init PTHREAD_ATTR_INIT
+#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
+#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE
+#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP
+#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED
+#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO
+#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
+#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
+#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
+#ifndef pthread_attr_setscope
+# define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE
+#endif
+#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
+#define pthread_cancel PTHREAD_CANCEL
+#define pthread_cancel_e PTHREAD_CANCEL_E
+#define pthread_cond_broadcast PTHREAD_COND_BROADCAST
+#define pthread_cond_destroy PTHREAD_COND_DESTROY
+#define pthread_cond_init PTHREAD_COND_INIT
+#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP
+#define pthread_cond_signal PTHREAD_COND_SIGNAL
+#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP
+#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
+#define pthread_cond_wait PTHREAD_COND_WAIT
+#define pthread_condattr_create PTHREAD_CONDATTR_CREATE
+#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE
+#define pthread_condattr_init PTHREAD_CONDATTR_INIT
+#define pthread_create PTHREAD_CREATE
+#define pthread_delay_np PTHREAD_DELAY_NP
+#define pthread_detach PTHREAD_DETACH
+#define pthread_equal PTHREAD_EQUAL
+#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
+#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
+#define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP
+#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
+#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
+#define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP
+#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
+#define pthread_exit PTHREAD_EXIT
+#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
+#define pthread_getprio PTHREAD_GETPRIO
+#define pthread_getschedparam PTHREAD_GETSCHEDPARAM
+#define pthread_getscheduler PTHREAD_GETSCHEDULER
+#define pthread_getspecific PTHREAD_GETSPECIFIC
+#define pthread_getunique_np PTHREAD_GETUNIQUE_NP
+#define pthread_join PTHREAD_JOIN
+#define pthread_join32 PTHREAD_JOIN32
+#define pthread_key_create PTHREAD_KEY_CREATE
+#define pthread_key_delete PTHREAD_KEY_DELETE
+#define pthread_keycreate PTHREAD_KEYCREATE
+#define pthread_kill PTHREAD_KILL
+#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
+#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
+#define pthread_mutex_init PTHREAD_MUTEX_INIT
+#define pthread_mutex_lock PTHREAD_MUTEX_LOCK
+#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK
+#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
+#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE
+#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE
+#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY
+#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP
+#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT
+#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP
+#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP
+#define pthread_once PTHREAD_ONCE
+#define pthread_resume_np PTHREAD_RESUME_NP
+#define pthread_self PTHREAD_SELF
+#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
+#define pthread_setcancel PTHREAD_SETCANCEL
+#define pthread_setcancelstate PTHREAD_SETCANCELSTATE
+#define pthread_setcanceltype PTHREAD_SETCANCELTYPE
+#define pthread_setprio PTHREAD_SETPRIO
+#define pthread_setschedparam PTHREAD_SETSCHEDPARAM
+#define pthread_setscheduler PTHREAD_SETSCHEDULER
+#define pthread_setspecific PTHREAD_SETSPECIFIC
+#define pthread_suspend_np PTHREAD_SUSPEND_NP
+#define pthread_testcancel PTHREAD_TESTCANCEL
+#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
+#define pthread_yield PTHREAD_YIELD
+#define pthread_yield_np PTHREAD_YIELD_NP
+#define rectObjClass RECTOBJCLASS
+#define rectObjClassRec RECTOBJCLASSREC
+#define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS
+#define shellWidgetClass SHELLWIDGETCLASS
+#define shmat SHMAT
+#define shmctl SHMCTL
+#define shmdt SHMDT
+#define shmget SHMGET
+#define smg$create_key_table SMG$CREATE_KEY_TABLE
+#define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD
+#define smg$read_composed_line SMG$READ_COMPOSED_LINE
+#define sys$add_ident SYS$ADD_IDENT
+#define sys$asctoid SYS$ASCTOID
+#define sys$assign SYS$ASSIGN
+#define sys$bintim SYS$BINTIM
+#define sys$cancel SYS$CANCEL
+#define sys$cantim SYS$CANTIM
+#define sys$check_access SYS$CHECK_ACCESS
+#define sys$close SYS$CLOSE
+#define sys$connect SYS$CONNECT
+#define sys$create SYS$CREATE
+#define sys$create_user_profile SYS$CREATE_USER_PROFILE
+#define sys$crembx SYS$CREMBX
+#define sys$creprc SYS$CREPRC
+#define sys$crmpsc SYS$CRMPSC
+#define sys$dassgn SYS$DASSGN
+#define sys$dclast SYS$DCLAST
+#define sys$dclexh SYS$DCLEXH
+#define sys$delprc SYS$DELPRC
+#define sys$deq SYS$DEQ
+#define sys$dgblsc SYS$DGBLSC
+#define sys$display SYS$DISPLAY
+#define sys$enq SYS$ENQ
+#define sys$enqw SYS$ENQW
+#define sys$erase SYS$ERASE
+#define sys$fao SYS$FAO
+#define sys$faol SYS$FAOL
+#define sys$find_held SYS$FIND_HELD
+#define sys$finish_rdb SYS$FINISH_RDB
+#define sys$flush SYS$FLUSH
+#define sys$forcex SYS$FORCEX
+#define sys$get SYS$GET
+#define sys$get_security SYS$GET_SECURITY
+#define sys$getdviw SYS$GETDVIW
+#define sys$getjpi SYS$GETJPI
+#define sys$getjpiw SYS$GETJPIW
+#define sys$getlkiw SYS$GETLKIW
+#define sys$getmsg SYS$GETMSG
+#define sys$getsyi SYS$GETSYI
+#define sys$getsyiw SYS$GETSYIW
+#define sys$gettim SYS$GETTIM
+#define sys$getuai SYS$GETUAI
+#define sys$grantid SYS$GRANTID
+#define sys$hash_password SYS$HASH_PASSWORD
+#define sys$hiber SYS$HIBER
+#define sys$mgblsc SYS$MGBLSC
+#define sys$numtim SYS$NUMTIM
+#define sys$open SYS$OPEN
+#define sys$parse SYS$PARSE
+#define sys$parse_acl SYS$PARSE_ACL
+#define sys$parse_acl SYS$PARSE_ACL
+#define sys$persona_assume SYS$PERSONA_ASSUME
+#define sys$persona_create SYS$PERSONA_CREATE
+#define sys$persona_delete SYS$PERSONA_DELETE
+#define sys$process_scan SYS$PROCESS_SCAN
+#define sys$put SYS$PUT
+#define sys$qio SYS$QIO
+#define sys$qiow SYS$QIOW
+#define sys$read SYS$READ
+#define sys$resched SYS$RESCHED
+#define sys$rewind SYS$REWIND
+#define sys$search SYS$SEARCH
+#define sys$set_security SYS$SET_SECURITY
+#define sys$setast SYS$SETAST
+#define sys$setef SYS$SETEF
+#define sys$setimr SYS$SETIMR
+#define sys$setpri SYS$SETPRI
+#define sys$setprn SYS$SETPRN
+#define sys$setprv SYS$SETPRV
+#define sys$setswm SYS$SETSWM
+#define sys$setuai SYS$SETUAI
+#define sys$sndopr SYS$SNDOPR
+#define sys$synch SYS$SYNCH
+#define sys$trnlnm SYS$TRNLNM
+#define sys$update SYS$UPDATE
+#define sys$wake SYS$WAKE
+#define sys$write SYS$WRITE
+#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
+#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
+#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
+#define vendorShellClassRec VENDORSHELLCLASSREC
+#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
+#define widgetClass WIDGETCLASS
+#define widgetClassRec WIDGETCLASSREC
+#define wmShellClassRec WMSHELLCLASSREC
+#define wmShellWidgetClass WMSHELLWIDGETCLASS
+#define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK
+#define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH
+#define x$soft_reenable_asts X$SOFT_REENABLE_ASTS
+#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
+#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
+#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
+#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
+#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
+#define xmCommandWidgetClass XMCOMMANDWIDGETCLASS
+#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
+#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
+#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
+#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
+#define xmFormWidgetClass XMFORMWIDGETCLASS
+#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
+#define xmGadgetClass XMGADGETCLASS
+#define xmLabelGadgetClass XMLABELGADGETCLASS
+#define xmLabelWidgetClass XMLABELWIDGETCLASS
+#define xmListWidgetClass XMLISTWIDGETCLASS
+#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
+#define xmManagerClassRec XMMANAGERCLASSREC
+#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
+#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
+#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
+#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
+#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
+#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
+#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
+#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
+#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
+#define xmSashWidgetClass XMSASHWIDGETCLASS
+#define xmScaleWidgetClass XMSCALEWIDGETCLASS
+#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
+#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
+#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
+#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
+#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
+#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
+#define xmTextWidgetClass XMTEXTWIDGETCLASS
+#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
+#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
+
+#if (__VMS_VER < 80200000)
+# define SetReqLen(req,n,badlen) \
+ if ((req->length + n) > (unsigned)65535) { \
+ n = badlen; \
+ req->length += n; \
+ } else \
+ req->length += n
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void XtFree(char*);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+#ifndef __wglext_h_
+#define __wglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number */
+/* wglext.h last updated 2012/01/04 */
+/* Current version at http://www.opengl.org/registry/ */
+#define WGL_WGLEXT_VERSION 24
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
+#define WGL_PBUFFER_LARGEST_ARB 0x2033
+#define WGL_PBUFFER_WIDTH_ARB 0x2034
+#define WGL_PBUFFER_HEIGHT_ARB 0x2035
+#define WGL_PBUFFER_LOST_ARB 0x2036
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
+#define WGL_TEXTURE_FORMAT_ARB 0x2072
+#define WGL_TEXTURE_TARGET_ARB 0x2073
+#define WGL_MIPMAP_TEXTURE_ARB 0x2074
+#define WGL_TEXTURE_RGB_ARB 0x2075
+#define WGL_TEXTURE_RGBA_ARB 0x2076
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
+#define WGL_TEXTURE_1D_ARB 0x2079
+#define WGL_TEXTURE_2D_ARB 0x207A
+#define WGL_MIPMAP_LEVEL_ARB 0x207B
+#define WGL_CUBE_MAP_FACE_ARB 0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB 0x2083
+#define WGL_FRONT_RIGHT_ARB 0x2084
+#define WGL_BACK_LEFT_ARB 0x2085
+#define WGL_BACK_RIGHT_ARB 0x2086
+#define WGL_AUX0_ARB 0x2087
+#define WGL_AUX1_ARB 0x2088
+#define WGL_AUX2_ARB 0x2089
+#define WGL_AUX3_ARB 0x208A
+#define WGL_AUX4_ARB 0x208B
+#define WGL_AUX5_ARB 0x208C
+#define WGL_AUX6_ARB 0x208D
+#define WGL_AUX7_ARB 0x208E
+#define WGL_AUX8_ARB 0x208F
+#define WGL_AUX9_ARB 0x2090
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+#endif
+
+#ifndef WGL_ARB_framebuffer_sRGB
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#define ERROR_INVALID_VERSION_ARB 0x2095
+#endif
+
+#ifndef WGL_ARB_create_context_profile
+#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
+#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define ERROR_INVALID_PROFILE_ARB 0x2096
+#endif
+
+#ifndef WGL_ARB_create_context_robustness
+#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
+#define WGL_DRAW_TO_WINDOW_EXT 0x2001
+#define WGL_DRAW_TO_BITMAP_EXT 0x2002
+#define WGL_ACCELERATION_EXT 0x2003
+#define WGL_NEED_PALETTE_EXT 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
+#define WGL_SWAP_METHOD_EXT 0x2007
+#define WGL_NUMBER_OVERLAYS_EXT 0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
+#define WGL_TRANSPARENT_EXT 0x200A
+#define WGL_TRANSPARENT_VALUE_EXT 0x200B
+#define WGL_SHARE_DEPTH_EXT 0x200C
+#define WGL_SHARE_STENCIL_EXT 0x200D
+#define WGL_SHARE_ACCUM_EXT 0x200E
+#define WGL_SUPPORT_GDI_EXT 0x200F
+#define WGL_SUPPORT_OPENGL_EXT 0x2010
+#define WGL_DOUBLE_BUFFER_EXT 0x2011
+#define WGL_STEREO_EXT 0x2012
+#define WGL_PIXEL_TYPE_EXT 0x2013
+#define WGL_COLOR_BITS_EXT 0x2014
+#define WGL_RED_BITS_EXT 0x2015
+#define WGL_RED_SHIFT_EXT 0x2016
+#define WGL_GREEN_BITS_EXT 0x2017
+#define WGL_GREEN_SHIFT_EXT 0x2018
+#define WGL_BLUE_BITS_EXT 0x2019
+#define WGL_BLUE_SHIFT_EXT 0x201A
+#define WGL_ALPHA_BITS_EXT 0x201B
+#define WGL_ALPHA_SHIFT_EXT 0x201C
+#define WGL_ACCUM_BITS_EXT 0x201D
+#define WGL_ACCUM_RED_BITS_EXT 0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
+#define WGL_DEPTH_BITS_EXT 0x2022
+#define WGL_STENCIL_BITS_EXT 0x2023
+#define WGL_AUX_BUFFERS_EXT 0x2024
+#define WGL_NO_ACCELERATION_EXT 0x2025
+#define WGL_GENERIC_ACCELERATION_EXT 0x2026
+#define WGL_FULL_ACCELERATION_EXT 0x2027
+#define WGL_SWAP_EXCHANGE_EXT 0x2028
+#define WGL_SWAP_COPY_EXT 0x2029
+#define WGL_SWAP_UNDEFINED_EXT 0x202A
+#define WGL_TYPE_RGBA_EXT 0x202B
+#define WGL_TYPE_COLORINDEX_EXT 0x202C
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT 0x2033
+#define WGL_PBUFFER_WIDTH_EXT 0x2034
+#define WGL_PBUFFER_HEIGHT_EXT 0x2035
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_DEPTH_FLOAT_EXT 0x2040
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
+#define WGL_SAMPLES_3DFX 0x2061
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_SAMPLE_BUFFERS_EXT 0x2041
+#define WGL_SAMPLES_EXT 0x2042
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#endif
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV 0x20A7
+#endif
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_FLOAT_COMPONENTS_NV 0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
+#endif
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
+#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
+#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
+#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
+#endif
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
+#endif
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
+#endif
+
+#ifndef WGL_NV_present_video
+#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
+#endif
+
+#ifndef WGL_NV_video_out
+#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
+#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
+#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
+#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
+#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
+#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
+#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define WGL_VIDEO_OUT_FRAME 0x20C8
+#define WGL_VIDEO_OUT_FIELD_1 0x20C9
+#define WGL_VIDEO_OUT_FIELD_2 0x20CA
+#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
+#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
+#endif
+
+#ifndef WGL_NV_swap_group
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
+#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
+#endif
+
+#ifndef WGL_AMD_gpu_association
+#define WGL_GPU_VENDOR_AMD 0x1F00
+#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
+#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
+#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
+#define WGL_GPU_RAM_AMD 0x21A3
+#define WGL_GPU_CLOCK_AMD 0x21A4
+#define WGL_GPU_NUM_PIPES_AMD 0x21A5
+#define WGL_GPU_NUM_SIMD_AMD 0x21A6
+#define WGL_GPU_NUM_RB_AMD 0x21A7
+#define WGL_GPU_NUM_SPI_AMD 0x21A8
+#endif
+
+#ifndef WGL_NV_video_capture
+#define WGL_UNIQUE_ID_NV 0x20CE
+#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
+#endif
+
+#ifndef WGL_NV_copy_image
+#endif
+
+#ifndef WGL_NV_multisample_coverage
+#define WGL_COVERAGE_SAMPLES_NV 0x2042
+#define WGL_COLOR_SAMPLES_NV 0x20B9
+#endif
+
+#ifndef WGL_EXT_create_context_es2_profile
+#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
+#endif
+
+#ifndef WGL_NV_DX_interop
+#define WGL_ACCESS_READ_ONLY_NV 0x00000000
+#define WGL_ACCESS_READ_WRITE_NV 0x00000001
+#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
+#endif
+
+#ifndef WGL_NV_DX_interop2
+#endif
+
+#ifndef WGL_EXT_swap_control_tear
+#endif
+
+
+/*************************************************************/
+
+#ifndef WGL_ARB_pbuffer
+DECLARE_HANDLE(HPBUFFERARB);
+#endif
+#ifndef WGL_EXT_pbuffer
+DECLARE_HANDLE(HPBUFFEREXT);
+#endif
+#ifndef WGL_NV_present_video
+DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
+#endif
+#ifndef WGL_NV_video_output
+DECLARE_HANDLE(HPVIDEODEV);
+#endif
+#ifndef WGL_NV_gpu_affinity
+DECLARE_HANDLE(HPGPUNV);
+DECLARE_HANDLE(HGPUNV);
+
+typedef struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+} GPU_DEVICE, *PGPU_DEVICE;
+#endif
+#ifndef WGL_NV_video_capture
+DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
+#endif
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_ARB_buffer_region 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
+extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
+extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
+extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define WGL_ARB_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+extern HDC WINAPI wglGetCurrentReadDCARB (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_ARB_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
+extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
+extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
+extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_ARB_render_texture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
+extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
+extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_ARB_pixel_format_float 1
+#endif
+
+#ifndef WGL_ARB_framebuffer_sRGB
+#define WGL_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_ARB_create_context 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
+#endif
+
+#ifndef WGL_ARB_create_context_profile
+#define WGL_ARB_create_context_profile 1
+#endif
+
+#ifndef WGL_ARB_create_context_robustness
+#define WGL_ARB_create_context_robustness 1
+#endif
+
+#ifndef WGL_EXT_display_color_table
+#define WGL_EXT_display_color_table 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
+extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
+extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
+extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
+typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+#endif
+
+#ifndef WGL_EXT_extensions_string
+#define WGL_EXT_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define WGL_EXT_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+extern HDC WINAPI wglGetCurrentReadDCEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_EXT_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
+extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
+extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
+extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_EXT_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSwapIntervalEXT (int interval);
+extern int WINAPI wglGetSwapIntervalEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+#endif
+
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void WINAPI wglFreeMemoryNV (void *pointer);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+#endif
+
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
+extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_I3D_digital_video_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
+extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_I3D_gamma 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
+extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
+extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_I3D_genlock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
+extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
+extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
+extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
+extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
+extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
+extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
+extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
+extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
+extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
+extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
+extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
+typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_I3D_image_buffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
+extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
+extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
+typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
+typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#define WGL_I3D_swap_frame_lock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableFrameLockI3D (void);
+extern BOOL WINAPI wglDisableFrameLockI3D (void);
+extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
+extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
+#endif
+
+#ifndef WGL_I3D_swap_frame_usage
+#define WGL_I3D_swap_frame_usage 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
+extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
+extern BOOL WINAPI wglEndFrameTrackingI3D (void);
+extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
+typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_ATI_pixel_format_float 1
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_NV_float_buffer 1
+#endif
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_3DL_stereo_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
+#endif
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_EXT_pixel_format_packed_float 1
+#endif
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef WGL_NV_present_video
+#define WGL_NV_present_video 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
+extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
+extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
+typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_NV_video_output
+#define WGL_NV_video_output 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
+extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
+extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif
+
+#ifndef WGL_NV_swap_group
+#define WGL_NV_swap_group 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
+extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
+extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
+extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
+extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
+typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
+typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_NV_gpu_affinity 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
+extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
+extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
+typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_AMD_gpu_association
+#define WGL_AMD_gpu_association 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
+extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
+extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
+extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
+extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
+extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
+extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
+extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
+extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
+typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
+typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
+typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
+typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
+typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef WGL_NV_video_capture
+#define WGL_NV_video_capture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
+extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
+extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
+extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
+typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
+typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
+#endif
+
+#ifndef WGL_NV_copy_image
+#define WGL_NV_copy_image 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef WGL_NV_multisample_coverage
+#define WGL_NV_multisample_coverage 1
+#endif
+
+#ifndef WGL_NV_DX_interop
+#define WGL_NV_DX_interop 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
+extern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
+extern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
+extern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
+extern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
+extern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
+extern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
+extern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
+typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
+typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
+typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
+typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
+typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
+typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
+typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
+#endif
+
+#ifndef WGL_NV_DX_interop2
+#define WGL_NV_DX_interop2 1
+#endif
+
+#ifndef WGL_EXT_swap_control_tear
+#define WGL_EXT_swap_control_tear 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,external))
+
+ifeq ($(OS)$(COM),WNTGCC)
+$(eval $(call gb_Module_add_moduledir,external,mingw-externals))
+endif
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_moduledir,external,msc-externals))
+endif
+
+$(eval $(call gb_Module_add_moduledirs,external,\
+ accessories \
+ libxmlsec \
+ np_sdk \
+ $(call gb_Helper_optional,ABW,libabw) \
+ $(call gb_Helper_optional,APACHE_COMMONS,apache-commons) \
+ $(call gb_Helper_optional,APR,apr) \
+ $(call gb_Helper_optional,BOOST,boost) \
+ $(call gb_Helper_optional,BSH,beanshell) \
+ $(call gb_Helper_optional,CAIRO,cairo) \
+ $(call gb_Helper_optional,CDR,libcdr) \
+ $(call gb_Helper_optional,CLUCENE,clucene) \
+ $(call gb_Helper_optional,CMIS,libcmis) \
+ $(call gb_Helper_optional,COINMP,coinmp) \
+ $(call gb_Helper_optional,COLLADA2GLTF,collada2gltf) \
+ $(call gb_Helper_optional,CPPUNIT,cppunit) \
+ $(call gb_Helper_optional,CT2N,ct2n) \
+ $(call gb_Helper_optional,CURL,curl) \
+ $(call gb_Helper_optional,EBOOK,libebook) \
+ $(call gb_Helper_optional,EPM,epm) \
+ $(call gb_Helper_optional,ETONYEK,libetonyek) \
+ $(call gb_Helper_optional,EXPAT,expat) \
+ $(call gb_Helper_optional,FIREBIRD,firebird) \
+ $(call gb_Helper_optional,FONTCONFIG,fontconfig) \
+ $(call gb_Helper_optional,FREEHAND,libfreehand) \
+ $(call gb_Helper_optional,FREETYPE,freetype) \
+ $(call gb_Helper_optional,GLEW,glew) \
+ $(call gb_Helper_optional,GLM,glm) \
+ $(call gb_Helper_optional,GRAPHITE,graphite) \
+ $(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
+ $(call gb_Helper_optional,HSQLDB,hsqldb) \
+ $(call gb_Helper_optional,HUNSPELL,hunspell) \
+ $(call gb_Helper_optional,HYPHEN,hyphen) \
+ $(call gb_Helper_optional,ICU,icu) \
+ $(call gb_Helper_optional,JFREEREPORT,jfreereport) \
+ $(call gb_Helper_optional,JPEG,jpeg) \
+ $(call gb_Helper_optional,LANGUAGETOOL,languagetool) \
+ $(call gb_Helper_optional,LCMS2,lcms2) \
+ $(call gb_Helper_optional,LIBATOMIC_OPS,libatomic_ops) \
+ $(call gb_Helper_optional,LIBEOT,libeot) \
+ $(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \
+ $(call gb_Helper_optional,LIBGLTF,libgltf) \
+ $(call gb_Helper_optional,LIBLANGTAG,liblangtag) \
+ $(call gb_Helper_optional,LIBPNG,libpng) \
+ $(call gb_Helper_optional,LIBXML2,libxml2) \
+ $(call gb_Helper_optional,LIBXSLT,libxslt) \
+ $(call gb_Helper_optional,LPSOLVE,lpsolve) \
+ $(call gb_Helper_optional,MARIADB,libmariadb) \
+ $(call gb_Helper_optional,MDDS,mdds) \
+ $(if $(WITH_EXTRA_EXTENSIONS),misc_extensions) \
+ $(call gb_Helper_optional,MORE_FONTS,more_fonts) \
+ $(call gb_Helper_optional,MOZ,moz) \
+ $(call gb_Helper_optional,MSPUB,libmspub) \
+ $(call gb_Helper_optional,MWAW,libmwaw) \
+ $(call gb_Helper_optional,MYSQLCPPCONN,mysqlcppconn) \
+ $(call gb_Helper_optional,MYTHES,mythes) \
+ $(call gb_Helper_optional,NEON,neon) \
+ $(call gb_Helper_optional,NSS,nss) \
+ $(call gb_Helper_optional,ODFGEN,libodfgen) \
+ $(call gb_Helper_optional,COLLADA2GLTF,opencollada) \
+ $(call gb_Helper_optional,OPENLDAP,openldap) \
+ $(call gb_Helper_optional,OPENSSL,openssl) \
+ $(call gb_Helper_optional,ORCUS,liborcus) \
+ $(call gb_Helper_optional,POPPLER,poppler) \
+ $(call gb_Helper_optional,POSTGRESQL,postgresql) \
+ $(call gb_Helper_optional,PYTHON,python3) \
+ $(call gb_Helper_optional,REDLAND,redland) \
+ $(call gb_Helper_optional,REVENGE,librevenge) \
+ $(call gb_Helper_optional,RHINO,rhino) \
+ $(call gb_Helper_optional,SERF,serf) \
+ $(call gb_Helper_optional,UCPP,ucpp) \
+ $(call gb_Helper_optional,VIGRA,vigra) \
+ $(call gb_Helper_optional,VISIO,libvisio) \
+ $(call gb_Helper_optional,WPD,libwpd) \
+ $(call gb_Helper_optional,WPG,libwpg) \
+ $(call gb_Helper_optional,WPS,libwps) \
+ $(call gb_Helper_optional,XSLTML,xsltml) \
+ $(call gb_Helper_optional,ZLIB,zlib) \
+ $(call gb_Helper_optional_for_host,DESKTOP, \
+ $(if $(WITH_GALLERY_BUILD), \
+ $(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
+ $(call gb_Helper_optional,LCMS2,lcms2) \
+ $(call gb_Helper_optional,NSS,nss) \
+ $(call gb_Helper_optional,VIGRA,vigra) \
+ ) \
+ ) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+External projects bundled with LibreOffice.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriessamples,$(call gb_UnpackedTarball_get_dir,samples-pack)/samples/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriessamples,samples-pack))
+
+$(eval $(call gb_AllLangPackage_add_files,accessoriessamples,share/samples,\
+ cs/.nametranslation.table \
+ de/.nametranslation.table \
+ en-US/JacketPotato.odb \
+ en-US/.nametranslation.table \
+ es/.nametranslation.table \
+ fi/.nametranslation.table \
+ fr/.nametranslation.table \
+ hu/.nametranslation.table \
+ hu/naptar.ods \
+ it/.nametranslation.table \
+ ja/.nametranslation.table \
+ ka/.nametranslation.table \
+ nl/.nametranslation.table \
+ pl/dummy_samples.txt \
+ pt-BR/.nametranslation.table \
+ sv/.nametranslation.table \
+ tr/.nametranslation.table \
+ zh-CN/.nametranslation.table \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriessamplesadvertisement,$(call gb_UnpackedTarball_get_dir,samples-pack)/samples/advertisement/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriessamplesadvertisement,samples-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriessamplesadvertisement,share/samples,Advertisement,\
+ cs/dummy_samples.txt \
+ de/dummy_samples.txt \
+ en-US/ooo2prodflyera3en.odt \
+ en-US/ooo2prodflyera4en.odt \
+ en-US/ooo2prodintroen.odp \
+ en-US/ooo2prodspeca4en.odt \
+ es/dummy_samples.txt \
+ fi/dummy_samples.txt \
+ fr/dummy_samples.txt \
+ hu/ooo2prodflyera3hu.odt \
+ hu/ooo2prodspeca4hu.odt \
+ hu/OOo_Ossszehasonlitas.odt \
+ hu/OOo_Reklam4.odt \
+ it/dummy_samples.txt \
+ ja/dummy_samples.txt \
+ ka/dummy_samples.txt \
+ nl/dummy_samples.txt \
+ pl/dummy_samples.txt \
+ pt-BR/dummy_samples.txt \
+ sv/dummy_samples.txt \
+ tr/dummy_samples.txt \
+ zh-CN/dummy_samples.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriessamplesdocumentation,$(call gb_UnpackedTarball_get_dir,samples-pack)/samples/documentation/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriessamplesdocumentation,samples-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriessamplesdocumentation,share/samples,Documentations,\
+ cs/dummy_samples.txt \
+ de/dummy_samples.txt \
+ en-US/Connect_to_Postgres.odt \
+ en-US/ooo2.odt \
+ es/dummy_samples.txt \
+ fi/dummy_samples.txt \
+ fr/dummy_samples.txt \
+ hu/ooo2.odt \
+ it/dummy_samples.txt \
+ ja/dummy_samples.txt \
+ ka/dummy_samples.txt \
+ nl/dummy_samples.txt \
+ pl/dummy_samples.txt \
+ pt-BR/dummy_samples.txt \
+ sv/dummy_samples.txt \
+ tr/dummy_samples.txt \
+ zh-CN/dummy_samples.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriessamplesnonfree,$(call gb_UnpackedTarball_get_dir,samples-pack)/samples-nonfree/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriessamplesnonfree,samples-pack))
+
+$(eval $(call gb_AllLangPackage_add_files,accessoriessamplesnonfree,share/samples,\
+ cs/dummy_samples-nonfree.txt \
+ de/dummy_samples-nonfree.txt \
+ en-US/dummy_samples-nonfree.txt \
+ es/dummy_samples-nonfree.txt \
+ fi/dummy_samples-nonfree.txt \
+ fr/dummy_samples-nonfree.txt \
+ hu/dummy_samples-nonfree.txt \
+ it/dummy_samples-nonfree.txt \
+ ja/dummy_samples-nonfree.txt \
+ ka/dummy_samples-nonfree.txt \
+ nl/dummy_samples-nonfree.txt \
+ pl/dummy_samples-nonfree.txt \
+ pt-BR/dummy_samples-nonfree.txt \
+ sv/dummy_samples-nonfree.txt \
+ tr/dummy_samples-nonfree.txt \
+ zh-CN/dummy_samples-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriessamplesnonfreeadvertisement,$(call gb_UnpackedTarball_get_dir,samples-pack)/samples-nonfree/advertisement/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriessamplesnonfreeadvertisement,samples-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriessamplesnonfreeadvertisement,share/samples,Advertisement,\
+ cs/dummy_samples-nonfree.txt \
+ de/dummy_samples-nonfree.txt \
+ en-US/dummy_samples-nonfree.txt \
+ es/dummy_samples-nonfree.txt \
+ fi/dummy_samples-nonfree.txt \
+ fr/dummy_samples-nonfree.txt \
+ hu/dummy_samples-nonfree.txt \
+ it/dummy_samples-nonfree.txt \
+ ja/dummy_samples-nonfree.txt \
+ ka/dummy_samples-nonfree.txt \
+ nl/dummy_samples-nonfree.txt \
+ pl/dummy_samples-nonfree.txt \
+ pt-BR/dummy_samples-nonfree.txt \
+ sv/dummy_samples-nonfree.txt \
+ tr/dummy_samples-nonfree.txt \
+ zh-CN/dummy_samples-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriessamplesnonfreedocumentation,$(call gb_UnpackedTarball_get_dir,samples-pack)/samples-nonfree/documentation/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriessamplesnonfreedocumentation,samples-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriessamplesnonfreedocumentation,share/samples,Documentations,\
+ cs/dummy_samples-nonfree.txt \
+ de/dummy_samples-nonfree.txt \
+ en-US/dummy_samples-nonfree.txt \
+ es/dummy_samples-nonfree.txt \
+ fi/dummy_samples-nonfree.txt \
+ fr/dummy_samples-nonfree.txt \
+ hu/dummy_samples-nonfree.txt \
+ it/dummy_samples-nonfree.txt \
+ ja/dummy_samples-nonfree.txt \
+ ka/dummy_samples-nonfree.txt \
+ nl/dummy_samples-nonfree.txt \
+ pl/dummy_samples-nonfree.txt \
+ pt-BR/dummy_samples-nonfree.txt \
+ sv/dummy_samples-nonfree.txt \
+ tr/dummy_samples-nonfree.txt \
+ zh-CN/dummy_samples-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplates,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplates,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files,accessoriestemplates,$(LIBO_SHARE_FOLDER)/template,\
+ cs/dummy_templates.txt \
+ de/dummy_templates.txt \
+ en-US/dummy_templates.txt \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/dummy_templates.txt \
+ hu/dummy_templates.txt \
+ it/dummy_templates.txt \
+ ja/dummy_templates.txt \
+ ka/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplateseducate,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/educate/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplateseducate,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplateseducate,$(LIBO_SHARE_FOLDER)/template,educate,\
+ cs/dummy_templates.txt \
+ de/Jahres_Schulnoten.ots \
+ de/Klassen-Schulnoten-Verwaltung_Noten_1-6.ots \
+ de/Kursnoten_15_Punkte.ots \
+ de/Meine_Schulnoten.ots \
+ de/Schulnoten.ots \
+ de/Stundenplan.ots \
+ de/stundenplan_und_vorlesungsplan.ots \
+ en-US/apa_4thEd.ott \
+ en-US/bookmark_1.ott \
+ en-US/bookmark_2.ott \
+ en-US/classroom_schedule.ott \
+ en-US/Crystal.ots \
+ en-US/disciplinary_assignment.ott \
+ en-US/disciplinary_referral.ott \
+ en-US/grades.ots \
+ en-US/lesson_plan_1.ott \
+ en-US/lesson_plan_2.ott \
+ en-US/name_badge_1.ott \
+ en-US/student_schedule.ott \
+ en-US/table_tent_1.ott \
+ en-US/Thesis.ott \
+ fr/AgendaSemaine1.1.ots \
+ fr/carnet_de_notes.ots \
+ fr/documentfinalTP-1.1.ott \
+ fr/note_moyenne.ots \
+ hu/essze.ott \
+ hu/Meresi_jegyzokonyv_-_Iskolai.ott \
+ hu/osztalynevsor.ott \
+ hu/thesis_k.ott \
+ ja/timetable_for_school.ots \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesfinance,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/finance/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesfinance,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesfinance,$(LIBO_SHARE_FOLDER)/template,finance,\
+ cs/podaci_kniha.ots \
+ de/arbeitszeiterfassung.ots \
+ de/az.ots \
+ de/BudgetAufDeutsch.ots \
+ de/business_indebtedness_schedule.ots \
+ de/business_trip_budget.ots \
+ de/discount_zertifikate_rechner.ots \
+ de/energie_verbrauchstabelle.ots \
+ de/fahrtenbuch.ots \
+ de/Finanzuebersicht.ots \
+ de/Haushaltsbuch.ots \
+ de/Haushaltsbuch_vordruck.ots \
+ de/hypothekenberechnung.ots \
+ de/Invoice-Rechnung.ots \
+ de/Kassenbuch_2006.ots \
+ de/Kassenbuch_2007.ots \
+ de/kassenbuch2.ots \
+ de/kassenbuch.ots \
+ de/Kassenbuch_Vordruck.ots \
+ de/Kassenbuch_vorlage_Netto.ots \
+ de/Kassenbuch_vorlage.ots \
+ de/Konto.ots \
+ de/konto.ott \
+ de/Kraftstoff_Kilometer_Kostenrechner_2006.ots \
+ de/Kraftstoff_Kilometer_Kostenrechner_2007.ots \
+ de/Kraftstoff_Kilometer_Kostenrechner_2008.ots \
+ de/Kraftstoff_Kilometer_Kostenrechner_2009.ots \
+ de/Kraftstoff_Kilometer_Kostenrechner_2010.ots \
+ de/Lastschrift.ott \
+ de/marketing_budget_plan.ots \
+ de/Mwstbruttonetto.ots \
+ de/OOoReise.ots \
+ de/project_planning.ots \
+ de/quittung.ott \
+ de/Rechnung.ots \
+ de/Rechnungs_Vorlage.ots \
+ de/start-up_capital_estimate.ots \
+ de/taetigkeitsbericht.ots \
+ de/Ueberweisungsformular.ott \
+ en-US/advloan.ots \
+ en-US/Amortization-Schedule.ots \
+ en-US/armcalculation.ots \
+ en-US/BalanceSheet1.ots \
+ en-US/Bank_Account.ots \
+ en-US/Budget.ots \
+ en-US/business_indebtedness_schedule.ots \
+ en-US/business_plan.ott \
+ en-US/business_trip_budget.ots \
+ en-US/CheckBookRegister.ots \
+ en-US/Compare_Loan_Conditions.ots \
+ en-US/Compare_Two_Years_with_Graphs.ots \
+ en-US/Deposit_Template_-_US_DOLLAR.ots \
+ en-US/DialogSheetEg.ots \
+ en-US/Giro_en.ott \
+ en-US/job_bid.ott \
+ en-US/loan.ots \
+ en-US/marketing_budget_plan.ots \
+ en-US/marketing_plan.ott \
+ en-US/mortgage_buster.ots \
+ en-US/PettyCash.ots \
+ en-US/portfolio_manager.ots \
+ en-US/pos.ots \
+ en-US/project_planning.ots \
+ en-US/rental_returns.ots \
+ en-US/RunningBudget.ots \
+ en-US/SalesTargets.ots \
+ en-US/start-up_capital_estimate.ots \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/dummy_templates.txt \
+ hu/afas_szamla.ott \
+ hu/Banki_atutalas.ots \
+ hu/Csekkminta.ott \
+ hu/eves_beszamolo_eredmenykimutatas_egyszerusitett.ots \
+ hu/Hazi_koltsegvetes.ots \
+ hu/msz16124.ots \
+ hu/msz16177.ots \
+ hu/Napi_kiadas.ots \
+ hu/Olvass.el \
+ it/notaspese.ots \
+ ja/cost_statement.ots \
+ ja/journal_book.ots \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesforms,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/forms/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesforms,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesforms,$(LIBO_SHARE_FOLDER)/template,forms,\
+ cs/seznam_pohledavek.ots \
+ de/Ausbildungsnachweis2.ott \
+ de/Ausbildungsnachweis.ott \
+ de/ausgabebelege.ott \
+ de/Checkliste_Hauswartung.ots \
+ de/dienstreiseantrag.ott \
+ de/einnahmebelege.ott \
+ de/Fahrtenbuch.ots \
+ de/Fax_privat_formlich_dringend.ott \
+ de/Fax_privat_formlich.ott \
+ de/Fax_privat_personlich.ott \
+ de/Gesprachsnotiz.ott \
+ de/kariertes_blatt_a4_5mm.ots \
+ de/kurz_begleitschreiben.ott \
+ de/Kurz-Begleitschreiben.ott \
+ de/kurzbrief.ott \
+ de/lernkarteikarten_4x10_stueck.ott \
+ de/pkw_kaufvertrag.ott \
+ de/protokoll.ott \
+ de/quittungen.ott \
+ de/quittung.ots \
+ de/rechnung.ots \
+ de/reisekostenabrechnung.ott \
+ de/smily_calender.ots \
+ de/ueberweisungstraeger.ott \
+ de/urlaubsplaner_2006.ots \
+ de/zeichenblatt_din_en_iso_5457_einfach_ohne_din_schrift.ott \
+ en-US/cap1107.ott \
+ en-US/Confidentiality_Agreement.ott \
+ en-US/contract.ott \
+ en-US/Joint_venture.ott \
+ en-US/maintenance_agreement.ott \
+ en-US/Note_Template.ott \
+ en-US/partnership.ott \
+ en-US/PleadingGeneric.ott \
+ en-US/Pleading.ott \
+ en-US/System_maint_tmpl.ott \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/dummy_templates.txt \
+ hu/Alairasi_cimpeldany.ott \
+ hu/Auto_berbeadasi_megallapodas.ott \
+ hu/Autokolcsonzes.ott \
+ hu/Beszelgetesi_jegyzet.ott \
+ hu/BT_tarsasagi_szerzodes_1.ott \
+ hu/Ingatlan-adasveteli_eloszerzodes.ott \
+ hu/Ingatlan-adasveteli_szerzodes_haszonelvezet.ott \
+ hu/Ingatlan-adasveteli_szerzodes.ott \
+ hu/Ingatlan-adasveteli_szerzodes_tarsashaz.ott \
+ hu/Ingatlancsere_szerzodes.ott \
+ hu/Kiadoi_szerzodes.ott \
+ hu/Meghatalmazas_penzfelvetel.ott \
+ hu/Reklammu_atruhazasi_szerzodes.ott \
+ hu/Szoftver_felhasznalasi_szerzodes.ott \
+ hu/Szoftverlegalizacio_alkalmazotti_nyilatkozat.ott \
+ hu/Szoftverlegalizacio_etikai_kodex.ott \
+ hu/Vegrendelet.ott \
+ hu/Veszelyes_allat_tartasi_engedely_kerelem.ott \
+ it/lettera_legale.ott \
+ it/SchedaCarburante.ott \
+ ja/resume.ots \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplateslabels,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/labels/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplateslabels,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplateslabels,$(LIBO_SHARE_FOLDER)/template,labels,\
+ cs/dummy_templates.txt \
+ de/dummy_templates.txt \
+ en-US/address12-WL-OL875.ott \
+ en-US/address15-festival-WL-OL875.ott \
+ en-US/address21-animals-WL-OL875.ott \
+ en-US/address22-animals-WL-OL875.ott \
+ en-US/address23-animals-WL-OL875.ott \
+ en-US/Address-label10.ott \
+ en-US/Address_label7.ott \
+ en-US/Alphabetical-1-filling-labels.ott \
+ en-US/Alphabetical-2-Filling-labels.ott \
+ en-US/Alphabetical-3-Filling-labels.ott \
+ en-US/BasicAddress3sameAvery5160.ott \
+ en-US/BasicAddressSameAvery5160.ott \
+ en-US/BasicMailing3sameAvery5162.ott \
+ en-US/BasicMailing4sameAvery5162.ott \
+ en-US/BasicMailingSame2Avery5161.ott \
+ en-US/BasicMailingSameAvery5161.ott \
+ en-US/BasicReturnAddress2SameAvery5167.ott \
+ en-US/BasicreturnaddresssameAvery5167.ott \
+ en-US/BasicShippingsame2Avery5164.ott \
+ en-US/BasicShippingsameAvery5164.ott \
+ en-US/Basictext2sameAvery5160.ott \
+ en-US/blue-shpWL-OL150.ott \
+ en-US/ClasicMailingsameAvery5163.ott \
+ en-US/color-bars-2-filling-labels.ott \
+ en-US/Fragile-Handle-with-Care-red-background.ott \
+ en-US/Fragrance_02_Address_Label.ott \
+ en-US/frame-filling-labels.ott \
+ en-US/Gemini_label_01.ott \
+ en-US/Mailing-Label-01.ott \
+ en-US/Mailing_Label-Buss_with-Logo-011.ott \
+ en-US/MailingLabelFlowerSameAvery5163.ott \
+ en-US/Mailing_Label-General_Theme_01-WL-OL125.ott \
+ en-US/miniaddapple-adrsWL-OL875.ott \
+ en-US/miniaddflower-adrsWL-OL875.ott \
+ en-US/miniaddfruits-adrsWL-OL875.ott \
+ en-US/miniaddressbasket-adrsWL-OL875.ott \
+ en-US/miniaddrose-adrsWL-OL875.ott \
+ en-US/miniaddyellow-adrsWL-OL875.ott \
+ en-US/SeasonsShippingLabel.ott \
+ en-US/ShippinglabelSameAvery5164.ott \
+ en-US/Shipping-std-design3.ott \
+ en-US/Shipping-std-design9.ott \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/dummy_templates.txt \
+ hu/dummy_templates.txt \
+ it/dummy_templates.txt \
+ ja/dummy_templates.txt \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplateslayout,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/layout/lang,$(true)))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplateslayout,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplateslayout,$(LIBO_SHARE_FOLDER)/template,layout,\
+ cs/dummy_templates.txt \
+ de/A4-kariert.otp \
+ de/BlueBoxes.otp \
+ de/BlueSilver.otp \
+ de/bluesquares.otp \
+ de/BlueWavesTempl-1.otp \
+ de/Butterflies.otp \
+ de/coolspace.otp \
+ de/Cubes_1x.otp \
+ de/DABlueChecker.otp \
+ de/DABlueCircle.otp \
+ de/DABlueCloud.otp \
+ de/DABlueStars.otp \
+ de/DABlueWhiteFlower.otp \
+ de/DALetters.otp \
+ de/DAMultiStars2.otp \
+ de/DAOrangeTexture.otp \
+ de/DAPinkCloud.otp \
+ de/DASnowFlacks.otp \
+ de/DASparkle.otp \
+ de/dummy_templates.txt \
+ de/earthlight.otp \
+ de/edu1.otp \
+ de/email.otp \
+ de/Espai.otp \
+ de/Foral-Studio_A01.otp \
+ de/jp-temple.otp \
+ de/karteikarte.otp \
+ de/lamp.otp \
+ de/landscape.otp \
+ de/lay_wood.otp \
+ de/lyt-acryl.otp \
+ de/lyt-aquarell2.otp \
+ de/lyt-aquarell.otp \
+ de/lyt-bluecrystals.otp \
+ de/lyt-bluegradback.otp \
+ de/lyt-bluelightning.otp \
+ de/lyt-bluelines.otp \
+ de/lyt-blueripplewave.otp \
+ de/lyt-bluesmoke.otp \
+ de/lyt-brightcirc.otp \
+ de/lyt-brightlines.otp \
+ de/lyt-brightpainting.otp \
+ de/lyt-colorfulchars.otp \
+ de/lyt-colornumbers.otp \
+ de/lyt-colorpainting.otp \
+ de/lyt-darkcirc.otp \
+ de/lyt-darkpainting.otp \
+ de/lyt-fractalspiral.otp \
+ de/lyt-frozen.otp \
+ de/lyt-glow.otp \
+ de/lyt-golddown.otp \
+ de/lyt-golddrop.otp \
+ de/lyt-gradshad.otp \
+ de/lyt-greenlines.otp \
+ de/lyt-greenmosaic.otp \
+ de/lyt-greenwaterpainting.otp \
+ de/lyt-mezzo.otp \
+ de/lyt-numbeffect.otp \
+ de/lyt-orange.otp \
+ de/lyt-organic_black.otp \
+ de/lyt-paintingred.otp \
+ de/lyt-paintwaves.otp \
+ de/lyt-papertop.otp \
+ de/lyt-pastell_pyr.otp \
+ de/lyt-plastic.otp \
+ de/lyt-raster.otp \
+ de/lyt-rectbright.otp \
+ de/lyt-rednoise.otp \
+ de/lyt-redstorm.otp \
+ de/lyt-redsunrise.otp \
+ de/lyt-reyellin.otp \
+ de/lyt-simblue.otp \
+ de/lyt-simpleblue.otp \
+ de/lyt-sunrise_lines.otp \
+ de/lyt-techborder.otp \
+ de/lyt-technical.otp \
+ de/lyt-typography.otp \
+ de/lyt-violetlightning.otp \
+ de/lyt-watercolor.otp \
+ de/lyt-waterstorm.otp \
+ de/lyt-whitemountains.otp \
+ de/lyt-yereblend.otp \
+ de/MarbleTempl-2.otp \
+ de/mondo_cyan.otp \
+ de/mondo_green.otp \
+ de/mondo_yellow.otp \
+ de/ooo_20_basis.otp \
+ de/ooo_blue.otp \
+ de/ooo_red.otp \
+ de/openblue.otp \
+ de/Ortra.otp \
+ de/Plantilla_Fresas.otp \
+ de/redStar.otp \
+ de/relief.otp \
+ de/sidepanel_blue.otp \
+ de/sidepanel_cloud.otp \
+ de/sidepanel_green.otp \
+ de/sidepanel_red.otp \
+ de/Simple.otp \
+ de/soleil.otp \
+ de/steps.otp \
+ de/techno_sphere_template.otp \
+ de/UserGroup_agenda.otp \
+ de/vortrag_blau.otp \
+ en-US/A4-kariert.otp \
+ en-US/apothecaryBottles.otp \
+ en-US/Beach.otp \
+ en-US/Black-cyan-yellow.otp \
+ en-US/Black-orange.otp \
+ en-US/BlueBend.otp \
+ en-US/BlueBoxes.otp \
+ en-US/Blue_Dots.otp \
+ en-US/BlueSilver.otp \
+ en-US/BlueSkyLine.otp \
+ en-US/bluesquares.otp \
+ en-US/BlueWavesTempl-1.otp \
+ en-US/Blue-yellow-white.otp \
+ en-US/brasil.otp \
+ en-US/BTC.otp \
+ en-US/Butterflies.otp \
+ en-US/Candy.otp \
+ en-US/Chalkboard_2.otp \
+ en-US/Chalkboard.otp \
+ en-US/Cheesy.otp \
+ en-US/circular.otp \
+ en-US/coolspace.otp \
+ en-US/Cubes_1x.otp \
+ en-US/Cultural.otp \
+ en-US/DABlueChecker.otp \
+ en-US/DABlueCircle.otp \
+ en-US/DABlueCloud.otp \
+ en-US/DABlueStars.otp \
+ en-US/DABlueWhiteFlower.otp \
+ en-US/DALetters.otp \
+ en-US/DAMultiStars2.otp \
+ en-US/DAOrangeTexture.otp \
+ en-US/DAPinkCloud.otp \
+ en-US/DASnowFlacks.otp \
+ en-US/DASparkle.otp \
+ en-US/Desert.otp \
+ en-US/dummy_templates.txt \
+ en-US/earthlight.otp \
+ en-US/edu1.otp \
+ en-US/email.otp \
+ en-US/Espai.otp \
+ en-US/Foot-prints.otp \
+ en-US/Foral-Studio_A01.otp \
+ en-US/Globe_-_Presentation_1.otp \
+ en-US/Globe_-_Presentation_2.otp \
+ en-US/Grad-blue_2.otp \
+ en-US/Grad-blue_3.otp \
+ en-US/Grad-blue.otp \
+ en-US/Grad-cyan-black.otp \
+ en-US/Grad-gray-blue.otp \
+ en-US/Grad-lightblue_2.otp \
+ en-US/Grad-lightblue.otp \
+ en-US/Grad-mediumblue.otp \
+ en-US/Grad-purple.otp \
+ en-US/grapefruit.otp \
+ en-US/Gray-green.otp \
+ en-US/Green_Dots.otp \
+ en-US/Green_leaf.otp \
+ en-US/GreenMosaics.otp \
+ en-US/GreenNGray.otp \
+ en-US/informatica2.otp \
+ en-US/informatica.otp \
+ en-US/jp-temple.otp \
+ en-US/karteikarte.otp \
+ en-US/Keynote_template.otp \
+ en-US/lamp.otp \
+ en-US/landscape.otp \
+ en-US/lay_wood.otp \
+ en-US/listras.otp \
+ en-US/lyt-acryl.otp \
+ en-US/lyt-aquarell2.otp \
+ en-US/lyt-aquarell.otp \
+ en-US/lyt-bluecrystals.otp \
+ en-US/lyt-bluegradback.otp \
+ en-US/lyt-bluelightning.otp \
+ en-US/lyt-bluelines.otp \
+ en-US/lyt-blueripplewave.otp \
+ en-US/lyt-bluesmoke.otp \
+ en-US/lyt-brightcirc.otp \
+ en-US/lyt-brightlines.otp \
+ en-US/lyt-brightpainting.otp \
+ en-US/lyt-colorfulchars.otp \
+ en-US/lyt-colornumbers.otp \
+ en-US/lyt-colorpainting.otp \
+ en-US/lyt-darkcirc.otp \
+ en-US/lyt-darkpainting.otp \
+ en-US/lyt-fractalspiral.otp \
+ en-US/lyt-frozen.otp \
+ en-US/lyt-glow.otp \
+ en-US/lyt-golddown.otp \
+ en-US/lyt-golddrop.otp \
+ en-US/lyt-gradshad.otp \
+ en-US/lyt-greenlines.otp \
+ en-US/lyt-greenmosaic.otp \
+ en-US/lyt-greenwaterpainting.otp \
+ en-US/lyt-mezzo.otp \
+ en-US/lyt-numbeffect.otp \
+ en-US/lyt-orange.otp \
+ en-US/lyt-organic_black.otp \
+ en-US/lyt-paintingred.otp \
+ en-US/lyt-paintwaves.otp \
+ en-US/lyt-papertop.otp \
+ en-US/lyt-pastell_pyr.otp \
+ en-US/lyt-plastic.otp \
+ en-US/lyt-raster.otp \
+ en-US/lyt-rectbright.otp \
+ en-US/lyt-rednoise.otp \
+ en-US/lyt-redstorm.otp \
+ en-US/lyt-redsunrise.otp \
+ en-US/lyt-reyellin.otp \
+ en-US/lyt-simblue.otp \
+ en-US/lyt-simpleblue.otp \
+ en-US/lyt-sunrise_lines.otp \
+ en-US/lyt-techborder.otp \
+ en-US/lyt-technical.otp \
+ en-US/lyt-typography.otp \
+ en-US/lyt-violetlightning.otp \
+ en-US/lyt-watercolor.otp \
+ en-US/lyt-waterstorm.otp \
+ en-US/lyt-whitemountains.otp \
+ en-US/lyt-yereblend.otp \
+ en-US/Marble2.otp \
+ en-US/mondo_cyan.otp \
+ en-US/mondo_green.otp \
+ en-US/mondo_yellow.otp \
+ en-US/Music.otp \
+ en-US/ooo_20_basis.otp \
+ en-US/OOo_Professional.otp \
+ en-US/openblue.otp \
+ en-US/orangebook.otp \
+ en-US/Ortra.otp \
+ en-US/Pixels.otp \
+ en-US/Plantilla_Fresas.otp \
+ en-US/quadrados_coloridos2.otp \
+ en-US/quadrados_coloridos.otp \
+ en-US/Red_Dots.otp \
+ en-US/redStar.otp \
+ en-US/relief.otp \
+ en-US/Roses.otp \
+ en-US/sidepanel_blue.otp \
+ en-US/sidepanel_cloud.otp \
+ en-US/sidepanel_green.otp \
+ en-US/sidepanel_red.otp \
+ en-US/simbologia.otp \
+ en-US/Simple.otp \
+ en-US/slides_blue-penrose_nojhan.otp \
+ en-US/soleil.otp \
+ en-US/squares.otp \
+ en-US/SteelDesign.otp \
+ en-US/steps.otp \
+ en-US/technology.otp \
+ en-US/techno_sphere_template.otp \
+ en-US/Toulumne.otp \
+ en-US/UserGroup_agenda.otp \
+ en-US/White-blue.otp \
+ en-US/White-blue_sky.otp \
+ en-US/White-red_2.otp \
+ en-US/White-red_3.otp \
+ en-US/White-red.otp \
+ en-US/Wire_Gulls_-_Blue.otp \
+ en-US/Wire_Gulls_-_White.otp \
+ en-US/With-year-2003.otp \
+ en-US/With-year-2004.otp \
+ en-US/With-year-2005.otp \
+ en-US/With-years.otp \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/dummy_templates.txt \
+ hu/compladients_1.otp \
+ hu/compladients_2.otp \
+ hu/compladients_3.otp \
+ hu/compladients_4.otp \
+ hu/compladients_5.otp \
+ hu/Cross-color.otp \
+ hu/Cross-gray.otp \
+ hu/Cross-green.otp \
+ hu/Cross-orange.otp \
+ hu/Cross-white.otp \
+ hu/Cross-yellow.otp \
+ hu/Line-blue.otp \
+ hu/Line-green.otp \
+ hu/Line-orange.otp \
+ hu/Line-red.otp \
+ hu/Line-white.otp \
+ hu/Line-yellow.otp \
+ hu/Ooo_blue.otp \
+ hu/Ooo_red.otp \
+ hu/Ortra.otp \
+ hu/Schatten-blau.otp \
+ hu/Schatten-gelb.otp \
+ hu/Schatten-gruen.otp \
+ hu/Schatten-magenta.otp \
+ hu/Schatten-orange.otp \
+ hu/Schatten-rot.otp \
+ hu/Schatten-tuerkis.otp \
+ hu/Simple.otp \
+ hu/Vortrag-blau.otp \
+ hu/Vortrag-gelb.otp \
+ hu/Vortrag-gruen.otp \
+ hu/Vortrag-rot.otp \
+ hu/Vortrag-schwarz.otp \
+ hu/Vortrag-weiss.otp \
+ it/dummy_templates.txt \
+ ja/dummy_templates.txt \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesmisc,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/misc/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesmisc,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesmisc,$(LIBO_SHARE_FOLDER)/template,misc,\
+ cs/dummy_templates.txt \
+ de/01_event_poster.otg \
+ de/02_event_poster.otg \
+ de/03_event_poster.otg \
+ de/04_event_poster.otg \
+ de/12_Blatt_fuer_Notizen.ots \
+ de/2_cd_inlays_fuer_rueckseite.otg \
+ de/2_cd_inlays_fuer_vorderseite_je_2_seitig.otg \
+ de/3DElements.ott \
+ de/3_Monatsuebersicht_Kalender_fuer_Notizen.ots \
+ de/3_Monatsuebersicht_Kalender_mit_Geburtstag.ots \
+ de/Abreissblatt_A4_hoch.ott \
+ de/Abreissblatt_A4_quer.ott \
+ de/adressetiketten_3x8st_a_4x7cm_1_adresse_24x.ott \
+ de/adressetiketten_3x8st_a_4x7cm_abfrage_24_adressen.ott \
+ de/adressetiketten_3x8st_a_4x7cm_auswahl_1_etikett.ott \
+ de/Aktenordnerbeschriftung_fur_breite_Sichtfenster.otg \
+ de/Aktenordnerbeschriftung_fur_schmale_Sichtfenster.otg \
+ de/Aktenordnerbeschriftung_zum_Kleben_fur_breite_Ordner.otg \
+ de/Anwesenheitsliste_2006.ots \
+ de/Anwesenheitsliste_2007.ots \
+ de/Anwesenheitsliste_2008.ots \
+ de/Anwesenheitsliste_2009.ots \
+ de/Anwesenheitsliste_2010.ots \
+ de/Auftragsbestaetigung_vorlage.ots \
+ de/Automatischer_Tageskalender.ots \
+ de/berichtsvorlage_5gestalten.ott \
+ de/Briefumschlag_C4_Kuvert_Querformat.ott \
+ de/cd_booklet_4_seitig.otg \
+ de/CD-Booklet_4-seitig.otg \
+ de/cd_booklet_inlet_audio_1_crossline.ott \
+ de/cd_cover.otg \
+ de/cd_huelle_fuer_duenne_huellen.otg \
+ de/cd_inlay.ott \
+ de/CD-Inlays_Ruckseite.otg \
+ de/CD-Inlays_Vorderseite.otg \
+ de/cd_label.otg \
+ de/cd_labels.otg \
+ de/CD-Labels.otg \
+ de/cd_papierhuelle.otg \
+ de/Dienstreiseausgleich_nach26_Ziff7.ots \
+ de/DIN_A4_hoch.otg \
+ de/DIN_A4_quer.otg \
+ de/DPTC_divi_2x6.ott \
+ de/DPTC_pyramids.otg \
+ de/dvd_huelle.otg \
+ de/entwurf.ott \
+ de/Familien-Termin-Kalender-2007.ots \
+ de/FerienKalender.ots \
+ de/FOTOKALENDER_mit_Geburtstagen.ots \
+ de/gantt.ots \
+ de/glueckwunschkarte.otg \
+ de/Gutschein.ott \
+ de/inlay_set_fuer_cd_boxen.otg \
+ de/Jahreskalender_2005.ots \
+ de/Jahreskalender_2006.ots \
+ de/Jahreskalender_2007.ots \
+ de/Jahreskalender_2008.ots \
+ de/Jahreskalender_2009.ots \
+ de/Jahreskalender_2010.ots \
+ de/jahreskalender_2.ots \
+ de/Jahreskalender_horizontal.ots \
+ de/jahreskalender_ooo.ots \
+ de/jahreskalender.ots \
+ de/Jahreskalender_vertikal.ots \
+ de/Kalender_2005_Hochformat.ots \
+ de/Kalender_2005_Querformat.ots \
+ de/Kalender_2006_Hochformat.ots \
+ de/Kalender_2006_Querformat.ots \
+ de/Kalender_2007_Hochformat.ots \
+ de/Kalender_2007_Querformat.ots \
+ de/Kleine_Zeitung_back.ott \
+ de/Kleine_Zeitung_front.ott \
+ de/matheblatt_hz.ots \
+ de/Monatlicher_Kalender.ots \
+ de/Monatskalender_2.ots \
+ de/monatskalender.ots \
+ de/pflegetagebuch.ots \
+ de/Projektkalender_2006.ots \
+ de/Projektkalender_2007.ots \
+ de/Projektkalender_2008.ots \
+ de/Projektkalender_2009.ots \
+ de/Projektkalender_2010.ots \
+ de/Quittungen.ott \
+ de/Schichtkalender.ots \
+ de/schulausgangsschrift_druckvorlage.ott \
+ de/sprachwissenschaftliche_hausarbeit.ott \
+ de/Tagebuch_Vorlage.ott \
+ de/Tageskalender.ots \
+ de/Taschengeld.ots \
+ de/Taschenkalender_2007_2008.ots \
+ de/Terminkalender_2007_2008.ots \
+ de/Terminkalender_2009_2010.ots \
+ de/trennblaetter.ots \
+ de/urkunden_vorlage.ott \
+ de/vorlage_studienarbeit_mehrseitiger_verzeichnisteil.ott \
+ de/vorlage_studienarbeit.ott \
+ de/wissenschaftliche_hausarbeit.ott \
+ en-US/01_event_poster.otg \
+ en-US/0-20_Number_Labels_7651.ott \
+ en-US/02_event_poster.otg \
+ en-US/03_event_poster.otg \
+ en-US/04_event_poster.otg \
+ en-US/3DElements.ott \
+ en-US/AveryA4CDTemplate.otg \
+ en-US/A-Z_Lettering_Labels_7163.ott \
+ en-US/A-Z_Lettering_Labels_7651.ott \
+ en-US/BlueHome.ott \
+ en-US/Booklet.ott \
+ en-US/book_template.ott \
+ en-US/brochure_2page.ott \
+ en-US/bulletin_1.ott \
+ en-US/Calendar_pg.ots \
+ en-US/Calendar_Quarterly.ots \
+ en-US/calender.ots \
+ en-US/CD-BACK.ott \
+ en-US/CD-booklet.ott \
+ en-US/CD_Cover.otg \
+ en-US/CD_DVD.ott \
+ en-US/CD-JewelCase.ott \
+ en-US/CD-Pressit.otg \
+ en-US/CD_Template.otg \
+ en-US/certificate_of_appreciation.ott \
+ en-US/Clear_advantage-Blue.ott \
+ en-US/Company-CD-Label2.ott \
+ en-US/Company-CD-Label4.ott \
+ en-US/Company-CD-Label.ott \
+ en-US/Confidential_Labels_7651.ott \
+ en-US/ConflictOfInterestNotice.ott \
+ en-US/Congratulations_Banner.ott \
+ en-US/consolidation_eng.ots \
+ en-US/Convention_Schedule.ots \
+ en-US/Cross_Labels_7651.ott \
+ en-US/documentation.ott \
+ en-US/excellence_award_2.ott \
+ en-US/Expense_Report_Template.ots \
+ en-US/Extra_Savings.ott \
+ en-US/First_Class_Labels_7651.ott \
+ en-US/flowchart.otg \
+ en-US/Forever_CD_Label.odt \
+ en-US/Forever_CD_Label.ott \
+ en-US/funkeCDCover.otg \
+ en-US/gantt_011d_en.ots \
+ en-US/Gantt.ots \
+ en-US/Get_Me_Another_Tie_CD_Label.ott \
+ en-US/Keep_Dry_Labels_7169.ott \
+ en-US/Landscape_Booklet.ott \
+ en-US/MapCharts.ots \
+ en-US/MonthlyCalendar.ots \
+ en-US/New_Labels_7651.ott \
+ en-US/newsletter_1.ott \
+ en-US/newsletter_2.ott \
+ en-US/NewsLetterTemplate.ott \
+ en-US/Office-Label.ott \
+ en-US/OOoCalendar.ots \
+ en-US/OrigamiCD.otg \
+ en-US/origamiletter.ott \
+ en-US/Origami_Paper_CD_Cover.otg \
+ en-US/OurGlobe.ott \
+ en-US/Petit.ott \
+ en-US/photo-label.ott \
+ en-US/pricecard.ots \
+ en-US/Private_Labels_7651.ott \
+ en-US/Quote.ott \
+ en-US/Recycle_Me_Labels_7651.ott \
+ en-US/RepeatedMeasuresANOVA.ots \
+ en-US/sale.otg \
+ en-US/Seed_Packets.ott \
+ en-US/Sold_Labels_7651.ott \
+ en-US/sonnets-lullabyes.ott \
+ en-US/Speed_advantage-Blue.ott \
+ en-US/Statistical_calculator.ots \
+ en-US/Stripes-in-Pink-CD-Label.ott \
+ en-US/Tick_Labels_7651.ott \
+ en-US/Title_Page_Template.ott \
+ en-US/Trifold_v07.ott \
+ en-US/Tutorial.ott \
+ en-US/tyro_rota_05b.ots \
+ en-US/validation_en.ots \
+ en-US/VHS.otg \
+ en-US/WeeklyCalendar.ots \
+ en-US/WL-OL5000.ott \
+ en-US/WL-OL5025.ott \
+ en-US/WL-OL5050.otg \
+ en-US/WL-OL5075.otg \
+ en-US/writertemplate.ott \
+ es/75437-CornellNotetaking.ott \
+ fi/dummy_templates.txt \
+ fr/calendannuel_horizontal_fr.ots \
+ fr/calendannuel_Vertical_fr.ots \
+ fr/calendrier2005.ots \
+ fr/calendrier_mensuel_fr.ots \
+ fr/calendrier_perpetuel.ots \
+ fr/excellence2fr.ott \
+ fr/HalPiratcd.otg \
+ fr/Modele_HowTo.ott \
+ hu/3DElements.ott \
+ hu/A4-esborito2.otg \
+ hu/A4-esborito.otg \
+ hu/A5-osborito.otg \
+ hu/artdecofejlec.ott \
+ hu/beszallitok_minositese.ots \
+ hu/BlueHome.ott \
+ hu/Brinell-kemenysegmeres.ots \
+ hu/Bulletin_1.ott \
+ hu/CD_sablon_Alap_ures.otg \
+ hu/CD_sablon_Normal.otg \
+ hu/CD_sablon_Vekony.otg \
+ hu/Clear_advantage-Blue.ott \
+ hu/DVD_sablon.otg \
+ hu/EN12209.ots \
+ hu/HV_kemenyseg_vizsgalat.ots \
+ hu/Idomszer_tervezo.ots \
+ hu/ISO_2859-1.ots \
+ hu/klasszikusbizonyitvany.ott \
+ hu/Meresi_lap-turessel.ots \
+ hu/naptar-hetfovel.ots \
+ hu/Naptar_sablon-kombinalt.ots \
+ hu/OurGlobe.ott \
+ hu/programtar_nagy.ott \
+ hu/programtar.ott \
+ hu/Rugo_meretezes.ots \
+ hu/Speed_advantage-Blue.ott \
+ hu/Tick_Labels_7651.ott \
+ hu/trifold.ott \
+ it/calendar.ots \
+ it/VHS.otg \
+ ja/back_cover_for_12cmCD10mm_case.ott \
+ ja/booklet_for_CD_case.ott \
+ ja/Callender.ott \
+ ja/Index_card_for_DVD_tall_case.ott \
+ ka/dummy_templates.txt \
+ nl/3DElements.ott \
+ nl/Clear_advantage-Blue.ott \
+ nl/Speed_advantage-Blue.ott \
+ pl/absolwent_na_6.ott \
+ pl/przedszkolak1.ott \
+ pl/teczka_opis.otg \
+ pl/wyroznienie.ott \
+ pt-BR/3DElements.ott \
+ pt-BR/Clear_advantage-Blue.ott \
+ pt-BR/Speed_advantage-Blue.ott \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfree,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfree,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files,accessoriestemplatesnonfree,$(LIBO_SHARE_FOLDER)/template,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/dummy_templates-nonfree.txt \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreeeducate,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/educate/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreeeducate,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreeeducate,$(LIBO_SHARE_FOLDER)/template,educate,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/attendance_sheet.ott \
+ en-US/class_list.ott \
+ en-US/classroom_seating_chart.ott \
+ en-US/College_Budget_-_Semester.ots \
+ en-US/College_Monthly_Budget.ots \
+ en-US/diploma_landscape.ott \
+ en-US/diploma_portrait.ott \
+ en-US/elementary_record_cards.ott \
+ en-US/GPA_Calculator.ots \
+ en-US/Grading_Sheet.ots \
+ en-US/homework_tracker.ott \
+ en-US/honor_student_award.ott \
+ en-US/medical_history.ott \
+ en-US/permission_slip.ott \
+ en-US/School_Budget.ots \
+ en-US/student_of_the_month.ott \
+ en-US/Student_Reading_Record.ots \
+ en-US/substitute_Information.ott \
+ en-US/syllabus_1.ott \
+ en-US/term_paper.ott \
+ en-US/Weekly_Class_Schedule.ots \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreefinance,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/finance/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreefinance,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreefinance,$(LIBO_SHARE_FOLDER)/template,finance,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/24_Month_Sales_Forecast.ots \
+ en-US/Balance_Sheet.ots \
+ en-US/Break-Even_Analysis.ots \
+ en-US/business_plan_calc.ots \
+ en-US/Capital_Budget_Analysis.ots \
+ en-US/Corporate_Earnings_Analysis.ots \
+ en-US/Five_Year_Projections.ots \
+ en-US/Income_Statement.ots \
+ en-US/job_bid_calc.ots \
+ en-US/marketing_plan_calc.ots \
+ en-US/Pro-Forma_Balance_Sheet.ots \
+ en-US/Pro-Forma_Income_Statement.ots \
+ en-US/Quarterly_Marketing_Budget.ots \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreeforms,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/forms/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreeforms,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreeforms,$(LIBO_SHARE_FOLDER)/template,forms,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/dummy_templates-nonfree.txt \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreelabels,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/labels/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreelabels,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreelabels,$(LIBO_SHARE_FOLDER)/template,labels,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/dummy_templates-nonfree.txt \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreelayout,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/layout/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreelayout,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreelayout,$(LIBO_SHARE_FOLDER)/template,layout,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/dummy_templates-nonfree.txt \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreemisc,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/misc/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreemisc,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreemisc,$(LIBO_SHARE_FOLDER)/template,misc,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/achievement_1.ott \
+ en-US/athletic_achievement.ott \
+ en-US/attendance_award.ott \
+ en-US/award_of_merit.ott \
+ en-US/best_suggestion.ott \
+ en-US/bulletin_2.ott \
+ en-US/bulletin_3.ott \
+ en-US/event_calendar_1.ott \
+ en-US/event_poster_1.ott \
+ en-US/event_poster_2.ott \
+ en-US/event_poster.ott \
+ en-US/excellence.ott \
+ en-US/first_place.ott \
+ en-US/great_idea_award.ott \
+ en-US/Landscape_Monthly_Calendar.ots \
+ en-US/school_newsletter_1.ott \
+ en-US/school_newsletter_2.ott \
+ en-US/table_tent_landscape.ott \
+ en-US/trifold_brochure.ott \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/Bulletin_2.ott \
+ hu/Bulletin_3.ott \
+ hu/Event_poster.ott \
+ hu/Kituntetes.ott \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreeofficorr,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/officorr/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreeofficorr,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreeofficorr,$(LIBO_SHARE_FOLDER)/template,officorr,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/dummy_templates-nonfree.txt \
+ en-US/id_2_statement.ott \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreeoffimisc,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/offimisc/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreeoffimisc,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreeoffimisc,$(LIBO_SHARE_FOLDER)/template,offimisc,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/report_1.ott \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreepersonal,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/personal/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreepersonal,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreepersonal,$(LIBO_SHARE_FOLDER)/template,personal,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/resume_1.ott \
+ en-US/resume_2.ott \
+ en-US/resume_3.ott \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesnonfreepresent,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates-nonfree/presnt/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesnonfreepresent,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesnonfreepresent,$(LIBO_SHARE_FOLDER)/template,presnt,\
+ cs/dummy_templates-nonfree.txt \
+ de/dummy_templates-nonfree.txt \
+ en-US/dummy_templates-nonfree.txt \
+ es/dummy_templates-nonfree.txt \
+ fi/dummy_templates-nonfree.txt \
+ fr/dummy_templates-nonfree.txt \
+ hu/dummy_templates-nonfree.txt \
+ it/dummy_templates-nonfree.txt \
+ ja/dummy_templates-nonfree.txt \
+ ka/dummy_templates-nonfree.txt \
+ nl/dummy_templates-nonfree.txt \
+ pl/dummy_templates-nonfree.txt \
+ pt-BR/dummy_templates-nonfree.txt \
+ sv/dummy_templates-nonfree.txt \
+ tr/dummy_templates-nonfree.txt \
+ zh-CN/dummy_templates-nonfree.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesofficorr,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/officorr/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesofficorr,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesofficorr,$(LIBO_SHARE_FOLDER)/template,officorr,\
+ cs/dummy_templates.txt \
+ de/01_business_fax.ott \
+ de/01_business_letter.ott \
+ de/02_business_fax.ott \
+ de/02_business_letter.ott \
+ de/03_business_fax.ott \
+ de/03_business_letter.ott \
+ de/04_business_fax.ott \
+ de/04_business_letter.ott \
+ de/05_business_fax.ott \
+ de/05_business_letter.ott \
+ de/06_business_fax.ott \
+ de/06_business_letter.ott \
+ de/74011-mygbrief.odt \
+ de/basis_briefvorlage.ott \
+ de/begleitanschreiben.ott \
+ de/bewerbung_vorlage.ott \
+ de/Brief.ott \
+ de/briefumschlag_c4_kuvert_querformat.ott \
+ de/briefvorlage.ott \
+ de/din_brief_geschaeftlich.ott \
+ de/dinbrief.ott \
+ de/eleganter_tabellarischer_lebenslauf.ott \
+ de/emailformular.ott \
+ de/entschuldigung.ott \
+ de/foermliches_privatfax_dringend.ott \
+ de/foermliches_privatfax.ott \
+ de/geschaeftsbrief_ch.ott \
+ de/klassischer_brief.ott \
+ de/klassischer_tabellarischer_lebenslauf.ott \
+ de/klassisch_moderner_brief.ott \
+ de/lebenslauf2.ott \
+ de/lebenslauf3.ott \
+ de/lebenslauf.ott \
+ de/maengelanzeige_und_mietminderung.ott \
+ de/memo1.ott \
+ de/moderner_brief.ott \
+ de/moderner_tabellarischer_lebenslauf.ott \
+ de/notiz.ott \
+ de/postkarte.ott \
+ de/privatbrief_ch.ott \
+ de/privatbrief_mit_feldern.ott \
+ de/privatfax.ott \
+ de/Standard_Geschaeftlich_Neutral.ott \
+ de/stellenbewerbung.ott \
+ de/zahlungsaufforderung.ott \
+ en-US/01_business_fax.ott \
+ en-US/01_business_letter.ott \
+ en-US/02_business_fax.ott \
+ en-US/02_business_letter.ott \
+ en-US/03_business_fax.ott \
+ en-US/03_business_letter.ott \
+ en-US/04_business_fax.ott \
+ en-US/04_business_letter.ott \
+ en-US/05_business_fax.ott \
+ en-US/05_business_letter.ott \
+ en-US/06_business_fax.ott \
+ en-US/06_business_letter.ott \
+ en-US/bar_bc.ott \
+ en-US/bar_env.ott \
+ en-US/bar_label.ott \
+ en-US/bar_lh.ott \
+ en-US/bar_memo.ott \
+ en-US/buscard_1.ott \
+ en-US/buscard_2.ott \
+ en-US/Business_Card.otg \
+ en-US/businesscards.ott \
+ en-US/business_cards_sandy.ott \
+ en-US/CGInvoice.ott \
+ en-US/env_1.ott \
+ en-US/env_2.ott \
+ en-US/Envelope_fancy.ott \
+ en-US/FaxCoverLetter2.ott \
+ en-US/Fax_Cover.ott \
+ en-US/fax_cover_sandy.ott \
+ en-US/faxCoverSheet.ott \
+ en-US/Globe_-_Business_Card_1.ott \
+ en-US/Globe_-_Business_Card_2.ott \
+ en-US/id_1_10_envelope.ott \
+ en-US/id_1_business_card.ott \
+ en-US/id_1_fax_cover.ott \
+ en-US/id_1_Invoice_form.ott \
+ en-US/id_1_letterhead.ott \
+ en-US/id_1_press_release.ott \
+ en-US/id_1_purchase_order.ott \
+ en-US/id_1_statement.ott \
+ en-US/id_2_10_envelope.ott \
+ en-US/id_2_business_card.ott \
+ en-US/id_2_fax_cover.ott \
+ en-US/id_2_Invoice_form.ott \
+ en-US/id_2_letterhead.ott \
+ en-US/id_2_press_release.ott \
+ en-US/id_2_purchase_order.ott \
+ en-US/invoice.billing.ots \
+ en-US/invoice.ots \
+ en-US/InvoiceTemplate.ots \
+ en-US/Job_Invoice.ott \
+ en-US/label_1.ott \
+ en-US/label_2.ott \
+ en-US/Labels_fancy.ott \
+ en-US/LAFBusinessLetter.ott \
+ en-US/letterhead_sandy.ott \
+ en-US/lh_1.ott \
+ en-US/lh_2.ott \
+ en-US/memo_1.ott \
+ en-US/memo1.ott \
+ en-US/memo_2.ott \
+ en-US/organica_business_cards.ott \
+ en-US/organica_fax_form.ott \
+ en-US/organica_file_folder_label.ott \
+ en-US/organica_invoice_form.ott \
+ en-US/organica_letter.ott \
+ en-US/organica_mailing_labels.ott \
+ en-US/organica_return_address_labels.ott \
+ en-US/organica_shipping_labels.ott \
+ en-US/PastDueNotice1.ott \
+ en-US/PastDueNotice2.ott \
+ en-US/Personal_Business_Cards_A4.ott \
+ en-US/salesinvoice.ots \
+ en-US/ServiceTermination.ott \
+ en-US/simplefax.ott \
+ en-US/Single_Page_Fax.ott \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/cartvprofr.ott \
+ fr/entetelettrefr.ott \
+ fr/facturefr.ott \
+ fr/newsletter_2fr.ott \
+ hu/23755-level_sablon.ott \
+ hu/Buscard_1.ott \
+ hu/Hivatali_dokumentum_2_o_oldalszamozva.ott \
+ hu/Hivatali_dokumentum_elolabban_oldalszamozva_vonallal.ott \
+ hu/hivataloslevelartdeco.ott \
+ hu/hivataloslevelformazott.ott \
+ hu/hivataloslevelirogep.ott \
+ hu/hivataloslevelklasszikus.ott \
+ hu/memo.ott \
+ hu/Meresi_jegyzokonyv_-_Ceges.ott \
+ hu/nemetuzletilev.ott \
+ hu/Nevjegykartya_alap.ott \
+ hu/normalfax.ott \
+ it/Lettera_Formale_Stile_Macchina_Da_Scrivere1.ott \
+ ja/fax_001.ott \
+ ja/fax.ott \
+ ja/invoice.ots \
+ ja/stock_sheet.ots \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatesoffimisc,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/offimisc/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatesoffimisc,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatesoffimisc,$(LIBO_SHARE_FOLDER)/template,offimisc,\
+ cs/dummy_templates.txt \
+ de/01_graph_paper.ott \
+ de/01_invoice.ott \
+ de/01_minutes.ott \
+ de/01_notes.ott \
+ de/01_presentation_background.otp \
+ de/01_press_release.ott \
+ de/02_graph_paper.ott \
+ de/02_invoice.ott \
+ de/02_minutes.ott \
+ de/02_notes.ott \
+ de/02_presentation_background.otp \
+ de/02_press_release.ott \
+ de/03_graph_paper.ott \
+ de/03_invoice.ott \
+ de/03_minutes.ott \
+ de/03_notes.ott \
+ de/03_presentation_background.otp \
+ de/03_press_release.ott \
+ de/04_graph_paper.ott \
+ de/04_invoice.ott \
+ de/04_minutes.ott \
+ de/04_notes.ott \
+ de/04_presentation_background.otp \
+ de/04_press_release.ott \
+ de/05_graph_paper.ott \
+ de/05_invoice.ott \
+ de/05_minutes.ott \
+ de/05_notes.ott \
+ de/05_presentation_background.otp \
+ de/05_press_release.ott \
+ de/06_graph_paper.ott \
+ de/06_invoice.ott \
+ de/06_minutes.ott \
+ de/06_notes.ott \
+ de/06_presentation_background.otp \
+ de/06_press_release.ott \
+ de/agenda.ott \
+ de/benzinrechner.ots \
+ de/ergebnisprotokoll_handschriftlich.ott \
+ de/ergebnisprotokoll.ott \
+ de/fahrtenbuch.ots \
+ de/Projektarbeit.ott \
+ de/projektauftrag.ott \
+ de/projektplanung.ots \
+ de/Stunden-_und_Vorlesungsplan.ots \
+ de/Stundenzettel.ots \
+ de/todo_liste_handschriftlich.ott \
+ de/Zeiterfassungsbogen.ots \
+ en-US/01_graph_paper.ott \
+ en-US/01_invoice.ott \
+ en-US/01_minutes.ott \
+ en-US/01_notes.ott \
+ en-US/01_presentation_background.otp \
+ en-US/01_press_release.ott \
+ en-US/02_graph_paper.ott \
+ en-US/02_invoice.ott \
+ en-US/02_minutes.ott \
+ en-US/02_notes.ott \
+ en-US/02_presentation_background.otp \
+ en-US/02_press_release.ott \
+ en-US/03_graph_paper.ott \
+ en-US/03_invoice.ott \
+ en-US/03_minutes.ott \
+ en-US/03_notes.ott \
+ en-US/03_presentation_background.otp \
+ en-US/03_press_release.ott \
+ en-US/04_graph_paper.ott \
+ en-US/04_invoice.ott \
+ en-US/04_minutes.ott \
+ en-US/04_notes.ott \
+ en-US/04_presentation_background.otp \
+ en-US/04_press_release.ott \
+ en-US/05_graph_paper.ott \
+ en-US/05_invoice.ott \
+ en-US/05_minutes.ott \
+ en-US/05_notes.ott \
+ en-US/05_presentation_background.otp \
+ en-US/05_press_release.ott \
+ en-US/06_graph_paper.ott \
+ en-US/06_invoice.ott \
+ en-US/06_minutes.ott \
+ en-US/06_notes.ott \
+ en-US/06_presentation_background.otp \
+ en-US/06_press_release.ott \
+ en-US/attendanceCalendar.ots \
+ en-US/Blue_Report.ott \
+ en-US/Business_Letter.ott \
+ en-US/Checklist.ott \
+ en-US/CorporateReport.ott \
+ en-US/DailyToDo.ott \
+ en-US/Humanist_Report_A4.ott \
+ en-US/Humanist_Report_Letter.ott \
+ en-US/MeetingFollowUp.ott \
+ en-US/MeetingPreparation.ott \
+ en-US/Membership_Fee_payment_status.ots \
+ en-US/org_chart.ott \
+ en-US/report_3.ott \
+ en-US/Report_Or_Paper.ott \
+ en-US/roster.ots \
+ en-US/Weekly_Timesheet.ots \
+ es/dummy_templates.txt \
+ fi/dummy_templates.txt \
+ fr/diagramfluxfr.otg \
+ fr/FeuillemetreItalienne.ott \
+ fr/FeuillemetrePaysage.ott \
+ fr/Lettre-EnveloppeFenetreC65.ott \
+ fr/logigramfr.otg \
+ fr/logigramme.otg \
+ fr/organigramfr.ott \
+ hu/bizalmasjavaslat.odt \
+ hu/Blue_Report.ott \
+ hu/Checklist.ott \
+ hu/Havi_jelenleti_iv.ots \
+ hu/Irattarolo_16_3-1.ott \
+ hu/Irattarolo_16_3.ott \
+ hu/Irattarolo_16_5-1.ott \
+ hu/Irattarolo_16_5.ott \
+ hu/marginalishirujsag.ott \
+ hu/Mobiltelefon-hasznalati_szabalyzat.ott \
+ hu/moderncegeshirujsag.ott \
+ hu/Posta_ajanlott.otg \
+ hu/sajtokozlemeny.ott \
+ hu/uzletihirlevel.ott \
+ it/dummy_templates.txt \
+ ja/company_directory.ots \
+ ja/Giziroku.ott \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatespersonal,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/personal/lang))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatespersonal,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatespersonal,$(LIBO_SHARE_FOLDER)/template,personal,\
+ cs/dummy_templates.txt \
+ de/faltkarte.otg \
+ de/formalletteraquarius.ott \
+ de/formalletteraries.ott \
+ de/formalletterat.ott \
+ de/formalletterblackwhite.ott \
+ de/formallettercancer.ott \
+ de/formallettercapricornus.ott \
+ de/formallettereye.ott \
+ de/formallettergame.ott \
+ de/formallettergemini.ott \
+ de/formalletterhearts.ott \
+ de/formalletterhexagons.ott \
+ de/formalletterinkpot.ott \
+ de/formalletterleo.ott \
+ de/formalletterlibra.ott \
+ de/formalletterpisces.ott \
+ de/formallettersagittarius.ott \
+ de/formalletterscorpius.ott \
+ de/formallettertaurus.ott \
+ de/formallettervirgo.ott \
+ de/formalletteryinyang.ott \
+ de/merels_board_game_original.otg \
+ de/mitarbeiterplanung_2006.ots \
+ de/tabellarischer_lebenslauf.ott \
+ de/tabellarischer_lebenslauf_popup.ott \
+ de/vitalwerte.ots \
+ en-US/48171-Resume-Template.odt \
+ en-US/ad_resume1.ott \
+ en-US/ad_resume2.ott \
+ en-US/ad_resume3.ott \
+ en-US/BookLabel_12_4x3-WL-OL150.ott \
+ en-US/Country_book6-WL-OL125.ott \
+ en-US/Curriculum_Vitae.ott \
+ en-US/CV.ott \
+ en-US/DailyCalendar.ots \
+ en-US/dayreview.ott \
+ en-US/diarypage.ott \
+ en-US/eventlist.ott \
+ en-US/example-resume.ott \
+ en-US/faltkarte.otg \
+ en-US/formalletteraquarius.ott \
+ en-US/formalletteraries.ott \
+ en-US/formalletterat.ott \
+ en-US/formalletterblackwhite.ott \
+ en-US/formallettercancer.ott \
+ en-US/formallettercapricornus.ott \
+ en-US/formallettereye.ott \
+ en-US/formallettergame.ott \
+ en-US/formallettergemini.ott \
+ en-US/formalletterhearts.ott \
+ en-US/formalletterhexagons.ott \
+ en-US/formalletterinkpot.ott \
+ en-US/formalletterleo.ott \
+ en-US/formalletterlibra.ott \
+ en-US/formalletterpisces.ott \
+ en-US/formallettersagittarius.ott \
+ en-US/formalletterscorpius.ott \
+ en-US/formallettertaurus.ott \
+ en-US/formallettervirgo.ott \
+ en-US/formalletteryinyang.ott \
+ en-US/greeting_card_kids.otg \
+ en-US/home_buying_estimator.ots \
+ en-US/Household_Budget.ots \
+ en-US/humanist_resume_a4.ott \
+ en-US/humanist_resume_letter.ott \
+ en-US/Job_Application.ott \
+ en-US/kaledeiscope-bk-OL150.ott \
+ en-US/merels_board_game_original.otg \
+ en-US/MonthlyBudget.ots \
+ en-US/OpenOffice_Budget_Template.ots \
+ en-US/packinglist.ott \
+ en-US/personal-budget.ots \
+ en-US/personalCoverLetter.ott \
+ en-US/Personal_Expenses_Report_ct.ots \
+ en-US/Personal_Money_Management_Template.ots \
+ en-US/personalReferences.ott \
+ en-US/personalResume.ott \
+ en-US/Recipe.ott \
+ en-US/resume1.1.ott \
+ en-US/resume_4.ott \
+ en-US/Resume_-_Fancy.ott \
+ en-US/Resume.ott \
+ en-US/shopnotes.ott \
+ en-US/Shopping_List.ott \
+ en-US/shopping_list_with_dropdown.ott \
+ en-US/Sudoku_blank.ott \
+ en-US/Todo.ots \
+ en-US/visit.ott \
+ en-US/wedding_planner.ots \
+ en-US/wedgreen-wineWL-OL475.ott \
+ en-US/Week_at_a_glance.ott \
+ en-US/weekly-plan.otg \
+ en-US/week_plan.otg \
+ en-US/WeightTracker.ots \
+ en-US/wine-label8.ott \
+ es/75438-ShopingCart.ott \
+ fi/dummy_templates.txt \
+ fr/Affiche_vente_fr.ott \
+ fr/CD.otg \
+ fr/CVfr.ott \
+ fr/FairePart-Vierge.otg \
+ fr/menu-noel.otp \
+ fr/trifold_brochurefr.ott \
+ hu/gyermekmero.ots \
+ hu/merels_board_game_original.otg \
+ hu/napiterv.ott \
+ hu/Oneletrajz-magyar.ott \
+ hu/resume.ott \
+ hu/Sudoku_megoldo.ots \
+ it/Corsa_OOo.ots \
+ it/curriculum.ott \
+ it/faxPersonale.ott \
+ ja/dummy_templates.txt \
+ ka/dummy_templates.txt \
+ nl/dummy_templates.txt \
+ pl/dummy_templates.txt \
+ pt-BR/dummy_templates.txt \
+ sv/dummy_templates.txt \
+ tr/dummy_templates.txt \
+ zh-CN/dummy_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_AllLangPackage_AllLangPackage,accessoriestemplatespresent,$(call gb_UnpackedTarball_get_dir,templates-pack)/templates/presnt/lang,$(true)))
+
+$(eval $(call gb_AllLangPackage_use_unpacked,accessoriestemplatespresent,templates-pack))
+
+$(eval $(call gb_AllLangPackage_add_files_with_subdir,accessoriestemplatespresent,$(LIBO_SHARE_FOLDER)/template,presnt,\
+ cs/dummy_templates.txt \
+ de/compladients.otp \
+ de/praktikumsbericht.otp \
+ de/produktentwicklung.otp \
+ de/Produktplanung-Verkauf.otp \
+ de/prs-novelty-old-2.otp \
+ de/prs-novelty-old.otp \
+ de/prs-strategy-old-2.otp \
+ de/prs-strategy-old.otp \
+ de/team.otp \
+ de/tech.otp \
+ de/umweltschutz.otp \
+ de/Unternehmensbericht.otp \
+ en-US/compladients.otp \
+ en-US/Focused_Discussion.otp \
+ en-US/Introducing_New_Product.otp \
+ en-US/Orangedric.otp \
+ en-US/prs-novelty-old-2.otp \
+ en-US/prs-novelty-old.otp \
+ en-US/prs-strategy-old-2.otp \
+ en-US/prs-strategy-old.otp \
+ en-US/RedCircle.otp \
+ en-US/Stylish.otp \
+ en-US/team.otp \
+ en-US/tech.otp \
+ en-US/template1.otp \
+ en-US/template2.otp \
+ en-US/template3.otp \
+ en-US/template4.otp \
+ es/compladients.otp \
+ fi/compladients.otp \
+ fr/compladients.otp \
+ fr/prs-novelty-old-2.otp \
+ fr/prs-novelty-old.otp \
+ fr/prs-strategy-old-2.otp \
+ fr/prs-strategy-old.otp \
+ fr/team.otp \
+ fr/tech.otp \
+ hu/Anytime_presentation.otp \
+ hu/Bemutato_uzleti.otp \
+ hu/compladients.otp \
+ hu/prs-novelty-old.otp \
+ hu/prs-strategy-old.otp \
+ it/compladients.otp \
+ it/prs-novelty-old-2.otp \
+ it/prs-novelty-old.otp \
+ it/prs-strategy-old-2.otp \
+ it/prs-strategy-old.otp \
+ it/team.otp \
+ it/tech.otp \
+ ja/business_plan.otp \
+ ja/company-wide_meeting.otp \
+ ja/compladients.otp \
+ ja/creative_session.otp \
+ ja/financial_reporting.otp \
+ ja/general_2.otp \
+ ja/general.otp \
+ ja/marketing_plan.otp \
+ ja/new_employee_orientation.otp \
+ ja/problem_report_2.otp \
+ ja/problem_report.otp \
+ ja/progress_repost_2.otp \
+ ja/progress_repost.otp \
+ ja/proposition_of_strategic_planning_2.otp \
+ ja/proposition_of_strategic_planning.otp \
+ ja/sales_plan_of_product_and_idea_2.otp \
+ ja/sales_plan_of_product_and_idea.otp \
+ ja/top_10_list.otp \
+ ja/training_2.otp \
+ ja/training.otp \
+ ka/compladients.otp \
+ nl/compladients.otp \
+ pl/compladients.otp \
+ pt-BR/compladients.otp \
+ sv/compladients.otp \
+ tr/compladients.otp \
+ zh-CN/compladients.otp \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgallery,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgallery,$(LIBO_SHARE_FOLDER)/gallery,\
+ accessories/sg1010.sdg \
+ accessories/sg1010.sdv \
+ accessories/sg1010.thm \
+ accessories/sg1011.sdg \
+ accessories/sg1011.sdv \
+ accessories/sg1011.thm \
+ accessories/sg101.sdg \
+ accessories/sg101.sdv \
+ accessories/sg101.thm \
+ accessories/sg102.sdg \
+ accessories/sg102.sdv \
+ accessories/sg102.thm \
+ accessories/sg103.sdg \
+ accessories/sg103.sdv \
+ accessories/sg103.thm \
+ accessories/sg105.sdg \
+ accessories/sg105.sdv \
+ accessories/sg105.thm \
+ accessories/sg1067.sdg \
+ accessories/sg1067.sdv \
+ accessories/sg1067.thm \
+ accessories/sg106.sdg \
+ accessories/sg106.sdv \
+ accessories/sg106.thm \
+ accessories/sg107.sdg \
+ accessories/sg107.sdv \
+ accessories/sg107.thm \
+ accessories/sg108.sdg \
+ accessories/sg108.sdv \
+ accessories/sg108.thm \
+ accessories/sg109.sdg \
+ accessories/sg109.sdv \
+ accessories/sg109.thm \
+ accessories/sg110.sdg \
+ accessories/sg110.sdv \
+ accessories/sg110.thm \
+ accessories/sg111.sdg \
+ accessories/sg111.sdv \
+ accessories/sg111.thm \
+ accessories/sg1208.sdg \
+ accessories/sg1208.sdv \
+ accessories/sg1208.thm \
+ accessories/sg121.sdg \
+ accessories/sg121.sdv \
+ accessories/sg121.thm \
+ accessories/sg127.sdg \
+ accessories/sg127.sdv \
+ accessories/sg127.thm \
+ accessories/sg133.sdg \
+ accessories/sg133.sdv \
+ accessories/sg133.thm \
+ accessories/sg200.sdg \
+ accessories/sg200.sdv \
+ accessories/sg200.thm \
+ accessories/sg201.sdg \
+ accessories/sg201.sdv \
+ accessories/sg201.thm \
+ accessories/sg203.sdg \
+ accessories/sg203.sdv \
+ accessories/sg203.thm \
+ accessories/sg204.sdg \
+ accessories/sg204.sdv \
+ accessories/sg204.thm \
+ accessories/sg205.sdg \
+ accessories/sg205.sdv \
+ accessories/sg205.thm \
+ accessories/sg206.sdg \
+ accessories/sg206.sdv \
+ accessories/sg206.thm \
+ accessories/sg207.sdg \
+ accessories/sg207.sdv \
+ accessories/sg207.thm \
+ accessories/sg2101.sdg \
+ accessories/sg2101.sdv \
+ accessories/sg2101.thm \
+ accessories/sg210.sdg \
+ accessories/sg210.sdv \
+ accessories/sg210.thm \
+ accessories/sg212.sdg \
+ accessories/sg212.sdv \
+ accessories/sg212.thm \
+ accessories/sg2245.sdg \
+ accessories/sg2245.sdv \
+ accessories/sg2245.thm \
+ accessories/sg2246.sdg \
+ accessories/sg2246.sdv \
+ accessories/sg2246.thm \
+ accessories/sg2247.sdg \
+ accessories/sg2247.sdv \
+ accessories/sg2247.thm \
+ accessories/sg2248.sdg \
+ accessories/sg2248.sdv \
+ accessories/sg2248.thm \
+ accessories/sg2249.sdg \
+ accessories/sg2249.sdv \
+ accessories/sg2249.thm \
+ accessories/sg2250.sdg \
+ accessories/sg2250.sdv \
+ accessories/sg2250.thm \
+ accessories/sg2251.sdg \
+ accessories/sg2251.sdv \
+ accessories/sg2251.thm \
+ accessories/sg2253.sdg \
+ accessories/sg2253.sdv \
+ accessories/sg2253.thm \
+ accessories/sg2254.sdg \
+ accessories/sg2254.sdv \
+ accessories/sg2254.thm \
+ accessories/sg2255.sdg \
+ accessories/sg2255.sdv \
+ accessories/sg2255.thm \
+ accessories/sg2256.sdg \
+ accessories/sg2256.sdv \
+ accessories/sg2256.thm \
+ accessories/sg2257.sdg \
+ accessories/sg2257.sdv \
+ accessories/sg2257.thm \
+ accessories/sg2258.sdg \
+ accessories/sg2258.sdv \
+ accessories/sg2258.thm \
+ accessories/sg2259.sdg \
+ accessories/sg2259.sdv \
+ accessories/sg2259.thm \
+ accessories/sg2261.sdg \
+ accessories/sg2261.sdv \
+ accessories/sg2261.thm \
+ accessories/sg2262.sdg \
+ accessories/sg2262.sdv \
+ accessories/sg2262.thm \
+ accessories/sg2264.sdg \
+ accessories/sg2264.sdv \
+ accessories/sg2264.thm \
+ accessories/sg2265.sdg \
+ accessories/sg2265.sdv \
+ accessories/sg2265.thm \
+ accessories/sg2266.sdg \
+ accessories/sg2266.sdv \
+ accessories/sg2266.thm \
+ accessories/sg2267.sdg \
+ accessories/sg2267.sdv \
+ accessories/sg2267.thm \
+ accessories/sg2268.sdg \
+ accessories/sg2268.sdv \
+ accessories/sg2268.thm \
+ accessories/sg2269.sdg \
+ accessories/sg2269.sdv \
+ accessories/sg2269.thm \
+ accessories/sg2270.sdg \
+ accessories/sg2270.sdv \
+ accessories/sg2270.thm \
+ accessories/sg2272.sdg \
+ accessories/sg2272.sdv \
+ accessories/sg2272.thm \
+ accessories/sg2273.sdg \
+ accessories/sg2273.sdv \
+ accessories/sg2273.thm \
+ accessories/sg2274.sdg \
+ accessories/sg2274.sdv \
+ accessories/sg2274.thm \
+ accessories/sg2275.sdg \
+ accessories/sg2275.sdv \
+ accessories/sg2275.thm \
+ accessories/sg2276.sdg \
+ accessories/sg2276.sdv \
+ accessories/sg2276.thm \
+ accessories/sg2277.sdg \
+ accessories/sg2277.sdv \
+ accessories/sg2277.thm \
+ accessories/sg2278.sdg \
+ accessories/sg2278.sdv \
+ accessories/sg2278.thm \
+ accessories/sg2279.sdg \
+ accessories/sg2279.sdv \
+ accessories/sg2279.thm \
+ accessories/sg2280.sdg \
+ accessories/sg2280.sdv \
+ accessories/sg2280.thm \
+ accessories/sg2281.sdg \
+ accessories/sg2281.sdv \
+ accessories/sg2281.thm \
+ accessories/sg2282.sdg \
+ accessories/sg2282.sdv \
+ accessories/sg2282.thm \
+ accessories/sg2283.sdg \
+ accessories/sg2283.sdv \
+ accessories/sg2283.thm \
+ accessories/sg2284.sdg \
+ accessories/sg2284.sdv \
+ accessories/sg2284.thm \
+ accessories/sg2285.sdg \
+ accessories/sg2285.sdv \
+ accessories/sg2285.thm \
+ accessories/sg2303.sdg \
+ accessories/sg2303.sdv \
+ accessories/sg2303.thm \
+ accessories/sg2304.sdg \
+ accessories/sg2304.sdv \
+ accessories/sg2304.thm \
+ accessories/sg2305.sdg \
+ accessories/sg2305.sdv \
+ accessories/sg2305.thm \
+ accessories/sg2306.sdg \
+ accessories/sg2306.sdv \
+ accessories/sg2306.thm \
+ accessories/sg2307.sdg \
+ accessories/sg2307.sdv \
+ accessories/sg2307.thm \
+ accessories/sg2308.sdg \
+ accessories/sg2308.sdv \
+ accessories/sg2308.thm \
+ accessories/sg2309.sdg \
+ accessories/sg2309.sdv \
+ accessories/sg2309.thm \
+ accessories/sg2310.sdg \
+ accessories/sg2310.sdv \
+ accessories/sg2310.thm \
+ accessories/sg2311.sdg \
+ accessories/sg2311.sdv \
+ accessories/sg2311.thm \
+ accessories/sg2312.sdg \
+ accessories/sg2312.sdv \
+ accessories/sg2312.thm \
+ accessories/sg231.sdg \
+ accessories/sg231.sdv \
+ accessories/sg231.thm \
+ accessories/sg301.sdg \
+ accessories/sg301.sdv \
+ accessories/sg301.thm \
+ accessories/sg302.sdg \
+ accessories/sg302.sdv \
+ accessories/sg302.thm \
+ accessories/sg303.sdg \
+ accessories/sg303.sdv \
+ accessories/sg303.thm \
+ accessories/sg304.sdg \
+ accessories/sg304.sdv \
+ accessories/sg304.thm \
+ accessories/sg305.sdg \
+ accessories/sg305.sdv \
+ accessories/sg305.thm \
+ accessories/sg307.sdg \
+ accessories/sg307.sdv \
+ accessories/sg307.thm \
+ accessories/sg308.sdg \
+ accessories/sg308.sdv \
+ accessories/sg308.thm \
+ accessories/sg309.sdg \
+ accessories/sg309.sdv \
+ accessories/sg309.thm \
+ accessories/sg310.sdg \
+ accessories/sg310.sdv \
+ accessories/sg310.thm \
+ accessories/sg311.sdg \
+ accessories/sg311.sdv \
+ accessories/sg311.thm \
+ accessories/sg312.sdg \
+ accessories/sg312.sdv \
+ accessories/sg312.thm \
+ accessories/sg313.sdg \
+ accessories/sg313.sdv \
+ accessories/sg313.thm \
+ accessories/sg314.sdg \
+ accessories/sg314.sdv \
+ accessories/sg314.thm \
+ accessories/sg315.sdg \
+ accessories/sg315.sdv \
+ accessories/sg315.thm \
+ accessories/sg316.sdg \
+ accessories/sg316.sdv \
+ accessories/sg316.thm \
+ accessories/sg317.sdg \
+ accessories/sg317.sdv \
+ accessories/sg317.thm \
+ accessories/sg318.sdg \
+ accessories/sg318.sdv \
+ accessories/sg318.thm \
+ accessories/sg319.sdg \
+ accessories/sg319.sdv \
+ accessories/sg319.thm \
+ accessories/sg320.sdg \
+ accessories/sg320.sdv \
+ accessories/sg320.thm \
+ accessories/sg402.sdg \
+ accessories/sg402.sdv \
+ accessories/sg402.thm \
+ accessories/sg403.sdg \
+ accessories/sg403.sdv \
+ accessories/sg403.thm \
+ accessories/sg404.sdg \
+ accessories/sg404.sdv \
+ accessories/sg404.thm \
+ accessories/sg405.sdg \
+ accessories/sg405.sdv \
+ accessories/sg405.thm \
+ accessories/sg412.sdg \
+ accessories/sg412.sdv \
+ accessories/sg412.thm \
+ accessories/sg555.sdg \
+ accessories/sg555.sdv \
+ accessories/sg555.thm \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+#$(eval $(call gb_Package_Package,accessories_accessoriesgallerydrawspeople,$(call gb_UnpackedTarball_get_dir,gallery-pack)/accessories/Draws/People))
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgallerydrawspeople,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgallerydrawspeople,$(LIBO_SHARE_FOLDER)/gallery/Draws/People,\
+ accessories/Draws/People/Baboo1.png \
+ accessories/Draws/People/Jac1.png \
+ accessories/Draws/People/Jac2.png \
+ accessories/Draws/People/Jac3.png \
+ accessories/Draws/People/Jac4.png \
+ accessories/Draws/People/Paul-1.png \
+ accessories/Draws/People/Paul-2.png \
+ accessories/Draws/People/Paul-3.jpg \
+ accessories/Draws/People/Paul-3.png \
+ accessories/Draws/People/Paul-4.png \
+ accessories/Draws/People/Paul-5.png \
+ accessories/Draws/People/Paul-6.png \
+ accessories/Draws/People/Paul-7.png \
+ accessories/Draws/People/Paul-8.png \
+ accessories/Draws/People/Ruty1.png \
+ accessories/Draws/People/tof-1.png \
+ accessories/Draws/People/tof-2.png \
+ accessories/Draws/People/tof-3.png \
+ accessories/Draws/People/Zoa1.png \
+ accessories/Draws/People/Zoa2.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryelementsbullets2,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryelementsbullets2,$(LIBO_SHARE_FOLDER)/gallery/Elements/Bullets2,\
+ accessories/Elements/Bullets2/amethyst.arrow.png \
+ accessories/Elements/Bullets2/amethyst.asterisk.png \
+ accessories/Elements/Bullets2/amethyst.circle-light.png \
+ accessories/Elements/Bullets2/amethyst.circle.png \
+ accessories/Elements/Bullets2/amethyst.cross1.png \
+ accessories/Elements/Bullets2/amethyst.cross2.png \
+ accessories/Elements/Bullets2/amethyst.dash.png \
+ accessories/Elements/Bullets2/amethyst.diamond-light.png \
+ accessories/Elements/Bullets2/amethyst.diamond.png \
+ accessories/Elements/Bullets2/amethyst.minus.png \
+ accessories/Elements/Bullets2/amethyst.plus.png \
+ accessories/Elements/Bullets2/amethyst.smiley.png \
+ accessories/Elements/Bullets2/amethyst.square-light.png \
+ accessories/Elements/Bullets2/amethyst.square.png \
+ accessories/Elements/Bullets2/amethyst.star.png \
+ accessories/Elements/Bullets2/amethyst.tick.png \
+ accessories/Elements/Bullets2/amethyst.triangle1-light.png \
+ accessories/Elements/Bullets2/amethyst.triangle1.png \
+ accessories/Elements/Bullets2/amethyst.triangle2-light.png \
+ accessories/Elements/Bullets2/amethyst.triangle2.png \
+ accessories/Elements/Bullets2/citrine.arrow.png \
+ accessories/Elements/Bullets2/citrine.asterisk.png \
+ accessories/Elements/Bullets2/citrine.circle-light.png \
+ accessories/Elements/Bullets2/citrine.circle.png \
+ accessories/Elements/Bullets2/citrine.cross1.png \
+ accessories/Elements/Bullets2/citrine.cross2.png \
+ accessories/Elements/Bullets2/citrine.dash.png \
+ accessories/Elements/Bullets2/citrine.diamond-light.png \
+ accessories/Elements/Bullets2/citrine.diamond.png \
+ accessories/Elements/Bullets2/citrine.minus.png \
+ accessories/Elements/Bullets2/citrine.plus.png \
+ accessories/Elements/Bullets2/citrine.smiley.png \
+ accessories/Elements/Bullets2/citrine.square-light.png \
+ accessories/Elements/Bullets2/citrine.square.png \
+ accessories/Elements/Bullets2/citrine.star.png \
+ accessories/Elements/Bullets2/citrine.tick.png \
+ accessories/Elements/Bullets2/citrine.triangle1-light.png \
+ accessories/Elements/Bullets2/citrine.triangle1.png \
+ accessories/Elements/Bullets2/citrine.triangle2-light.png \
+ accessories/Elements/Bullets2/citrine.triangle2.png \
+ accessories/Elements/Bullets2/emerald.arrow.png \
+ accessories/Elements/Bullets2/emerald.asterisk.png \
+ accessories/Elements/Bullets2/emerald.circle-light.png \
+ accessories/Elements/Bullets2/emerald.circle.png \
+ accessories/Elements/Bullets2/emerald.cross1.png \
+ accessories/Elements/Bullets2/emerald.cross2.png \
+ accessories/Elements/Bullets2/emerald.dash.png \
+ accessories/Elements/Bullets2/emerald.diamond-light.png \
+ accessories/Elements/Bullets2/emerald.diamond.png \
+ accessories/Elements/Bullets2/emerald.minus.png \
+ accessories/Elements/Bullets2/emerald.plus.png \
+ accessories/Elements/Bullets2/emerald.smiley.png \
+ accessories/Elements/Bullets2/emerald.square-light.png \
+ accessories/Elements/Bullets2/emerald.square.png \
+ accessories/Elements/Bullets2/emerald.star.png \
+ accessories/Elements/Bullets2/emerald.tick.png \
+ accessories/Elements/Bullets2/emerald.triangle1-light.png \
+ accessories/Elements/Bullets2/emerald.triangle1.png \
+ accessories/Elements/Bullets2/emerald.triangle2-light.png \
+ accessories/Elements/Bullets2/emerald.triangle2.png \
+ accessories/Elements/Bullets2/glass.arrow.png \
+ accessories/Elements/Bullets2/glass.asterisk.png \
+ accessories/Elements/Bullets2/glass.circle-light.png \
+ accessories/Elements/Bullets2/glass.circle.png \
+ accessories/Elements/Bullets2/glass.cross1.png \
+ accessories/Elements/Bullets2/glass.cross2.png \
+ accessories/Elements/Bullets2/glass.dash.png \
+ accessories/Elements/Bullets2/glass.diamond-light.png \
+ accessories/Elements/Bullets2/glass.diamond.png \
+ accessories/Elements/Bullets2/glass.minus.png \
+ accessories/Elements/Bullets2/glass.plus.png \
+ accessories/Elements/Bullets2/glass.smiley.png \
+ accessories/Elements/Bullets2/glass.square-light.png \
+ accessories/Elements/Bullets2/glass.square.png \
+ accessories/Elements/Bullets2/glass.star.png \
+ accessories/Elements/Bullets2/glass.tick.png \
+ accessories/Elements/Bullets2/glass.triangle1-light.png \
+ accessories/Elements/Bullets2/glass.triangle1.png \
+ accessories/Elements/Bullets2/glass.triangle2-light.png \
+ accessories/Elements/Bullets2/glass.triangle2.png \
+ accessories/Elements/Bullets2/mono.arrow.png \
+ accessories/Elements/Bullets2/mono.asterisk.png \
+ accessories/Elements/Bullets2/mono.circle-light.png \
+ accessories/Elements/Bullets2/mono.circle.png \
+ accessories/Elements/Bullets2/mono.circle-semi1.png \
+ accessories/Elements/Bullets2/mono.circle-semi2.png \
+ accessories/Elements/Bullets2/mono.cross1.png \
+ accessories/Elements/Bullets2/mono.cross2.png \
+ accessories/Elements/Bullets2/mono.dash.png \
+ accessories/Elements/Bullets2/mono.diamond-light.png \
+ accessories/Elements/Bullets2/mono.diamond.png \
+ accessories/Elements/Bullets2/mono.diamond-semi1.png \
+ accessories/Elements/Bullets2/mono.diamond-semi2.png \
+ accessories/Elements/Bullets2/mono.minus.png \
+ accessories/Elements/Bullets2/mono.plus.png \
+ accessories/Elements/Bullets2/mono.smiley.png \
+ accessories/Elements/Bullets2/mono.square-light.png \
+ accessories/Elements/Bullets2/mono.square.png \
+ accessories/Elements/Bullets2/mono.square-semi1.png \
+ accessories/Elements/Bullets2/mono.square-semi2.png \
+ accessories/Elements/Bullets2/mono.star.png \
+ accessories/Elements/Bullets2/mono.tick.png \
+ accessories/Elements/Bullets2/mono.triangle1-light.png \
+ accessories/Elements/Bullets2/mono.triangle1.png \
+ accessories/Elements/Bullets2/mono.triangle1-semi.png \
+ accessories/Elements/Bullets2/mono.triangle2-light.png \
+ accessories/Elements/Bullets2/mono.triangle2.png \
+ accessories/Elements/Bullets2/mono.triangle2-semi.png \
+ accessories/Elements/Bullets2/mono.triangle3-light.png \
+ accessories/Elements/Bullets2/mono.triangle3.png \
+ accessories/Elements/Bullets2/mono.triangle3-semi.png \
+ accessories/Elements/Bullets2/mono.triangle4-light.png \
+ accessories/Elements/Bullets2/mono.triangle4.png \
+ accessories/Elements/Bullets2/mono.triangle4-semi.png \
+ accessories/Elements/Bullets2/obsidian.arrow.png \
+ accessories/Elements/Bullets2/obsidian.asterisk.png \
+ accessories/Elements/Bullets2/obsidian.circle-light.png \
+ accessories/Elements/Bullets2/obsidian.circle.png \
+ accessories/Elements/Bullets2/obsidian.cross1.png \
+ accessories/Elements/Bullets2/obsidian.cross2.png \
+ accessories/Elements/Bullets2/obsidian.dash.png \
+ accessories/Elements/Bullets2/obsidian.diamond-light.png \
+ accessories/Elements/Bullets2/obsidian.diamond.png \
+ accessories/Elements/Bullets2/obsidian.minus.png \
+ accessories/Elements/Bullets2/obsidian.plus.png \
+ accessories/Elements/Bullets2/obsidian.smiley.png \
+ accessories/Elements/Bullets2/obsidian.square-light.png \
+ accessories/Elements/Bullets2/obsidian.square.png \
+ accessories/Elements/Bullets2/obsidian.star.png \
+ accessories/Elements/Bullets2/obsidian.tick.png \
+ accessories/Elements/Bullets2/obsidian.triangle1-light.png \
+ accessories/Elements/Bullets2/obsidian.triangle1.png \
+ accessories/Elements/Bullets2/obsidian.triangle2-light.png \
+ accessories/Elements/Bullets2/obsidian.triangle2.png \
+ accessories/Elements/Bullets2/ruby.arrow.png \
+ accessories/Elements/Bullets2/ruby.asterisk.png \
+ accessories/Elements/Bullets2/ruby.circle-light.png \
+ accessories/Elements/Bullets2/ruby.circle.png \
+ accessories/Elements/Bullets2/ruby.cross1.png \
+ accessories/Elements/Bullets2/ruby.cross2.png \
+ accessories/Elements/Bullets2/ruby.dash.png \
+ accessories/Elements/Bullets2/ruby.diamond-light.png \
+ accessories/Elements/Bullets2/ruby.diamond.png \
+ accessories/Elements/Bullets2/ruby.minus.png \
+ accessories/Elements/Bullets2/ruby.plus.png \
+ accessories/Elements/Bullets2/ruby.smiley.png \
+ accessories/Elements/Bullets2/ruby.square-light.png \
+ accessories/Elements/Bullets2/ruby.square.png \
+ accessories/Elements/Bullets2/ruby.star.png \
+ accessories/Elements/Bullets2/ruby.tick.png \
+ accessories/Elements/Bullets2/ruby.triangle1-light.png \
+ accessories/Elements/Bullets2/ruby.triangle1.png \
+ accessories/Elements/Bullets2/ruby.triangle2-light.png \
+ accessories/Elements/Bullets2/ruby.triangle2.png \
+ accessories/Elements/Bullets2/sapphire.arrow.png \
+ accessories/Elements/Bullets2/sapphire.asterisk.png \
+ accessories/Elements/Bullets2/sapphire.circle-light.png \
+ accessories/Elements/Bullets2/sapphire.circle.png \
+ accessories/Elements/Bullets2/sapphire.cross1.png \
+ accessories/Elements/Bullets2/sapphire.cross2.png \
+ accessories/Elements/Bullets2/sapphire.dash.png \
+ accessories/Elements/Bullets2/sapphire.diamond-light.png \
+ accessories/Elements/Bullets2/sapphire.diamond.png \
+ accessories/Elements/Bullets2/sapphire.minus.png \
+ accessories/Elements/Bullets2/sapphire.plus.png \
+ accessories/Elements/Bullets2/sapphire.smiley.png \
+ accessories/Elements/Bullets2/sapphire.square-light.png \
+ accessories/Elements/Bullets2/sapphire.square.png \
+ accessories/Elements/Bullets2/sapphire.star.png \
+ accessories/Elements/Bullets2/sapphire.tick.png \
+ accessories/Elements/Bullets2/sapphire.triangle1-light.png \
+ accessories/Elements/Bullets2/sapphire.triangle1.png \
+ accessories/Elements/Bullets2/sapphire.triangle2-light.png \
+ accessories/Elements/Bullets2/sapphire.triangle2.png \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgallerynonfree,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgallerynonfree,$(LIBO_SHARE_FOLDER)/gallery,\
+ accessories-nonfree/sg600.sdg \
+ accessories-nonfree/sg600.sdv \
+ accessories-nonfree/sg600.thm \
+ accessories-nonfree/sg601.sdg \
+ accessories-nonfree/sg601.sdv \
+ accessories-nonfree/sg601.thm \
+ accessories-nonfree/sg602.sdg \
+ accessories-nonfree/sg602.sdv \
+ accessories-nonfree/sg602.thm \
+ accessories-nonfree/sg603.sdg \
+ accessories-nonfree/sg603.sdv \
+ accessories-nonfree/sg603.thm \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosbuildings,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosbuildings,$(LIBO_SHARE_FOLDER)/gallery/Photos/Buildings,\
+ accessories/Photos/Buildings/ArkSoft0408010009.jpg \
+ accessories/Photos/Buildings/ArkSoft0408010023.jpg \
+ accessories/Photos/Buildings/ArkSoft0408010026.jpg \
+ accessories/Photos/Buildings/ArkSoft0507170031.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100004.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100005.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100006.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100007.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100008.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100011.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100013.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100014.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100015.jpg \
+ accessories/Photos/Buildings/ArkSoft0508100016.jpg \
+ accessories/Photos/Buildings/JS_PDPhO_ireland_cashel.jpg \
+ accessories/Photos/Buildings/JS_PDPhO_ireland_rock_of_cashel.jpg \
+ accessories/Photos/Buildings/JS_PDPhO_sandiego_building_into_clouds.jpg \
+ accessories/Photos/Buildings/morguefiles_com_pindiyath100_10930048528.jpg \
+ accessories/Photos/Buildings/morguefiles_com_pindiyath100_131512197.jpg \
+ accessories/Photos/Buildings/morguefiles_com_pindiyath100_137771099.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotoscelebration,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotoscelebration,$(LIBO_SHARE_FOLDER)/gallery/Photos/Celebration,\
+ accessories/Photos/Celebration/JS_PDPhO_fireworks_burst.jpg \
+ accessories/Photos/Celebration/JS_PDPhO_new_years_fireworks_explosion.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotoscities,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotoscities,$(LIBO_SHARE_FOLDER)/gallery/Photos/Cities,\
+ accessories/Photos/Cities/ArkSoft0507170040.jpg \
+ accessories/Photos/Cities/ArkSoft0507170041.jpg \
+ accessories/Photos/Cities/ArkSoft0508100003.jpg \
+ accessories/Photos/Cities/ArkSoft0508100009.jpg \
+ accessories/Photos/Cities/ArkSoft0508100010.jpg \
+ accessories/Photos/Cities/ArkSoft0508100012.jpg \
+ accessories/Photos/Cities/ArkSoft0508100017.jpg \
+ accessories/Photos/Cities/morguefiles_com_pindiyath100_109777662243.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosfauna,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosfauna,$(LIBO_SHARE_FOLDER)/gallery/Photos/Fauna,\
+ accessories/Photos/Fauna/ArkSoft0407030001.jpg \
+ accessories/Photos/Fauna/bee_on_citrus.jpg \
+ accessories/Photos/Fauna/dog01.jpg \
+ accessories/Photos/Fauna/dog02.jpg \
+ accessories/Photos/Fauna/dog_sv400114.jpg \
+ accessories/Photos/Fauna/donkey_sv400131.jpg \
+ accessories/Photos/Fauna/elephant01.jpg \
+ accessories/Photos/Fauna/frog01.jpg \
+ accessories/Photos/Fauna/frog02.jpg \
+ accessories/Photos/Fauna/frog03.jpg \
+ accessories/Photos/Fauna/frog04.jpg \
+ accessories/Photos/Fauna/frog05.jpg \
+ accessories/Photos/Fauna/jellies01.jpg \
+ accessories/Photos/Fauna/JS_PDPhO_animal_duck.jpg \
+ accessories/Photos/Fauna/JS_PDPhO_bee_hovering.jpg \
+ accessories/Photos/Fauna/JS_PDPhO_bigsur_el_seals_seeweed.jpg \
+ accessories/Photos/Fauna/JS_PDPhO_butterfly_on_leaf.jpg \
+ accessories/Photos/Fauna/JS_PDPhO_ireland_sheep_shorn.jpg \
+ accessories/Photos/Fauna/JS_PDPhO_spider_web.jpg \
+ accessories/Photos/Fauna/kangaroo01.jpg \
+ accessories/Photos/Fauna/koala01.jpg \
+ accessories/Photos/Fauna/lizard01.jpg \
+ accessories/Photos/Fauna/lizard02.jpg \
+ accessories/Photos/Fauna/moluchus_horridus01.jpg \
+ accessories/Photos/Fauna/moluchus_horridus02.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_109290559643.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_10964794274.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_110106397519.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_111023591.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_111478817614.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_121259975.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_121583357.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_121583377.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_128319370.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_129017506.jpg \
+ accessories/Photos/Fauna/morguefiles_com_pindiyath100_A1200214.JPG \
+ accessories/Photos/Fauna/parrot01.jpg \
+ accessories/Photos/Fauna/penguin01.jpg \
+ accessories/Photos/Fauna/raccoon.jpg \
+ accessories/Photos/Fauna/snail.jpg \
+ accessories/Photos/Fauna/spider01.jpg \
+ accessories/Photos/Fauna/spider_sv400268.jpg \
+ accessories/Photos/Fauna/spider_sv400270.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosflowers,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosflowers,$(LIBO_SHARE_FOLDER)/gallery/Photos/Flowers,\
+ accessories/Photos/Flowers/1481157185_28ea113529_o.jpg \
+ accessories/Photos/Flowers/1482010374_31c0e4c1ed_o.jpg \
+ accessories/Photos/Flowers/ArkSoft0405010001.jpg \
+ accessories/Photos/Flowers/ArkSoft0405020017.jpg \
+ accessories/Photos/Flowers/ArkSoft0405050005.jpg \
+ accessories/Photos/Flowers/ArkSoft0411070015.jpg \
+ accessories/Photos/Flowers/edelweiss_sv400091.jpg \
+ accessories/Photos/Flowers/JS_PDPhO_flowers_in_field_yellow_orange.jpg \
+ accessories/Photos/Flowers/JS_PDPhO_orchid_pink.jpg \
+ accessories/Photos/Flowers/JS_PDPhO_rose.jpg \
+ accessories/Photos/Flowers/JS_PDPhO_sunflower_in_sun.jpg \
+ accessories/Photos/Flowers/JS_PDPhO_water_lillies.jpg \
+ accessories/Photos/Flowers/morguefiles_com_pindiyath100_109292831129.jpg \
+ accessories/Photos/Flowers/morguefiles_com_pindiyath100_11005053248.jpg \
+ accessories/Photos/Flowers/morguefiles_com_pindiyath100_127103763.jpg \
+ accessories/Photos/Flowers/poppy_sv400105.jpg \
+ accessories/Photos/Flowers/rose_sv400109.jpg \
+ accessories/Photos/Flowers/rose_sv400157.jpg \
+ accessories/Photos/Flowers/spring_sv400013.jpg \
+ accessories/Photos/Flowers/spring_sv400015.jpg \
+ accessories/Photos/Flowers/spring_sv400017.jpg \
+ accessories/Photos/Flowers/spring_sv400033.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosfoodsanddrinks,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosfoodsanddrinks,$(LIBO_SHARE_FOLDER)/gallery/Photos/FoodsandDrinks,\
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_beer.jpg \
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_fish_and_chips.jpg \
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_lasagna.jpg \
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_nachos.jpg \
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_pizza.jpg \
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_steaks.jpg \
+ accessories/Photos/FoodsandDrinks/JS_PDPhO_strawberry_shortcake.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotoshumans,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotoshumans,$(LIBO_SHARE_FOLDER)/gallery/Photos/Humans,\
+ accessories/Photos/Humans/1471425079_b3b53bdf5f_b.jpg \
+ accessories/Photos/Humans/1472456323_62f1a7dad1_o.jpg \
+ accessories/Photos/Humans/1473308070_30ac88194b_o.jpg \
+ accessories/Photos/Humans/1481457389_86532082cb_b.jpg \
+ accessories/Photos/Humans/1482314200_1f933fe66f_b.jpg \
+ accessories/Photos/Humans/morguefiles_com_pindiyath100_A1200509.JPG \
+ accessories/Photos/Humans/morguefiles_com_pindiyath100_A1200513.JPG \
+ accessories/Photos/Humans/morguefiles_com_pindiyath100_A1220569.JPG \
+ accessories/Photos/Humans/morguefiles_com_pindiyath100_Fun_time.JPG \
+ accessories/Photos/Humans/morguefiles_com_pindiyath100_Lady_with_THE_UMBRELLA.jpg \
+ accessories/Photos/Humans/morguefiles_com_pindiyath100_PIC1092760844134.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotoslandscapes,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotoslandscapes,$(LIBO_SHARE_FOLDER)/gallery/Photos/Landscapes,\
+ accessories/Photos/Landscapes/ArkSoft0405010010.jpg \
+ accessories/Photos/Landscapes/ArkSoft0405010019.jpg \
+ accessories/Photos/Landscapes/ArkSoft0405010050.jpg \
+ accessories/Photos/Landscapes/ArkSoft0405020009.jpg \
+ accessories/Photos/Landscapes/ArkSoft0405020012.jpg \
+ accessories/Photos/Landscapes/ArkSoft0405050001.jpg \
+ accessories/Photos/Landscapes/ArkSoft0405050016.jpg \
+ accessories/Photos/Landscapes/ArkSoft0407030007.jpg \
+ accessories/Photos/Landscapes/ArkSoft0411070003.jpg \
+ accessories/Photos/Landscapes/ArkSoft0411070008.jpg \
+ accessories/Photos/Landscapes/ArkSoft0411070009.jpg \
+ accessories/Photos/Landscapes/ArkSoft0411070011.jpg \
+ accessories/Photos/Landscapes/ArkSoft0411070025.jpg \
+ accessories/Photos/Landscapes/ArkSoft0411070029.jpg \
+ accessories/Photos/Landscapes/ArkSoft0508100001.jpg \
+ accessories/Photos/Landscapes/ArkSoft0508100002.jpg \
+ accessories/Photos/Landscapes/ArkSoft0508100019.jpg \
+ accessories/Photos/Landscapes/dsc00001.jpg \
+ accessories/Photos/Landscapes/dsc00002.jpg \
+ accessories/Photos/Landscapes/dsc00003.jpg \
+ accessories/Photos/Landscapes/dsc00004_001.jpg \
+ accessories/Photos/Landscapes/dsc00004_002.jpg \
+ accessories/Photos/Landscapes/dsc00004.jpg \
+ accessories/Photos/Landscapes/dsc00005_001.jpg \
+ accessories/Photos/Landscapes/dsc00005_002.jpg \
+ accessories/Photos/Landscapes/dsc00006_001.jpg \
+ accessories/Photos/Landscapes/dsc00006.jpg \
+ accessories/Photos/Landscapes/dsc00012.jpg \
+ accessories/Photos/Landscapes/dsc00021.jpg \
+ accessories/Photos/Landscapes/dsc00029_001.jpg \
+ accessories/Photos/Landscapes/dsc00038.jpg \
+ accessories/Photos/Landscapes/dsc00039.jpg \
+ accessories/Photos/Landscapes/dsc00041.jpg \
+ accessories/Photos/Landscapes/dsc00043.jpg \
+ accessories/Photos/Landscapes/dsc00045.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_arizona_monument_valley.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_bigsur_crashing_waves.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_bigsur_mcway_falls.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_canada_banff.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_canada_moraine_lake_near_lake_louise.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_grand_canyon_3.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_grand_canyon_with_snow.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_imperial_beach_pier.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_ireland_beach_sheep.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_ireland_glencar_falls.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_ocean_beach_surf.jpg \
+ accessories/Photos/Landscapes/JS_PDPhO_point_loma_tide_pools.jpg \
+ accessories/Photos/Landscapes/lake_sv400007.jpg \
+ accessories/Photos/Landscapes/lake_sv400009.jpg \
+ accessories/Photos/Landscapes/lake_sv400202.jpg \
+ accessories/Photos/Landscapes/morguefiles_com_pindiyath100_10943568670.jpg \
+ accessories/Photos/Landscapes/morguefiles_com_pindiyath100_132583019.jpg \
+ accessories/Photos/Landscapes/morguefiles_com_pindiyath100_143459647.jpg \
+ accessories/Photos/Landscapes/morguefiles_com_pindiyath100_A1190465a.JPG \
+ accessories/Photos/Landscapes/morguefiles_com_pindiyath100_A12202723.JPG \
+ accessories/Photos/Landscapes/morguefiles_com_pindiyath100_Garden.JPG \
+ accessories/Photos/Landscapes/mountains_sv400026.jpg \
+ accessories/Photos/Landscapes/mountains_sv400073.jpg \
+ accessories/Photos/Landscapes/spring_sv400040.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosobjects,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosobjects,$(LIBO_SHARE_FOLDER)/gallery/Photos/Objects,\
+ accessories/Photos/Objects/JS_PDPhO_dragon_celebration.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_111064504847.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_122931551.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_148584163.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_149059900.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_149489898.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_150855874.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_160703628.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_A1160419.JPG \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_A1180678.JPG \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_A1190005.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_A1250317.JPG \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_Fountain_pen.JPG \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_P1120434.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_PIC1092515922117.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_PIC109263097871.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_PIC109284443682.jpg \
+ accessories/Photos/Objects/morguefiles_com_pindiyath100_Screw_Driver__and_screws.JPG \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosplants,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosplants,$(LIBO_SHARE_FOLDER)/gallery/Photos/Plants,\
+ accessories/Photos/Plants/ArkSoft0405020018.jpg \
+ accessories/Photos/Plants/ArkSoft0405020019.jpg \
+ accessories/Photos/Plants/ArkSoft0508100018.jpg \
+ accessories/Photos/Plants/ArkSoft0508100020.jpg \
+ accessories/Photos/Plants/autumn_bonsai.jpg \
+ accessories/Photos/Plants/Banksia.jpg \
+ accessories/Photos/Plants/blueberries_sv400141.jpg \
+ accessories/Photos/Plants/dsc00002.jpg \
+ accessories/Photos/Plants/dsc00304.jpg \
+ accessories/Photos/Plants/dsc00324.jpg \
+ accessories/Photos/Plants/dsc01427.jpg \
+ accessories/Photos/Plants/dsc02182.jpg \
+ accessories/Photos/Plants/dsc03552.jpg \
+ accessories/Photos/Plants/dsc07896.jpg \
+ accessories/Photos/Plants/dsc08539.jpg \
+ accessories/Photos/Plants/dsc20040214_143702_43.jpg \
+ accessories/Photos/Plants/dsc20040214_143714_44.jpg \
+ accessories/Photos/Plants/dsc20040221_101357_28.jpg \
+ accessories/Photos/Plants/dsc20040225_174051_2.jpg \
+ accessories/Photos/Plants/dsc20040225_174205_4.jpg \
+ accessories/Photos/Plants/dsc20040225_174257_7.jpg \
+ accessories/Photos/Plants/dsc20040306_155810_46.jpg \
+ accessories/Photos/Plants/dsc20040424_132536_49.jpg \
+ accessories/Photos/Plants/dsc20040424_142153_9.jpg \
+ accessories/Photos/Plants/dsc20040424_153430_50.jpg \
+ accessories/Photos/Plants/dsc20040424_153647_56.jpg \
+ accessories/Photos/Plants/dsc20040424_153758_59.jpg \
+ accessories/Photos/Plants/dsc20040424_153816_60.jpg \
+ accessories/Photos/Plants/dsc20040501_130922_3.jpg \
+ accessories/Photos/Plants/dsc20040724_152027_45.jpg \
+ accessories/Photos/Plants/dsc20040724_152233_49.jpg \
+ accessories/Photos/Plants/dsc20040724_152306_50.jpg \
+ accessories/Photos/Plants/dsc20040903_171512_16.jpg \
+ accessories/Photos/Plants/dsc20041231_182903_42.jpg \
+ accessories/Photos/Plants/dsc20041231_182927_43.jpg \
+ accessories/Photos/Plants/dsc20041231_182947_45.jpg \
+ accessories/Photos/Plants/dsc20050101_181121_21.jpg \
+ accessories/Photos/Plants/dsc20050101_181808_30.jpg \
+ accessories/Photos/Plants/dsc20050101_182126_34.jpg \
+ accessories/Photos/Plants/dscn0269.jpg \
+ accessories/Photos/Plants/dscn0528.jpg \
+ accessories/Photos/Plants/edelweiss_sv400091.jpg \
+ accessories/Photos/Plants/IMG_0824.jpg \
+ accessories/Photos/Plants/IMG_4528.jpg \
+ accessories/Photos/Plants/JS_PDPhO_fruit_still_life.jpg \
+ accessories/Photos/Plants/JS_PDPhO_garlic_pepper.jpg \
+ accessories/Photos/Plants/JS_PDPhO_onions.jpg \
+ accessories/Photos/Plants/JS_PDPhO_pepper.jpg \
+ accessories/Photos/Plants/morguefiles_com_pindiyath100_10929117394.jpg \
+ accessories/Photos/Plants/morguefiles_com_pindiyath100_109292837223.jpg \
+ accessories/Photos/Plants/morguefiles_com_pindiyath100_A1180933.JPG \
+ accessories/Photos/Plants/morguefiles_com_pindiyath100_A1190412.JPG \
+ accessories/Photos/Plants/morguefiles_com_pindiyath100_Green_leaves.JPG \
+ accessories/Photos/Plants/morguefiles_com_pindiyath100_Kiwi_fruit.jpg \
+ accessories/Photos/Plants/mushrooms_log.jpg \
+ accessories/Photos/Plants/mushroom_sv400101.jpg \
+ accessories/Photos/Plants/random_002.jpg \
+ accessories/Photos/Plants/strawberries_sv400130.jpg \
+ accessories/Photos/Plants/strawberry_sv400131.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosspace,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosspace,$(LIBO_SHARE_FOLDER)/gallery/Photos/Space,\
+ accessories/Photos/Space/Wikimedia_Space_120px-Atlantis_taking_off_on_STS-27.jpg \
+ accessories/Photos/Space/Wikimedia_Space_1995-18-b-large_web.jpg \
+ accessories/Photos/Space/Wikimedia_Space_2005-06-b-large_web.jpg \
+ accessories/Photos/Space/Wikimedia_Space_2005-37-a-large_web.jpg \
+ accessories/Photos/Space/Wikimedia_Space_2006-10-a-large_web.jpg \
+ accessories/Photos/Space/Wikimedia_Space_395px-Mir_as_seen_from_Discovery_during_STS-63.jpg \
+ accessories/Photos/Space/Wikimedia_Space_433px-Baikal_liftoff.jpg \
+ accessories/Photos/Space/Wikimedia_Space_477px-Ap11-KSC-69PC-442.jpg \
+ accessories/Photos/Space/Wikimedia_Space_516px-Shuttle.jpg \
+ accessories/Photos/Space/Wikimedia_Space_594px-Apollo_11_bootprint.jpg \
+ accessories/Photos/Space/Wikimedia_Space_595px-Tarantula_nebula_detail.jpg \
+ accessories/Photos/Space/Wikimedia_Space_600px-Mars_Valles_Marineris.jpeg \
+ accessories/Photos/Space/Wikimedia_Space_682px-Atlantis_Docked_to_Mir.jpg \
+ accessories/Photos/Space/Wikimedia_Space_740px-Hst_sts82.jpg \
+ accessories/Photos/Space/Wikimedia_Space_792px-NASA_Space_Shuttle_Discovery_STS-92.jpg \
+ accessories/Photos/Space/Wikimedia_Space_As08-16-2593.jpg \
+ accessories/Photos/Space/Wikimedia_Space_heic0405a.jpg \
+ accessories/Photos/Space/Wikimedia_Space_NASA-Apollo8-Dec24-Earthrise.jpg \
+ accessories/Photos/Space/Wikimedia_Space_Sputnik.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotosstatues,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotosstatues,$(LIBO_SHARE_FOLDER)/gallery/Photos/Statues,\
+ accessories/Photos/Statues/ArkSoft0507170027.jpg \
+ accessories/Photos/Statues/ArkSoft0507170032.jpg \
+ accessories/Photos/Statues/ArkSoft0507170033.jpg \
+ accessories/Photos/Statues/ArkSoft0507170045.jpg \
+ accessories/Photos/Statues/ArkSoft0507170046.jpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriesgalleryphotostravel,gallery-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriesgalleryphotostravel,$(LIBO_SHARE_FOLDER)/gallery/Photos/Travel,\
+ accessories/Photos/Travel/JS_PDPhO_balloons_festival.jpg \
+ accessories/Photos/Travel/JS_PDPhO_cruise_ship.jpg \
+ accessories/Photos/Travel/JS_PDPhO_tall_ship.jpg \
+ accessories/Photos/Travel/morguefiles_com_pindiyath100_10948812106.jpg \
+ accessories/Photos/Travel/morguefiles_com_pindiyath100_130370322.jpg \
+ accessories/Photos/Travel/morguefiles_com_pindiyath100_P1130277.JPG \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommon,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommon,$(LIBO_SHARE_FOLDER)/template/common,\
+ templates/common/dummy_common_templates.txt \
+ templates/common/svn-commit.2.tmp \
+ templates/common/svn-commit.tmp \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommoneducate,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommoneducate,$(LIBO_SHARE_FOLDER)/template/common/educate,\
+ templates/common/educate/A4-chequered.otg \
+ templates/common/educate/A4-lin_2mm.otg \
+ templates/common/educate/A4-lin_3mm.otg \
+ templates/common/educate/A4-lined.otg \
+ templates/common/educate/A4-linlog.otg \
+ templates/common/educate/A4-lin.otg \
+ templates/common/educate/A4-loglin.otg \
+ templates/common/educate/A4-loglog.otg \
+ templates/common/educate/A4-millimeter_black.ott \
+ templates/common/educate/A4-millimeter_orange.ott \
+ templates/common/educate/A4-millimeter_red.ott \
+ templates/common/educate/A4-rhomb.otg \
+ templates/common/educate/Black_lines_1.otg \
+ templates/common/educate/Black_lines_2.otg \
+ templates/common/educate/Black_lines_3.otg \
+ templates/common/educate/soccer-pitch.otg \
+ templates/common/educate/soccer-practice-template.ott \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonfinance,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonfinance,$(LIBO_SHARE_FOLDER)/template/common/finance,\
+ templates/common/finance/dummy_common_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonforms,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonforms,$(LIBO_SHARE_FOLDER)/template/common/forms,\
+ templates/common/forms/dummy_common_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonlabels,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonlabels,$(LIBO_SHARE_FOLDER)/template/common/labels,\
+ templates/common/labels/24_port_patch_text.otg \
+ templates/common/labels/arrows-black-base.ott \
+ templates/common/labels/WL-OL1000.ott \
+ templates/common/labels/WL-OL100.ott \
+ templates/common/labels/WL-OL1025.ott \
+ templates/common/labels/WL-OL1050.ott \
+ templates/common/labels/WL-OL1075.ott \
+ templates/common/labels/WL-OL1100.ott \
+ templates/common/labels/WL-OL1125.ott \
+ templates/common/labels/WL-OL1150.ott \
+ templates/common/labels/WL-OL1200.ott \
+ templates/common/labels/WL-OL125.ott \
+ templates/common/labels/WL-OL150.ott \
+ templates/common/labels/WL-OL175.ott \
+ templates/common/labels/WL-OL200.ott \
+ templates/common/labels/WL-OL225.ott \
+ templates/common/labels/WL-OL250.ott \
+ templates/common/labels/WL-OL25.ott \
+ templates/common/labels/WL-OL275.ott \
+ templates/common/labels/WL-OL325.ott \
+ templates/common/labels/WL-OL350.ott \
+ templates/common/labels/WL-OL375.ott \
+ templates/common/labels/WL-OL400.ott \
+ templates/common/labels/WL-OL425.ott \
+ templates/common/labels/WL-OL450.ott \
+ templates/common/labels/WL-OL475.ott \
+ templates/common/labels/WL-OL5100.ott \
+ templates/common/labels/WL-OL525.ott \
+ templates/common/labels/WL-OL5275.ott \
+ templates/common/labels/WL-OL5375.ott \
+ templates/common/labels/WL-OL550.ott \
+ templates/common/labels/WL-OL5575.ott \
+ templates/common/labels/WL-OL5600.ott \
+ templates/common/labels/WL-OL5625.ott \
+ templates/common/labels/WL-OL575.ott \
+ templates/common/labels/WL-OL6000.ott \
+ templates/common/labels/WL-OL600.ott \
+ templates/common/labels/WL-OL6025.ott \
+ templates/common/labels/WL-OL6050.ott \
+ templates/common/labels/WL-OL6075.ott \
+ templates/common/labels/WL-OL625.ott \
+ templates/common/labels/WL-OL675.ott \
+ templates/common/labels/WL-OL725.ott \
+ templates/common/labels/WL-OL750.ott \
+ templates/common/labels/WL-OL75.ott \
+ templates/common/labels/WL-OL775.ott \
+ templates/common/labels/WL-OL800.ott \
+ templates/common/labels/WL-OL850.ott \
+ templates/common/labels/WL-OL875.ott \
+ templates/common/labels/WL-OL900.ott \
+ templates/common/labels/WL-OL975.ott \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonlayout,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonlayout,$(LIBO_SHARE_FOLDER)/template/common/layout,\
+ templates/common/layout/31407-squares.otp \
+ templates/common/layout/abstract-015_1.jpg.otp \
+ templates/common/layout/abstract-015_2.jpg.otp \
+ templates/common/layout/abstract-015_3.jpg.otp \
+ templates/common/layout/abstract-015p_1.jpg.otp \
+ templates/common/layout/abstract-015p_2.jpg.otp \
+ templates/common/layout/abstract-015p_3.jpg.otp \
+ templates/common/layout/abstract-015t_1.jpg.otp \
+ templates/common/layout/abstract-015t_2.jpg.otp \
+ templates/common/layout/abstract-015t_3.jpg.otp \
+ templates/common/layout/abstract-032_1.jpg.otp \
+ templates/common/layout/abstract-032_2.jpg.otp \
+ templates/common/layout/abstract-032_3.jpg.otp \
+ templates/common/layout/abstract-032p_1.jpg.otp \
+ templates/common/layout/abstract-032p_2.jpg.otp \
+ templates/common/layout/abstract-032p_3.jpg.otp \
+ templates/common/layout/abstract-032t_1.jpg.otp \
+ templates/common/layout/abstract-032t_2.jpg.otp \
+ templates/common/layout/abstract-032t_3.jpg.otp \
+ templates/common/layout/abstract-078_1.jpg.otp \
+ templates/common/layout/abstract-078_2.jpg.otp \
+ templates/common/layout/abstract-078_3.jpg.otp \
+ templates/common/layout/abstract-078p_1.jpg.otp \
+ templates/common/layout/abstract-078p_2.jpg.otp \
+ templates/common/layout/abstract-078p_3.jpg.otp \
+ templates/common/layout/abstract-078t_1.jpg.otp \
+ templates/common/layout/abstract-078t_2.jpg.otp \
+ templates/common/layout/abstract-078t_3.jpg.otp \
+ templates/common/layout/abstract-138_1.jpg.otp \
+ templates/common/layout/abstract-138_2.jpg.otp \
+ templates/common/layout/abstract-138_3.jpg.otp \
+ templates/common/layout/abstract-138p_1.jpg.otp \
+ templates/common/layout/abstract-138p_2.jpg.otp \
+ templates/common/layout/abstract-138p_3.jpg.otp \
+ templates/common/layout/abstract-138t_1.jpg.otp \
+ templates/common/layout/abstract-138t_2.jpg.otp \
+ templates/common/layout/abstract-138t_3.jpg.otp \
+ templates/common/layout/aquarius.otp \
+ templates/common/layout/blau.otp \
+ templates/common/layout/Blue_2.otp \
+ templates/common/layout/Blue_Boxes.otp \
+ templates/common/layout/Blue_Circles.otp \
+ templates/common/layout/blue-elegance.otp \
+ templates/common/layout/Blue_Lines.otp \
+ templates/common/layout/blue.otp \
+ templates/common/layout/Blue_Silver.otp \
+ templates/common/layout/Blue_Squares.otp \
+ templates/common/layout/Blue_Waves.otp \
+ templates/common/layout/carton.otp \
+ templates/common/layout/chalkboard_2.otp \
+ templates/common/layout/chalkboard.otp \
+ templates/common/layout/circulos_clasicos.otp \
+ templates/common/layout/circulos_originales.otp \
+ templates/common/layout/citrus-e.otp \
+ templates/common/layout/compladients.otp \
+ templates/common/layout/Cool_Space.otp \
+ templates/common/layout/cross_color.otp \
+ templates/common/layout/cross_gray.otp \
+ templates/common/layout/cross_green.otp \
+ templates/common/layout/cross_orange.otp \
+ templates/common/layout/cross_white.otp \
+ templates/common/layout/cross_yellow.otp \
+ templates/common/layout/Cubes.otp \
+ templates/common/layout/Doppellinie-blau.otp \
+ templates/common/layout/EarthLight.otp \
+ templates/common/layout/edge-005_1.jpg.otp \
+ templates/common/layout/edge-005_2.jpg.otp \
+ templates/common/layout/edge-005_3.jpg.otp \
+ templates/common/layout/edge-005p_1.jpg.otp \
+ templates/common/layout/edge-005p_2.jpg.otp \
+ templates/common/layout/edge-005p_3.jpg.otp \
+ templates/common/layout/edge-005t_1.jpg.otp \
+ templates/common/layout/edge-005t_2.jpg.otp \
+ templates/common/layout/edge-005t_3.jpg.otp \
+ templates/common/layout/edge-013_1.jpg.otp \
+ templates/common/layout/edge-013_2.jpg.otp \
+ templates/common/layout/edge-013_3.jpg.otp \
+ templates/common/layout/edge-013p_1.jpg.otp \
+ templates/common/layout/edge-013p_2.jpg.otp \
+ templates/common/layout/edge-013p_3.jpg.otp \
+ templates/common/layout/edge-013t_1.jpg.otp \
+ templates/common/layout/edge-013t_2.jpg.otp \
+ templates/common/layout/edge-013t_3.jpg.otp \
+ templates/common/layout/edge-046_1.jpg.otp \
+ templates/common/layout/edge-046_2.jpg.otp \
+ templates/common/layout/edge-046_3.jpg.otp \
+ templates/common/layout/edge-046p_1.jpg.otp \
+ templates/common/layout/edge-046p_2.jpg.otp \
+ templates/common/layout/edge-046p_3.jpg.otp \
+ templates/common/layout/edge-046t_1.jpg.otp \
+ templates/common/layout/edge-046t_2.jpg.otp \
+ templates/common/layout/edge-046t_3.jpg.otp \
+ templates/common/layout/edge-048_1.jpg.otp \
+ templates/common/layout/edge-048_2.jpg.otp \
+ templates/common/layout/edge-048_3.jpg.otp \
+ templates/common/layout/edge-048p_1.jpg.otp \
+ templates/common/layout/edge-048p_2.jpg.otp \
+ templates/common/layout/edge-048p_3.jpg.otp \
+ templates/common/layout/edge-048t_1.jpg.otp \
+ templates/common/layout/edge-048t_2.jpg.otp \
+ templates/common/layout/edge-048t_3.jpg.otp \
+ templates/common/layout/edge-058_1.jpg.otp \
+ templates/common/layout/edge-058_2.jpg.otp \
+ templates/common/layout/edge-058_3.jpg.otp \
+ templates/common/layout/edge-058p_1.jpg.otp \
+ templates/common/layout/edge-058p_2.jpg.otp \
+ templates/common/layout/edge-058p_3.jpg.otp \
+ templates/common/layout/edge-058t_1.jpg.otp \
+ templates/common/layout/edge-058t_2.jpg.otp \
+ templates/common/layout/edge-058t_3.jpg.otp \
+ templates/common/layout/edge-077_1.jpg.otp \
+ templates/common/layout/edge-077_2.jpg.otp \
+ templates/common/layout/edge-077_3.jpg.otp \
+ templates/common/layout/edge-077p_1.jpg.otp \
+ templates/common/layout/edge-077p_2.jpg.otp \
+ templates/common/layout/edge-077p_3.jpg.otp \
+ templates/common/layout/edge-077t_1.jpg.otp \
+ templates/common/layout/edge-077t_2.jpg.otp \
+ templates/common/layout/edge-077t_3.jpg.otp \
+ templates/common/layout/edge-084_1.jpg.otp \
+ templates/common/layout/edge-084_2.jpg.otp \
+ templates/common/layout/edge-084_3.jpg.otp \
+ templates/common/layout/edge-084p_1.jpg.otp \
+ templates/common/layout/edge-084p_2.jpg.otp \
+ templates/common/layout/edge-084p_3.jpg.otp \
+ templates/common/layout/edge-084t_1.jpg.otp \
+ templates/common/layout/edge-084t_2.jpg.otp \
+ templates/common/layout/edge-084t_3.jpg.otp \
+ templates/common/layout/edge-091_1.jpg.otp \
+ templates/common/layout/edge-091_2.jpg.otp \
+ templates/common/layout/edge-091_3.jpg.otp \
+ templates/common/layout/edge-091p_1.jpg.otp \
+ templates/common/layout/edge-091p_2.jpg.otp \
+ templates/common/layout/edge-091p_3.jpg.otp \
+ templates/common/layout/edge-091t_1.jpg.otp \
+ templates/common/layout/edge-091t_2.jpg.otp \
+ templates/common/layout/edge-091t_3.jpg.otp \
+ templates/common/layout/edge-092_1.jpg.otp \
+ templates/common/layout/edge-092_2.jpg.otp \
+ templates/common/layout/edge-092_3.jpg.otp \
+ templates/common/layout/edge-092p_1.jpg.otp \
+ templates/common/layout/edge-092p_2.jpg.otp \
+ templates/common/layout/edge-092p_3.jpg.otp \
+ templates/common/layout/edge-092t_1.jpg.otp \
+ templates/common/layout/edge-092t_2.jpg.otp \
+ templates/common/layout/edge-092t_3.jpg.otp \
+ templates/common/layout/edge-104_1.jpg.otp \
+ templates/common/layout/edge-104_2.jpg.otp \
+ templates/common/layout/edge-104_3.jpg.otp \
+ templates/common/layout/edge-104p_1.jpg.otp \
+ templates/common/layout/edge-104p_2.jpg.otp \
+ templates/common/layout/edge-104p_3.jpg.otp \
+ templates/common/layout/edge-109_1.jpg.otp \
+ templates/common/layout/edge-109_2.jpg.otp \
+ templates/common/layout/edge-109_3.jpg.otp \
+ templates/common/layout/edge-109p_1.jpg.otp \
+ templates/common/layout/edge-109p_2.jpg.otp \
+ templates/common/layout/edge-109p_3.jpg.otp \
+ templates/common/layout/edge-109t_1.jpg.otp \
+ templates/common/layout/edge-109t_2.jpg.otp \
+ templates/common/layout/edge-109t_3.jpg.otp \
+ templates/common/layout/edge-117_1.jpg.otp \
+ templates/common/layout/edge-117_2.jpg.otp \
+ templates/common/layout/edge-117_3.jpg.otp \
+ templates/common/layout/edge-117p_1.jpg.otp \
+ templates/common/layout/edge-117p_2.jpg.otp \
+ templates/common/layout/edge-117p_3.jpg.otp \
+ templates/common/layout/edge-117t_1.jpg.otp \
+ templates/common/layout/edge-117t_2.jpg.otp \
+ templates/common/layout/edge-117t_3.jpg.otp \
+ templates/common/layout/edge-122_1.jpg.otp \
+ templates/common/layout/edge-122_2.jpg.otp \
+ templates/common/layout/edge-122_3.jpg.otp \
+ templates/common/layout/edge-122p_1.jpg.otp \
+ templates/common/layout/edge-122p_2.jpg.otp \
+ templates/common/layout/edge-122p_3.jpg.otp \
+ templates/common/layout/edge-122t_1.jpg.otp \
+ templates/common/layout/edge-122t_2.jpg.otp \
+ templates/common/layout/edge-122t_3.jpg.otp \
+ templates/common/layout/edge-138_1.jpg.otp \
+ templates/common/layout/edge-138_2.jpg.otp \
+ templates/common/layout/edge-138_3.jpg.otp \
+ templates/common/layout/edge-138p_1.jpg.otp \
+ templates/common/layout/edge-138p_2.jpg.otp \
+ templates/common/layout/edge-138p_3.jpg.otp \
+ templates/common/layout/edge-138t_1.jpg.otp \
+ templates/common/layout/edge-138t_2.jpg.otp \
+ templates/common/layout/edge-138t_3.jpg.otp \
+ templates/common/layout/edge-163_1.jpg.otp \
+ templates/common/layout/edge-163_2.jpg.otp \
+ templates/common/layout/edge-163_3.jpg.otp \
+ templates/common/layout/edge-163p_1.jpg.otp \
+ templates/common/layout/edge-163p_2.jpg.otp \
+ templates/common/layout/edge-163p_3.jpg.otp \
+ templates/common/layout/edge-163t_1.jpg.otp \
+ templates/common/layout/edge-163t_2.jpg.otp \
+ templates/common/layout/edge-163t_3.jpg.otp \
+ templates/common/layout/edge-199_1.jpg.otp \
+ templates/common/layout/edge-199_2.jpg.otp \
+ templates/common/layout/edge-199_3.jpg.otp \
+ templates/common/layout/edge-199p_1.jpg.otp \
+ templates/common/layout/edge-199p_2.jpg.otp \
+ templates/common/layout/edge-199p_3.jpg.otp \
+ templates/common/layout/edge-199t_1.jpg.otp \
+ templates/common/layout/edge-199t_2.jpg.otp \
+ templates/common/layout/edge-199t_3.jpg.otp \
+ templates/common/layout/education-116a.jpg.otp \
+ templates/common/layout/education-116b.jpg.otp \
+ templates/common/layout/education-116c.jpg.otp \
+ templates/common/layout/education-116d.jpg.otp \
+ templates/common/layout/education-116e.jpg.otp \
+ templates/common/layout/emotion2.otp \
+ templates/common/layout/emotion.otp \
+ templates/common/layout/eos.otp \
+ templates/common/layout/exec-au.otp \
+ templates/common/layout/exec-br.otp \
+ templates/common/layout/exec-eh.otp \
+ templates/common/layout/exec-eu.otp \
+ templates/common/layout/exec-in.otp \
+ templates/common/layout/exec-jp.otp \
+ templates/common/layout/exec-nz.otp \
+ templates/common/layout/exec-us.otp \
+ templates/common/layout/exec-za.otp \
+ templates/common/layout/fields-of-peace.otp \
+ templates/common/layout/fresh-morning.otp \
+ templates/common/layout/Girasoles.otp \
+ templates/common/layout/Glossy.otp \
+ templates/common/layout/glowing-rectangles.otp \
+ templates/common/layout/golthia.otp \
+ templates/common/layout/green-concentration.otp \
+ templates/common/layout/greenish-wallpaper.otp \
+ templates/common/layout/Green.otp \
+ templates/common/layout/Grey.otp \
+ templates/common/layout/Hatch.otp \
+ templates/common/layout/holiday-030a.jpg.otp \
+ templates/common/layout/holiday-030b.jpg.otp \
+ templates/common/layout/holiday-032a.jpg.otp \
+ templates/common/layout/holiday-032b.jpg.otp \
+ templates/common/layout/humanist_presentation.otp \
+ templates/common/layout/Human.otp \
+ templates/common/layout/Infantil.otp \
+ templates/common/layout/inspire-001a.jpg.otp \
+ templates/common/layout/inspire-001b.jpg.otp \
+ templates/common/layout/inspire-001c.jpg.otp \
+ templates/common/layout/inspire-011a.jpg.otp \
+ templates/common/layout/inspire-011b.jpg.otp \
+ templates/common/layout/inspire-024a.jpg.otp \
+ templates/common/layout/inspire-024b.jpg.otp \
+ templates/common/layout/inspire-073a.jpg.otp \
+ templates/common/layout/inspire-073b.jpg.otp \
+ templates/common/layout/inspire-073c.jpg.otp \
+ templates/common/layout/inspire-130a.jpg.otp \
+ templates/common/layout/inspire-130b.jpg.otp \
+ templates/common/layout/inspire-166c.jpg.otp \
+ templates/common/layout/kde.otp \
+ templates/common/layout/keynote.otp \
+ templates/common/layout/Lamp.otp \
+ templates/common/layout/Lay_grafity.otp \
+ templates/common/layout/Lay_wood.otp \
+ templates/common/layout/letterpress.otp \
+ templates/common/layout/line_blue.otp \
+ templates/common/layout/line_green.otp \
+ templates/common/layout/line_orange.otp \
+ templates/common/layout/line_red.otp \
+ templates/common/layout/line_white.otp \
+ templates/common/layout/line_yellow.otp \
+ templates/common/layout/list.txt \
+ templates/common/layout/macos103.otp \
+ templates/common/layout/Marble.otp \
+ templates/common/layout/MediaStyle.otp \
+ templates/common/layout/moebius-strip.otp \
+ templates/common/layout/Mondo_Cyan.otp \
+ templates/common/layout/Mondo_Green.otp \
+ templates/common/layout/Mondo_Yellow.otp \
+ templates/common/layout/more-green.otp \
+ templates/common/layout/Movie.otp \
+ templates/common/layout/NavyBlue.otp \
+ templates/common/layout/Notepad.otp \
+ templates/common/layout/ooo2.otp \
+ templates/common/layout/ooo2_spot.otp \
+ templates/common/layout/Openblue.otp \
+ templates/common/layout/openoffice.org_gulls.otp \
+ templates/common/layout/Orange.otp \
+ templates/common/layout/perspective-020_1.jpg.otp \
+ templates/common/layout/perspective-020_2.jpg.otp \
+ templates/common/layout/perspective-020_3.jpg.otp \
+ templates/common/layout/perspective-020p_1.jpg.otp \
+ templates/common/layout/perspective-020p_2.jpg.otp \
+ templates/common/layout/perspective-020p_3.jpg.otp \
+ templates/common/layout/perspective-020t_1.jpg.otp \
+ templates/common/layout/perspective-020t_2.jpg.otp \
+ templates/common/layout/perspective-020t_3.jpg.otp \
+ templates/common/layout/perspective-023_1.jpg.otp \
+ templates/common/layout/perspective-023_2.jpg.otp \
+ templates/common/layout/perspective-023_3.jpg.otp \
+ templates/common/layout/perspective-023p_1.jpg.otp \
+ templates/common/layout/perspective-023p_2.jpg.otp \
+ templates/common/layout/perspective-023p_3.jpg.otp \
+ templates/common/layout/perspective-023t_1.jpg.otp \
+ templates/common/layout/perspective-023t_2.jpg.otp \
+ templates/common/layout/perspective-023t_3.jpg.otp \
+ templates/common/layout/perspective-038_1.jpg.otp \
+ templates/common/layout/perspective-038_2.jpg.otp \
+ templates/common/layout/perspective-038_3.jpg.otp \
+ templates/common/layout/perspective-038p_1.jpg.otp \
+ templates/common/layout/perspective-038p_2.jpg.otp \
+ templates/common/layout/perspective-038p_3.jpg.otp \
+ templates/common/layout/perspective-038t_1.jpg.otp \
+ templates/common/layout/perspective-038t_2.jpg.otp \
+ templates/common/layout/perspective-038t_3.jpg.otp \
+ templates/common/layout/perspective-059_1.jpg.otp \
+ templates/common/layout/perspective-059_2.jpg.otp \
+ templates/common/layout/perspective-059_3.jpg.otp \
+ templates/common/layout/perspective-059p_1.jpg.otp \
+ templates/common/layout/perspective-059p_2.jpg.otp \
+ templates/common/layout/perspective-059p_3.jpg.otp \
+ templates/common/layout/perspective-059t_1.jpg.otp \
+ templates/common/layout/perspective-059t_2.jpg.otp \
+ templates/common/layout/perspective-059t_3.jpg.otp \
+ templates/common/layout/perspective-060_1.jpg.otp \
+ templates/common/layout/perspective-060_2.jpg.otp \
+ templates/common/layout/perspective-060_3.jpg.otp \
+ templates/common/layout/perspective-060p_1.jpg.otp \
+ templates/common/layout/perspective-060p_2.jpg.otp \
+ templates/common/layout/perspective-060p_3.jpg.otp \
+ templates/common/layout/perspective-060t_1.jpg.otp \
+ templates/common/layout/perspective-060t_2.jpg.otp \
+ templates/common/layout/perspective-060t_3.jpg.otp \
+ templates/common/layout/perspective-091_1.jpg.otp \
+ templates/common/layout/perspective-091_2.jpg.otp \
+ templates/common/layout/perspective-091_3.jpg.otp \
+ templates/common/layout/perspective-091p_1.jpg.otp \
+ templates/common/layout/perspective-091p_2.jpg.otp \
+ templates/common/layout/perspective-091p_3.jpg.otp \
+ templates/common/layout/perspective-091t_1.jpg.otp \
+ templates/common/layout/perspective-091t_2.jpg.otp \
+ templates/common/layout/perspective-091t_3.jpg.otp \
+ templates/common/layout/perspective-100_1.jpg.otp \
+ templates/common/layout/perspective-100_2.jpg.otp \
+ templates/common/layout/perspective-100_3.jpg.otp \
+ templates/common/layout/perspective-100p_1.jpg.otp \
+ templates/common/layout/perspective-100p_2.jpg.otp \
+ templates/common/layout/perspective-100p_3.jpg.otp \
+ templates/common/layout/perspective-100t_1.jpg.otp \
+ templates/common/layout/perspective-100t_2.jpg.otp \
+ templates/common/layout/perspective-100t_3.jpg.otp \
+ templates/common/layout/perspective-105_1.jpg.otp \
+ templates/common/layout/perspective-105_2.jpg.otp \
+ templates/common/layout/perspective-105_3.jpg.otp \
+ templates/common/layout/perspective-105p_1.jpg.otp \
+ templates/common/layout/perspective-105p_2.jpg.otp \
+ templates/common/layout/perspective-105p_3.jpg.otp \
+ templates/common/layout/perspective-105t_1.jpg.otp \
+ templates/common/layout/perspective-105t_2.jpg.otp \
+ templates/common/layout/perspective-105t_3.jpg.otp \
+ templates/common/layout/perspective-115_1.jpg.otp \
+ templates/common/layout/perspective-115_2.jpg.otp \
+ templates/common/layout/perspective-115_3.jpg.otp \
+ templates/common/layout/perspective-115p_1.jpg.otp \
+ templates/common/layout/perspective-115p_2.jpg.otp \
+ templates/common/layout/perspective-115p_3.jpg.otp \
+ templates/common/layout/perspective-115t_1.jpg.otp \
+ templates/common/layout/perspective-115t_2.jpg.otp \
+ templates/common/layout/perspective-115t_3.jpg.otp \
+ templates/common/layout/perspective-128_1.jpg.otp \
+ templates/common/layout/perspective-128_2.jpg.otp \
+ templates/common/layout/perspective-128_3.jpg.otp \
+ templates/common/layout/perspective-128p_1.jpg.otp \
+ templates/common/layout/perspective-128p_2.jpg.otp \
+ templates/common/layout/perspective-128p_3.jpg.otp \
+ templates/common/layout/perspective-128t_1.jpg.otp \
+ templates/common/layout/perspective-128t_2.jpg.otp \
+ templates/common/layout/perspective-128t_3.jpg.otp \
+ templates/common/layout/perspective-167_1.jpg.otp \
+ templates/common/layout/perspective-167_2.jpg.otp \
+ templates/common/layout/perspective-167_3.jpg.otp \
+ templates/common/layout/perspective-167p_1.jpg.otp \
+ templates/common/layout/perspective-167p_2.jpg.otp \
+ templates/common/layout/perspective-167p_3.jpg.otp \
+ templates/common/layout/perspective-167t_1.jpg.otp \
+ templates/common/layout/perspective-167t_2.jpg.otp \
+ templates/common/layout/perspective-167t_3.jpg.otp \
+ templates/common/layout/perspective-172_1.jpg.otp \
+ templates/common/layout/perspective-172_2.jpg.otp \
+ templates/common/layout/perspective-172_3.jpg.otp \
+ templates/common/layout/perspective-172p_1.jpg.otp \
+ templates/common/layout/perspective-172p_2.jpg.otp \
+ templates/common/layout/perspective-172p_3.jpg.otp \
+ templates/common/layout/perspective-172t_1.jpg.otp \
+ templates/common/layout/perspective-172t_2.jpg.otp \
+ templates/common/layout/perspective-172t_3.jpg.otp \
+ templates/common/layout/perspective-186_1.jpg.otp \
+ templates/common/layout/perspective-186_2.jpg.otp \
+ templates/common/layout/perspective-186_3.jpg.otp \
+ templates/common/layout/perspective-186p_1.jpg.otp \
+ templates/common/layout/perspective-186p_2.jpg.otp \
+ templates/common/layout/perspective-186p_3.jpg.otp \
+ templates/common/layout/perspective-186t_1.jpg.otp \
+ templates/common/layout/perspective-186t_2.jpg.otp \
+ templates/common/layout/perspective-186t_3.jpg.otp \
+ templates/common/layout/PhotoFrame.otp \
+ templates/common/layout/Plantillafiesta.otp \
+ templates/common/layout/Praesentation_Radial_Blau.otp \
+ templates/common/layout/Praesentation_Radial_Braun.otp \
+ templates/common/layout/Praesentation_Radial_Grau.otp \
+ templates/common/layout/Praesentation_Radial_Gruen.otp \
+ templates/common/layout/Praesentation_Radial_Magenta.otp \
+ templates/common/layout/Praesentation_Radial_Orange.otp \
+ templates/common/layout/Praesentation_Radial_Rot.otp \
+ templates/common/layout/Praesentation_Radial_SUN.otp \
+ templates/common/layout/Praesentation_Radial_Tuerkis.otp \
+ templates/common/layout/QuadratischBlau.otp \
+ templates/common/layout/QuadratischBraun.otp \
+ templates/common/layout/QuadratischGrau.otp \
+ templates/common/layout/QuadratischGruen.otp \
+ templates/common/layout/QuadratischMagenta.otp \
+ templates/common/layout/QuadratischOrange.otp \
+ templates/common/layout/QuadratischRot.otp \
+ templates/common/layout/QuadratischSUN.otp \
+ templates/common/layout/RedStar.otp \
+ templates/common/layout/reo-veo10.otp \
+ templates/common/layout/reo-veo11.otp \
+ templates/common/layout/reo-veo12.otp \
+ templates/common/layout/reo-veo1.otp \
+ templates/common/layout/reo-veo2.otp \
+ templates/common/layout/reo-veo3.otp \
+ templates/common/layout/reo-veo4.otp \
+ templates/common/layout/reo-veo5.otp \
+ templates/common/layout/reo-veo6.otp \
+ templates/common/layout/reo-veo7.otp \
+ templates/common/layout/reo-veo8.otp \
+ templates/common/layout/reo-veo9.otp \
+ templates/common/layout/schatten_blau.otp \
+ templates/common/layout/schatten_gelb.otp \
+ templates/common/layout/schatten_gruen.otp \
+ templates/common/layout/schatten_magenta.otp \
+ templates/common/layout/schatten_orange.otp \
+ templates/common/layout/schatten_rot.otp \
+ templates/common/layout/schatten_tuerkis.otp \
+ templates/common/layout/science-002a.jpg.otp \
+ templates/common/layout/science-002b.jpg.otp \
+ templates/common/layout/science-014a.jpg.otp \
+ templates/common/layout/science-014b.jpg.otp \
+ templates/common/layout/science-014c.jpg.otp \
+ templates/common/layout/science-014d.jpg.otp \
+ templates/common/layout/science-108a.jpg.otp \
+ templates/common/layout/science-108b.jpg.otp \
+ templates/common/layout/science-108c.jpg.otp \
+ templates/common/layout/science-108d.jpg.otp \
+ templates/common/layout/sedi.otp \
+ templates/common/layout/Sidepanel_Blue.otp \
+ templates/common/layout/Sidepanel_Cloud.otp \
+ templates/common/layout/Sidepanel_Green.otp \
+ templates/common/layout/Sidepanel_Red.otp \
+ templates/common/layout/Solar.otp \
+ templates/common/layout/Soleil.otp \
+ templates/common/layout/standard-blau-gelb.otp \
+ templates/common/layout/standard-dunkel.otp \
+ templates/common/layout/standard-rot-gruen.otp \
+ templates/common/layout/Sunburst.otp \
+ templates/common/layout/sun.otp \
+ templates/common/layout/texture-003_1.jpg.otp \
+ templates/common/layout/texture-003_2.jpg.otp \
+ templates/common/layout/texture-003_3.jpg.otp \
+ templates/common/layout/texture-003p_1.jpg.otp \
+ templates/common/layout/texture-003p_2.jpg.otp \
+ templates/common/layout/texture-003p_3.jpg.otp \
+ templates/common/layout/texture-003t_1.jpg.otp \
+ templates/common/layout/texture-003t_2.jpg.otp \
+ templates/common/layout/texture-003t_3.jpg.otp \
+ templates/common/layout/texture-004_1.jpg.otp \
+ templates/common/layout/texture-004_2.jpg.otp \
+ templates/common/layout/texture-004_3.jpg.otp \
+ templates/common/layout/texture-004p_1.jpg.otp \
+ templates/common/layout/texture-004p_2.jpg.otp \
+ templates/common/layout/texture-004p_3.jpg.otp \
+ templates/common/layout/texture-004t_1.jpg.otp \
+ templates/common/layout/texture-004t_2.jpg.otp \
+ templates/common/layout/texture-004t_3.jpg.otp \
+ templates/common/layout/texture-007_1.jpg.otp \
+ templates/common/layout/texture-007_2.jpg.otp \
+ templates/common/layout/texture-007_3.jpg.otp \
+ templates/common/layout/texture-007p_1.jpg.otp \
+ templates/common/layout/texture-007p_2.jpg.otp \
+ templates/common/layout/texture-007p_3.jpg.otp \
+ templates/common/layout/texture-007t_1.jpg.otp \
+ templates/common/layout/texture-007t_2.jpg.otp \
+ templates/common/layout/texture-007t_3.jpg.otp \
+ templates/common/layout/texture-045_1.jpg.otp \
+ templates/common/layout/texture-045_2.jpg.otp \
+ templates/common/layout/texture-045_3.jpg.otp \
+ templates/common/layout/texture-045p_1.jpg.otp \
+ templates/common/layout/texture-045p_2.jpg.otp \
+ templates/common/layout/texture-045p_3.jpg.otp \
+ templates/common/layout/texture-045t_1.jpg.otp \
+ templates/common/layout/texture-045t_2.jpg.otp \
+ templates/common/layout/texture-045t_3.jpg.otp \
+ templates/common/layout/texture-110_1.jpg.otp \
+ templates/common/layout/texture-110_2.jpg.otp \
+ templates/common/layout/texture-110_3.jpg.otp \
+ templates/common/layout/texture-110p_1.jpg.otp \
+ templates/common/layout/texture-110p_2.jpg.otp \
+ templates/common/layout/texture-110p_3.jpg.otp \
+ templates/common/layout/texture-110t_1.jpg.otp \
+ templates/common/layout/texture-110t_2.jpg.otp \
+ templates/common/layout/texture-110t_3.jpg.otp \
+ templates/common/layout/texture-158_1.jpg.otp \
+ templates/common/layout/texture-158_2.jpg.otp \
+ templates/common/layout/texture-158_3.jpg.otp \
+ templates/common/layout/texture-158p_1.jpg.otp \
+ templates/common/layout/texture-158p_2.jpg.otp \
+ templates/common/layout/texture-158p_3.jpg.otp \
+ templates/common/layout/texture-158t_1.jpg.otp \
+ templates/common/layout/texture-158t_2.jpg.otp \
+ templates/common/layout/texture-158t_3.jpg.otp \
+ templates/common/layout/texture-191_1.jpg.otp \
+ templates/common/layout/texture-191_2.jpg.otp \
+ templates/common/layout/texture-191_3.jpg.otp \
+ templates/common/layout/texture-191p_1.jpg.otp \
+ templates/common/layout/texture-191p_2.jpg.otp \
+ templates/common/layout/texture-191p_3.jpg.otp \
+ templates/common/layout/texture-191t_1.jpg.otp \
+ templates/common/layout/texture-191t_2.jpg.otp \
+ templates/common/layout/texture-191t_3.jpg.otp \
+ templates/common/layout/vortrag_gelb.otp \
+ templates/common/layout/vortrag_gruen.otp \
+ templates/common/layout/vortrag_rot.otp \
+ templates/common/layout/vortrag_schwarz.otp \
+ templates/common/layout/vortrag_weiss.otp \
+ templates/common/layout/Worldwide_-_Artisticblue.otp \
+ templates/common/layout/Worldwide_-_ArtisticbluePencil.otp \
+ templates/common/layout/Worldwide_-_Deluxegreen.otp \
+ templates/common/layout/Worldwide_-_Lightgray.otp \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonmisc,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonmisc,$(LIBO_SHARE_FOLDER)/template/common/misc,\
+ templates/common/misc/White_Notebook_Paper_legal.ott \
+ templates/common/misc/Yellow_Pad_Legal.ott \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonofficorr,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonofficorr,$(LIBO_SHARE_FOLDER)/template/common/officorr,\
+ templates/common/officorr/dummy_common_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonoffimisc,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonoffimisc,$(LIBO_SHARE_FOLDER)/template/common/offimisc,\
+ templates/common/offimisc/dummy_common_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonpersonal,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonpersonal,$(LIBO_SHARE_FOLDER)/template/common/personal,\
+ templates/common/personal/szivesoldal.otg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_accessoriestemplatescommonpresent,templates-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_accessoriestemplatescommonpresent,$(LIBO_SHARE_FOLDER)/template/common/presnt,\
+ templates/common/presnt/dummy_common_templates.txt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,accessories_extra_fonts,fonts-pack))
+
+$(eval $(call gb_ExternalPackage_use_unpacked,accessories_extra_fonts,fonts-pack))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,accessories_extra_fonts,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ decorative/BETSY2.ttf \
+ decorative/Berylibi.ttf \
+ decorative/Beryliub.ttf \
+ decorative/Beryliui.ttf \
+ decorative/Berylium.ttf \
+ decorative/CHOPS___.TTF \
+ decorative/DTPDingbats.ttf \
+ decorative/GenAI102.TTF \
+ decorative/GenAR102.TTF \
+ decorative/GenI102.TTF \
+ decorative/GenR102.TTF \
+ decorative/Justus-Bold.ttf \
+ decorative/Justus-Italic.ttf \
+ decorative/Justus-ItalicOldstyle.ttf \
+ decorative/Justus-Oldstyle.ttf \
+ decorative/Justus-Roman.ttf \
+ decorative/Justus-Versalitas.ttf \
+ decorative/MgOpenCanonicaBold.ttf \
+ decorative/MgOpenCanonicaBoldItalic.ttf \
+ decorative/MgOpenCanonicaItalic.ttf \
+ decorative/MgOpenCanonicaRegular.ttf \
+ decorative/NEUROPOL.ttf \
+ decorative/SAPPM___.ttf \
+ decorative/Tuffy.ttf \
+ decorative/Tuffy_Bold.ttf \
+ decorative/Tuffy_Bold_Italic.ttf \
+ decorative/Tuffy_Italic.ttf \
+ decorative/Verina_Sans_Bold.otf \
+ decorative/Verina_Sans_Bold_Oblique.otf \
+ decorative/Verina_Sans_Mono.otf \
+ decorative/Verina_Sans_Mono_Bold.otf \
+ decorative/Verina_Sans_Mono_Bold_Oblique.otf \
+ decorative/Verina_Sans_Mono_Oblique.otf \
+ decorative/Verina_Sans_Oblique.otf \
+ decorative/Verina_Sans_Roman.otf \
+ decorative/Verina_Serif.otf \
+ decorative/Verina_Serif_Bold.otf \
+ decorative/a010013l.ttf \
+ decorative/a010015l.ttf \
+ decorative/a010033l.ttf \
+ decorative/a010035l.ttf \
+ decorative/airmole.ttf \
+ decorative/airmolea.ttf \
+ decorative/airmoleq.ttf \
+ decorative/airmoles.ttf \
+ decorative/astronbi.ttf \
+ decorative/astronbo.ttf \
+ decorative/astronbv.ttf \
+ decorative/astronbw.ttf \
+ decorative/b018012l.ttf \
+ decorative/b018015l.ttf \
+ decorative/b018032l.ttf \
+ decorative/b018035l.ttf \
+ decorative/baveuse.ttf \
+ decorative/bluebold.ttf \
+ decorative/bluecond.ttf \
+ decorative/bluehigh.ttf \
+ decorative/bluehigl.ttf \
+ decorative/bullpen3.ttf \
+ decorative/bullpen_.ttf \
+ decorative/bullpeni.ttf \
+ decorative/c059013l.ttf \
+ decorative/c059016l.ttf \
+ decorative/c059033l.ttf \
+ decorative/c059036l.ttf \
+ decorative/colourba.ttf \
+ decorative/colourbb.ttf \
+ decorative/counters.ttf \
+ decorative/creditva.ttf \
+ decorative/creditvb.ttf \
+ decorative/creditvi.ttf \
+ decorative/creditvz.ttf \
+ decorative/d050000l.ttf \
+ decorative/edmundis.ttf \
+ decorative/edmunds.ttf \
+ decorative/engeboit.ttf \
+ decorative/engebold.ttf \
+ decorative/engeexbi.ttf \
+ decorative/engeexbo.ttf \
+ decorative/engeexit.ttf \
+ decorative/engeexpa.ttf \
+ decorative/engeital.ttf \
+ decorative/engeregu.ttf \
+ decorative/goodfisb.ttf \
+ decorative/goodfisc.ttf \
+ decorative/goodfish.ttf \
+ decorative/goodfisi.ttf \
+ decorative/guanine_.ttf \
+ decorative/gunplay.ttf \
+ decorative/kirsty__.ttf \
+ decorative/kirsty_b.ttf \
+ decorative/kirsty_i.ttf \
+ decorative/kirstybi.ttf \
+ decorative/kirstyin.ttf \
+ decorative/letstracebasic.ttf \
+ decorative/letstraceruled.ttf \
+ decorative/luximb.ttf \
+ decorative/luximbi.ttf \
+ decorative/luximr.ttf \
+ decorative/luximri.ttf \
+ decorative/luxirb.ttf \
+ decorative/luxirbi.ttf \
+ decorative/luxirr.ttf \
+ decorative/luxirri.ttf \
+ decorative/luxisb.ttf \
+ decorative/luxisbi.ttf \
+ decorative/luxisr.ttf \
+ decorative/luxisri.ttf \
+ decorative/mufferaw.ttf \
+ decorative/n019003l.ttf \
+ decorative/n019004l.ttf \
+ decorative/n019023l.ttf \
+ decorative/n019024l.ttf \
+ decorative/n019043l.ttf \
+ decorative/n019044l.ttf \
+ decorative/n019063l.ttf \
+ decorative/n019064l.ttf \
+ decorative/n021003l.ttf \
+ decorative/n021004l.ttf \
+ decorative/n021023l.ttf \
+ decorative/n021024l.ttf \
+ decorative/n022003l.ttf \
+ decorative/n022004l.ttf \
+ decorative/n022023l.ttf \
+ decorative/n022024l.ttf \
+ decorative/nasaliza.ttf \
+ decorative/numberpi.ttf \
+ decorative/p052003l.ttf \
+ decorative/p052004l.ttf \
+ decorative/p052023l.ttf \
+ decorative/p052024l.ttf \
+ decorative/pricedow.ttf \
+ decorative/pupcat__.ttf \
+ decorative/rina.ttf \
+ decorative/s050000l.ttf \
+ decorative/sandoval.ttf \
+ decorative/screenge.ttf \
+ decorative/steelfib.ttf \
+ decorative/steelfis.ttf \
+ decorative/steelout.ttf \
+ decorative/strenu3d.ttf \
+ decorative/strenuou.ttf \
+ decorative/subpear_.ttf \
+ decorative/teen____.ttf \
+ decorative/teenbdit.ttf \
+ decorative/teenbold.ttf \
+ decorative/teenital.ttf \
+ decorative/teenlita.ttf \
+ decorative/teenlite.ttf \
+ decorative/typoderm.ttf \
+ decorative/vahika_.ttf \
+ decorative/vahikab.ttf \
+ decorative/vahikac.ttf \
+ decorative/vahikai.ttf \
+ decorative/vectroid.ttf \
+ decorative/velvenda.ttf \
+ decorative/velvendc.ttf \
+ decorative/vibroceb.ttf \
+ decorative/vibrocei.ttf \
+ decorative/vibrocen.ttf \
+ decorative/vibrocex.ttf \
+ decorative/wintermu.ttf \
+ decorative/youregoi.ttf \
+ decorative/youregon.ttf \
+ decorative/z003034l.ttf \
+ decorative/zekton__.ttf \
+ decorative/zektonbi.ttf \
+ decorative/zektonbo.ttf \
+ decorative/zektonit.ttf \
+ decorative/zorque.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,accessories))
+
+ifneq ($(WITH_EXTRA_FONT),)
+$(eval $(call gb_Module_add_targets,accessories,\
+ ExternalPackage_extra_fonts \
+ UnpackedTarball_fonts_pack \
+))
+endif
+
+ifneq ($(WITH_EXTRA_GALLERY),)
+$(eval $(call gb_Module_add_targets,accessories,\
+ UnpackedTarball_gallery_pack \
+ ExternalPackage_accessoriesgallery \
+ ExternalPackage_accessoriesgallerydrawspeople \
+ ExternalPackage_accessoriesgalleryelementsbullets2 \
+ ExternalPackage_accessoriesgallerynonfree \
+ ExternalPackage_accessoriesgalleryphotosbuildings \
+ ExternalPackage_accessoriesgalleryphotoscelebration \
+ ExternalPackage_accessoriesgalleryphotoscities \
+ ExternalPackage_accessoriesgalleryphotosfauna \
+ ExternalPackage_accessoriesgalleryphotosflowers \
+ ExternalPackage_accessoriesgalleryphotosfoodsanddrinks \
+ ExternalPackage_accessoriesgalleryphotoshumans \
+ ExternalPackage_accessoriesgalleryphotoslandscapes \
+ ExternalPackage_accessoriesgalleryphotosobjects \
+ ExternalPackage_accessoriesgalleryphotosplants \
+ ExternalPackage_accessoriesgalleryphotosspace \
+ ExternalPackage_accessoriesgalleryphotosstatues \
+ ExternalPackage_accessoriesgalleryphotostravel \
+))
+endif
+
+ifneq ($(WITH_EXTRA_SAMPLE),)
+$(eval $(call gb_Module_add_l10n_targets,accessories,\
+ AllLangPackage_accessoriessamples \
+ AllLangPackage_accessoriessamplesadvertisement \
+ AllLangPackage_accessoriessamplesdocumentation \
+ AllLangPackage_accessoriessamplesnonfree \
+ AllLangPackage_accessoriessamplesnonfreeadvertisement \
+ AllLangPackage_accessoriessamplesnonfreedocumentation \
+))
+
+$(eval $(call gb_Module_add_targets,accessories,\
+ UnpackedTarball_samples_pack \
+))
+endif
+
+ifneq ($(WITH_EXTRA_TEMPLATE),)
+$(eval $(call gb_Module_add_l10n_targets,accessories,\
+ AllLangPackage_accessoriestemplates \
+ AllLangPackage_accessoriestemplateseducate \
+ AllLangPackage_accessoriestemplatesfinance \
+ AllLangPackage_accessoriestemplatesforms \
+ AllLangPackage_accessoriestemplateslabels \
+ AllLangPackage_accessoriestemplateslayout \
+ AllLangPackage_accessoriestemplatesmisc \
+ AllLangPackage_accessoriestemplatesnonfree \
+ AllLangPackage_accessoriestemplatesnonfreeeducate \
+ AllLangPackage_accessoriestemplatesnonfreefinance \
+ AllLangPackage_accessoriestemplatesnonfreeforms \
+ AllLangPackage_accessoriestemplatesnonfreelabels \
+ AllLangPackage_accessoriestemplatesnonfreelayout \
+ AllLangPackage_accessoriestemplatesnonfreemisc \
+ AllLangPackage_accessoriestemplatesnonfreeofficorr \
+ AllLangPackage_accessoriestemplatesnonfreeoffimisc \
+ AllLangPackage_accessoriestemplatesnonfreepersonal \
+ AllLangPackage_accessoriestemplatesnonfreepresent \
+ AllLangPackage_accessoriestemplatesofficorr \
+ AllLangPackage_accessoriestemplatesoffimisc \
+ AllLangPackage_accessoriestemplatespersonal \
+ AllLangPackage_accessoriestemplatespresent \
+))
+
+$(eval $(call gb_Module_add_targets,accessories,\
+ ExternalPackage_accessoriestemplatescommon \
+ ExternalPackage_accessoriestemplatescommoneducate \
+ ExternalPackage_accessoriestemplatescommonfinance \
+ ExternalPackage_accessoriestemplatescommonforms \
+ ExternalPackage_accessoriestemplatescommonlabels \
+ ExternalPackage_accessoriestemplatescommonlayout \
+ ExternalPackage_accessoriestemplatescommonmisc \
+ ExternalPackage_accessoriestemplatescommonofficorr \
+ ExternalPackage_accessoriestemplatescommonoffimisc \
+ ExternalPackage_accessoriestemplatescommonpersonal \
+ ExternalPackage_accessoriestemplatescommonpresent \
+ UnpackedTarball_templates_pack \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,fonts-pack))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,fonts-pack,$(OOOP_FONTS_PACK)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,gallery-pack))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,gallery-pack,$(OOOP_GALLERY_PACK)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,samples-pack))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,samples-pack,$(OOOP_SAMPLES_PACK)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,templates-pack))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,templates-pack,$(OOOP_TEMPLATES_PACK)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,apache_commons_logging,apache_commons_logging))
+
+$(eval $(call gb_ExternalPackage_use_external_project,apache_commons_logging,apache_commons_logging))
+
+$(eval $(call gb_ExternalPackage_add_file,apache_commons_logging,$(LIBO_SHARE_JAVA_FOLDER)/commons-logging-1.1.3.jar,target/commons-logging-1.1.3.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_codec))
+
+$(eval $(call gb_ExternalProject_register_targets,apache_commons_codec,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,apache_commons_codec,build) :
+ $(call gb_ExternalProject_run,build,\
+ ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_httpclient))
+
+$(eval $(call gb_ExternalProject_use_external,apache_commons_httpclient,commons-codec))
+$(eval $(call gb_ExternalProject_use_external,apache_commons_httpclient,commons-logging))
+
+$(eval $(call gb_ExternalProject_register_targets,apache_commons_httpclient,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,apache_commons_httpclient,build) :
+ $(call gb_ExternalProject_run,build,\
+ ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ -Dcommons-logging.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-1.1.3.jar" \
+ $(if $(filter TRUE,$(HAVE_JAVA6))\
+ ,-Dcommons-codec.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_codec)/dist/commons-codec-1.9.jar" \
+ ,-Dcommons-codec.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_codec)/dist/commons-codec-1.6-SNAPSHOT.jar" \
+ ) \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ dist \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_lang))
+
+$(eval $(call gb_ExternalProject_register_targets,apache_commons_lang,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,apache_commons_lang,build) :
+ $(call gb_ExternalProject_run,build,\
+ ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_logging))
+
+$(eval $(call gb_ExternalProject_register_targets,apache_commons_logging,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,apache_commons_logging,build) :
+ $(call gb_ExternalProject_run,build,\
+ ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ compile build-jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,apache-commons))
+
+$(eval $(call gb_Module_add_targets,apache-commons,\
+ ExternalPackage_apache_commons_logging \
+ ExternalProject_apache_commons_codec \
+ ExternalProject_apache_commons_httpclient \
+ ExternalProject_apache_commons_lang \
+ ExternalProject_apache_commons_logging \
+ UnpackedTarball_apache_commons_codec \
+ UnpackedTarball_apache_commons_httpclient \
+ UnpackedTarball_apache_commons_lang \
+ UnpackedTarball_apache_commons_logging \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Java libraries; used for logging and http/https access in Extensions, from [http://commons.apache.org/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_codec))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_codec,$(APACHE_COMMONS_CODEC_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,apache_commons_codec,3))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,apache_commons_codec,\
+ build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_codec,\
+ external/apache-commons/patches/codec.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_httpclient))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_httpclient,$(APACHE_COMMONS_HTTPCLIENT_TARBALL),,apache-commons))
+
+$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_httpclient,\
+ external/apache-commons/patches/httpclient.patch \
+ external/apache-commons/patches/httpclient_no_javadoc.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_lang))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_lang,$(APACHE_COMMONS_LANG_TARBALL),,apache-commons))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_logging))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_logging,$(APACHE_COMMONS_LOGGING_TARBALL),,apache-commons))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,apache_commons_logging,\
+ build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_logging,\
+ external/apache-commons/patches/logging.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/commons-codec-1.6-src/build.xml-old 2012-05-05 22:12:32.000000000 -0500
++++ misc/build/commons-codec-1.6-src/build.xml 2012-05-05 22:16:00.000000000 -0500
+@@ -96,7 +96,6 @@
+ </target>
+ <target name="dist" depends="compile, javadoc" description="Create binary distribution">
+ <mkdir dir="${dist.home}"/>
+- <copy file="${basedir}/LICENSE.txt" todir="${dist.home}"/>
+ <copy file="${basedir}/NOTICE.txt" todir="${dist.home}"/>
+ <copy file="${basedir}/RELEASE-NOTES.txt" todir="${dist.home}"/>
+ <antcall target="jar"/>
+@@ -104,8 +103,7 @@
+ <target name="jar" depends="compile" description="Create jar">
+ <mkdir dir="${dist.home}"/>
+ <mkdir dir="${build.home}/classes/META-INF"/>
+- <copy file="${basedir}/LICENSE.txt" tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
+- <copy file="${basedir}/LICENSE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
++ <copy file="${basedir}/NOTICE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
+ <jar jarfile="${dist.home}/${final.name}.jar" basedir="${build.home}/classes">
+ <manifest>
+ <attribute name="Specification-Title" value="Commons Codec"/>
--- /dev/null
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/ConnectMethod.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/ConnectMethod.java 2012-05-07 12:37:50.000000000 -0500
+@@ -38,7 +38,7 @@
+ /**
+ * Establishes a tunneled HTTP connection via the CONNECT method.
+ *
+- * @author Ortwin Gl???ck
++ * @author Ortwin Glueck
+ * @author dIon Gillard
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+ * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java 2012-05-07 12:37:50.000000000 -0500
+@@ -48,7 +48,7 @@
+ * @author <a href="mailto:rwaldhoff@apache.org">Rodney Waldhoff</a>
+ * @author Sean C. Sullivan
+ * @author <a href="mailto:dion@apache.org">dIon Gillard</a>
+- * @author Ortwin Gl?ck
++ * @author Ortwin Glueck
+ * @author <a href="mailto:becke@u.washington.edu">Michael Becke</a>
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+ * @author Sam Maloney
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java 2012-05-07 12:37:50.000000000 -0500
+@@ -33,7 +33,7 @@
+ /**
+ * Signals that an error has occurred.
+ *
+- * @author Ortwin Gl?ck
++ * @author Ortwin Glueck
+ * @version $Revision: 480424 $ $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $
+ * @since 3.0
+ */
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java 2012-05-07 12:37:50.000000000 -0500
+@@ -3,7 +3,7 @@
+ /**
+ * Signals that the response content was larger than anticipated.
+ *
+- * @author Ortwin Glück
++ * @author Ortwin Glueck
+ */
+ public class HttpContentTooLargeException extends HttpException {
+ private int maxlen;
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java 2012-05-07 12:37:50.000000000 -0500
+@@ -37,7 +37,7 @@
+ /**
+ * Logs all data read to the wire LOG.
+ *
+- * @author Ortwin Gl�ck
++ * @author Ortwin Glueck
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+ * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
+ *
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java 2012-05-07 12:37:50.000000000 -0500
+@@ -46,7 +46,7 @@
+ * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ * @author Rodney Waldhoff
+ * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
+- * @author Ortwin Gl?ck
++ * @author Ortwin Glueck
+ * @author Sean C. Sullivan
+ * @author <a href="mailto:adrian@ephox.com">Adrian Sutton</a>
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java 2012-05-07 12:37:50.000000000 -0500
+@@ -67,7 +67,7 @@
+ * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ * @author Rodney Waldhoff
+ * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
+- * @author Ortwin Gl?ck
++ * @author Ortwin Glueck
+ * @author Sean C. Sullivan
+ * @author <a href="mailto:adrian@ephox.com">Adrian Sutton</a>
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java 2012-05-07 12:37:50.000000000 -0500
+@@ -62,7 +62,7 @@
+ * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ * @author Rodney Waldhoff
+ * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
+- * @author Ortwin Gl�ck
++ * @author Ortwin Glueck
+ * @author Sean C. Sullivan
+ * @author <a href="mailto:adrian@ephox.com">Adrian Sutton</a>
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java 2012-05-07 12:37:50.000000000 -0500
+@@ -43,7 +43,7 @@
+ * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ * @author Rodney Waldhoff
+ * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
+- * @author Ortwin Gl???ck
++ * @author Ortwin Glueck
+ * @author Sean C. Sullivan
+ * @author <a href="mailto:adrian@ephox.com">Adrian Sutton</a>
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java
+--- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java 2012-05-07 12:34:01.000000000 -0500
++++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java 2012-05-07 12:37:50.000000000 -0500
+@@ -62,7 +62,7 @@
+ * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ * @author <a href="mailto:dsale@us.britannica.com">Doug Sale</a>
+ * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
+- * @author Ortwin Gl???ck
++ * @author Ortwin Glueck
+ * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
+ * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
+ *
--- /dev/null
+--- misc/commons-httpclient-3.1/build.xml 2007-08-18 11:02:14.000000000 +0200
++++ misc/build/commons-httpclient-3.1/build.xml 2012-07-09 09:59:21.364830700 +0200
+@@ -142,7 +142,7 @@
+
+ <!-- ========== Targets: "External" Targets =============================== -->
+
+- <target name="dist" depends="compile,doc"
++ <target name="dist" depends="compile"
+ description="Create binary distribution">
+ <mkdir dir="${dist.home}"/>
+ <copy file="LICENSE.txt" todir="${dist.home}"/>
--- /dev/null
+--- misc/commons-logging-1.1.1-src/build.xml 2007-11-22 00:27:52.000000000 +0100
++++ misc/build/commons-logging-1.1.1-src/build.xml 2008-06-24 14:23:56.316301736 +0200
+@@ -127,10 +127,10 @@
+ <!-- ========== Compiler Defaults ========================================= -->
+
+ <!-- Version of java class files to generate. -->
+- <property name="target.version" value="1.1"/>
++ <property name="target.version" value="1.5"/>
+
+ <!-- Version of java source to accept -->
+- <property name="source.version" value="1.2"/>
++ <property name="source.version" value="1.3"/>
+
+ <!-- Should Java compilations set the 'debug' compiler option? -->
+ <property name="compile.debug" value="true"/>
+@@ -280,6 +280,10 @@
+ classpathref="compile.classpath"
+ classname="org.apache.avalon.framework.logger.Logger"/>
+
++ <available property="servlet-api.present"
++ classpathref="compile.classpath"
++ classname="javax.servlet.ServletContextListener"/>
++
+ <available file="${log4j12.jar}" property="log4j12.present"/>
+ <available file="${log4j13.jar}" property="log4j13.present"/>
+ <available file="${build.home}/docs" property="maven.generated.docs.present"/>
+@@ -370,6 +374,8 @@
+ unless="logkit.present"/>
+ <exclude name="org/apache/commons/logging/impl/AvalonLogger.java"
+ unless="avalon-framework.present"/>
++ <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"
++ unless="servlet-api.present"/>
+ </javac>
+ </target>
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,apr))
+
+$(eval $(call gb_ExternalProject_register_targets,apr,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_nmake,apr,build))
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,apr,build):
+ $(call gb_ExternalProject_run,build,\
+ nmake -nologo -f apr.mak \
+ CFG="apr - Win32 $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)" \
+ RECURSE=0 \
+ )
+
+else
+$(call gb_ExternalProject_get_state_target,apr,build):
+ +$(call gb_ExternalProject_run,build,\
+ ./configure \
+ --enable-static --disable-shared \
+ --with-pic \
+ $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
+ && $(MAKE) libapr-1.la \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,apr_util))
+
+$(eval $(call gb_ExternalProject_use_external_project,apr_util,apr))
+
+$(eval $(call gb_ExternalProject_register_targets,apr_util,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_nmake,apr_util,build))
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,apr_util,build):
+ $(call gb_ExternalProject_run,build,\
+ nmake -nologo -f aprutil.mak \
+ CFG="aprutil - Win32 $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)" \
+ RECURSE=0 \
+ )
+
+else
+$(call gb_ExternalProject_get_state_target,apr_util,build):
+ +$(call gb_ExternalProject_run,build,\
+ ./configure \
+ --enable-static --disable-shared \
+ --with-pic \
+ $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
+ --with-apr=$(call gb_UnpackedTarball_get_dir,apr)/apr-1-config \
+ && $(MAKE) libaprutil-1.la \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,apr))
+
+$(eval $(call gb_Module_add_targets,apr,\
+ UnpackedTarball_apr \
+ UnpackedTarball_apr_util \
+ ExternalProject_apr \
+ ExternalProject_apr_util \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+The mission of the Apache Portable Runtime (APR) project is to create
+and maintain software libraries that provide a predictable and consistent
+interface to underlying platform-specific implementations.
+
+From [http://apr.apache.org/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,apr))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,apr,$(APR_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,apr_util))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,apr_util,$(APR_UTIL_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,apr_util,\
+ aprutil.mak \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,apr_util,\
+ external/apr/windows.build.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff -ur apr_util.org/aprutil.mak apr_util/aprutil.mak
+--- apr_util.org/aprutil.mak 2014-03-05 16:40:02.385701779 +0100
++++ apr_util/aprutil.mak 2014-03-05 16:40:49.409702332 +0100
+@@ -210,8 +210,6 @@
+ "$(INTDIR)\apr_uri.obj" \
+ "$(INTDIR)\xlate.obj" \
+ "$(INTDIR)\apr_xml.obj" \
+- "..\apr-iconv\LibR\apriconv-1.lib" \
+- ".\xml\expat\lib\LibR\xml.lib"
+
+ "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+@@ -406,8 +404,6 @@
+ "$(INTDIR)\apr_uri.obj" \
+ "$(INTDIR)\xlate.obj" \
+ "$(INTDIR)\apr_xml.obj" \
+- "..\apr-iconv\LibD\apriconv-1.lib" \
+- ".\xml\expat\lib\LibD\xml.lib"
+
+ "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+@@ -602,8 +598,6 @@
+ "$(INTDIR)\apr_uri.obj" \
+ "$(INTDIR)\xlate.obj" \
+ "$(INTDIR)\apr_xml.obj" \
+- "..\apr-iconv\x64\LibR\apriconv-1.lib" \
+- ".\xml\expat\lib\x64\LibR\xml.lib"
+
+ "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+@@ -798,8 +792,6 @@
+ "$(INTDIR)\apr_uri.obj" \
+ "$(INTDIR)\xlate.obj" \
+ "$(INTDIR)\apr_xml.obj" \
+- "..\apr-iconv\x64\LibD\apriconv-1.lib" \
+- ".\xml\expat\lib\x64\LibD\xml.lib"
+
+ "$(OUTDIR)\aprutil-1.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+diff -ur apr_util.org/include/apu.hw apr_util/include/apu.hw
+--- apr_util.org/include/apu.hw 2014-03-05 16:40:02.377701779 +0100
++++ apr_util/include/apu.hw 2014-03-05 16:40:38.769702207 +0100
+@@ -138,8 +138,8 @@
+ #define APU_HAVE_NSS 0
+ #endif
+
+-#define APU_HAVE_APR_ICONV 1
+-#define APU_HAVE_ICONV 0
++#undef APU_HAVE_APR_ICONV
++#undef APU_HAVE_ICONV
+ #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
+
+ #endif /* APU_H */
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,beanshell,beanshell))
+
+$(eval $(call gb_ExternalPackage_use_external_project,beanshell,beanshell))
+
+$(eval $(call gb_ExternalPackage_add_file,beanshell,$(LIBO_SHARE_JAVA_FOLDER)/bsh.jar,dist/bsh-2.0b1.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,beanshell))
+
+$(eval $(call gb_ExternalProject_register_targets,beanshell,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,beanshell,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,beanshell))
+
+$(eval $(call gb_Module_add_targets,beanshell,\
+ ExternalPackage_beanshell \
+ ExternalProject_beanshell \
+ UnpackedTarball_beanshell \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Java interpreter from [http://www.beanshell.org/] with some patches.
+
+So you can write java in command shell; interactive java good for prototyping/macros.
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,beanshell))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,beanshell,$(BSH_TARBALL),,beanshell))
+
+$(eval $(call gb_UnpackedTarball_add_patches,beanshell,\
+ external/beanshell/bsh-2.0b1-src.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/BeanShell/build.xml Fri Dec 19 17:14:27 2003
++++ misc/build/BeanShell/build.xml Fri Mar 28 15:55:04 2008
+@@ -17,7 +17,7 @@
+ up the build dir! It has to be done manually the first time (or put
+ in the jar file). There must be a way to fix this...
+ -->
+-<project name="beanshell" default="compile" basedir=".">
++<project name="beanshell" default="jarall" basedir=".">
+
+ <!-- Project Configuration -->
+
+@@ -71,6 +71,9 @@
+ value="bsh/util/BeanShellBSFEngine.java,TestBshBSF.java"/>
+ -->
+
++ <property name="exclude-bsf"
++ value="bsh/util/BeanShellBSFEngine.java,TestBshBSF.java"/>
++
+ <!-- Uncomment to build without the ASM class generator code.
+ <property name="exclude-classgen"
+ value="bsh/org/objectweb/asm/**,bsh/ClassGeneratorImpl.java,bsh/ClassGeneratorUtil.java,bsh/DelayedEvalBshMethod.java"/>
+@@ -80,6 +83,9 @@
+ <property name="exclude-servlet"
+ value="bsh/servlet/*"/>
+ -->
++
++ <property name="exclude-servlet"
++ value="bsh/servlet/*"/>
+
+ <!-- Legacy excludes. Comment this *out* to build these legacy items -->
+ <property name="legacy-excludes"
+--- misc/BeanShell/src/bsh/ClassGeneratorUtil.java Fri Dec 19 17:14:28 2003
++++ misc/build/BeanShell/src/bsh/ClassGeneratorUtil.java Fri Mar 28 15:55:05 2008
+@@ -34,7 +34,9 @@
+ package bsh;
+
+ import bsh.org.objectweb.asm.*;
+-import java.lang.reflect.*;
++import java.lang.reflect.Constructor;
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
+ import java.util.ArrayList;
+ import java.util.List;
+
--- /dev/null
+Cleaned linux bluez headers.
+
+Originally gotten from:
+http://gitorious.org/0xdroid/system_bluetooth/trees/59ca0be6dc8ef3f30f8f863d8fb805a55bf12fe5/bluez-clean-headers
--- /dev/null
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Bluez header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to Android. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __BLUETOOTH_H
+#define __BLUETOOTH_H
+
+#ifdef __cplusplus
+#endif
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <endian.h>
+#include <byteswap.h>
+#ifndef AF_BLUETOOTH
+#define AF_BLUETOOTH 31
+#define PF_BLUETOOTH AF_BLUETOOTH
+#endif
+#ifndef SOL_BLUETOOTH
+#define SOL_BLUETOOTH 274
+#endif
+#define BTPROTO_L2CAP 0
+#define BTPROTO_HCI 1
+#define BTPROTO_SCO 2
+#define BTPROTO_RFCOMM 3
+#define BTPROTO_BNEP 4
+#define BTPROTO_CMTP 5
+#define BTPROTO_HIDP 6
+#define BTPROTO_AVDTP 7
+#define SOL_HCI 0
+#define SOL_L2CAP 6
+#define SOL_SCO 17
+#define SOL_RFCOMM 18
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define htobs(d) (d)
+#define htobl(d) (d)
+#define btohs(d) (d)
+#define btohl(d) (d)
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define htobs(d) bswap_16(d)
+#define htobl(d) bswap_32(d)
+#define btohs(d) bswap_16(d)
+#define btohl(d) bswap_32(d)
+#else
+#error "Unknown byte order"
+#endif
+#define bt_get_unaligned(ptr) ({ struct __attribute__((packed)) { typeof(*(ptr)) __v; } *__p = (void *) (ptr); __p->__v; })
+#define bt_put_unaligned(val, ptr) do { struct __attribute__((packed)) { typeof(*(ptr)) __v; } *__p = (void *) (ptr); __p->__v = (val); } while(0)
+#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
+#define BDADDR_ALL (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}})
+#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
+#ifdef __cplusplus
+#endif
+typedef struct
+{
+ uint8_t b[6];
+} __attribute__ ((packed)) bdaddr_t;
+static inline void
+bacpy (bdaddr_t * dst, const bdaddr_t * src)
+{
+ memcpy (dst, src, sizeof (bdaddr_t));
+}
+#endif
--- /dev/null
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Bluez header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to Android. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __HCI_H
+#define __HCI_H
+
+#ifdef __cplusplus
+#endif
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#define HCI_MAX_DEV 16
+#define HCI_MAX_ACL_SIZE 1024
+#define HCI_MAX_SCO_SIZE 255
+#define HCI_MAX_EVENT_SIZE 260
+#define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
+#define HCI_DEV_REG 1
+#define HCI_DEV_UNREG 2
+#define HCI_DEV_UP 3
+#define HCI_DEV_DOWN 4
+#define HCI_DEV_SUSPEND 5
+#define HCI_DEV_RESUME 6
+#define HCI_VIRTUAL 0
+#define HCI_USB 1
+#define HCI_PCCARD 2
+#define HCI_UART 3
+#define HCI_RS232 4
+#define HCI_PCI 5
+#define HCI_SDIO 6
+#define HCIDEVUP _IOW('H', 201, int)
+#define HCIDEVDOWN _IOW('H', 202, int)
+#define HCIDEVRESET _IOW('H', 203, int)
+#define HCIDEVRESTAT _IOW('H', 204, int)
+#define HCIGETDEVLIST _IOR('H', 210, int)
+#define HCIGETDEVINFO _IOR('H', 211, int)
+#define HCIGETCONNLIST _IOR('H', 212, int)
+#define HCIGETCONNINFO _IOR('H', 213, int)
+#define HCIGETAUTHINFO _IOR('H', 215, int)
+#define HCISETRAW _IOW('H', 220, int)
+#define HCISETSCAN _IOW('H', 221, int)
+#define HCISETAUTH _IOW('H', 222, int)
+#define HCISETENCRYPT _IOW('H', 223, int)
+#define HCISETPTYPE _IOW('H', 224, int)
+#define HCISETLINKPOL _IOW('H', 225, int)
+#define HCISETLINKMODE _IOW('H', 226, int)
+#define HCISETACLMTU _IOW('H', 227, int)
+#define HCISETSCOMTU _IOW('H', 228, int)
+#define HCISETSECMGR _IOW('H', 230, int)
+#define HCIINQUIRY _IOR('H', 240, int)
+#ifndef __NO_HCI_DEFS
+#define HCI_COMMAND_PKT 0x01
+#define HCI_ACLDATA_PKT 0x02
+#define HCI_SCODATA_PKT 0x03
+#define HCI_EVENT_PKT 0x04
+#define HCI_VENDOR_PKT 0xff
+#define HCI_2DH1 0x0002
+#define HCI_3DH1 0x0004
+#define HCI_DM1 0x0008
+#define HCI_DH1 0x0010
+#define HCI_2DH3 0x0100
+#define HCI_3DH3 0x0200
+#define HCI_DM3 0x0400
+#define HCI_DH3 0x0800
+#define HCI_2DH5 0x1000
+#define HCI_3DH5 0x2000
+#define HCI_DM5 0x4000
+#define HCI_DH5 0x8000
+#define HCI_HV1 0x0020
+#define HCI_HV2 0x0040
+#define HCI_HV3 0x0080
+#define HCI_EV3 0x0008
+#define HCI_EV4 0x0010
+#define HCI_EV5 0x0020
+#define HCI_2EV3 0x0040
+#define HCI_3EV3 0x0080
+#define HCI_2EV5 0x0100
+#define HCI_3EV5 0x0200
+#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
+#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DH5)
+#define ESCO_HV1 0x0001
+#define ESCO_HV2 0x0002
+#define ESCO_HV3 0x0004
+#define ESCO_EV3 0x0008
+#define ESCO_EV4 0x0010
+#define ESCO_EV5 0x0020
+#define ESCO_2EV3 0x0040
+#define ESCO_3EV3 0x0080
+#define ESCO_2EV5 0x0100
+#define ESCO_3EV5 0x0200
+#define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
+#define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
+#define ALL_ESCO_MASK (SCO_ESCO_MASK | ESCO_EV3 | ESCO_EV4 | ESCO_EV5 | EDR_ESCO_MASK)
+#define HCI_UNKNOWN_COMMAND 0x01
+#define HCI_NO_CONNECTION 0x02
+#define HCI_HARDWARE_FAILURE 0x03
+#define HCI_PAGE_TIMEOUT 0x04
+#define HCI_AUTHENTICATION_FAILURE 0x05
+#define HCI_PIN_OR_KEY_MISSING 0x06
+#define HCI_MEMORY_FULL 0x07
+#define HCI_CONNECTION_TIMEOUT 0x08
+#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09
+#define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a
+#define HCI_ACL_CONNECTION_EXISTS 0x0b
+#define HCI_COMMAND_DISALLOWED 0x0c
+#define HCI_REJECTED_LIMITED_RESOURCES 0x0d
+#define HCI_REJECTED_SECURITY 0x0e
+#define HCI_REJECTED_PERSONAL 0x0f
+#define HCI_HOST_TIMEOUT 0x10
+#define HCI_UNSUPPORTED_FEATURE 0x11
+#define HCI_INVALID_PARAMETERS 0x12
+#define HCI_OE_USER_ENDED_CONNECTION 0x13
+#define HCI_OE_LOW_RESOURCES 0x14
+#define HCI_OE_POWER_OFF 0x15
+#define HCI_CONNECTION_TERMINATED 0x16
+#define HCI_REPEATED_ATTEMPTS 0x17
+#define HCI_PAIRING_NOT_ALLOWED 0x18
+#define HCI_UNKNOWN_LMP_PDU 0x19
+#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a
+#define HCI_SCO_OFFSET_REJECTED 0x1b
+#define HCI_SCO_INTERVAL_REJECTED 0x1c
+#define HCI_AIR_MODE_REJECTED 0x1d
+#define HCI_INVALID_LMP_PARAMETERS 0x1e
+#define HCI_UNSPECIFIED_ERROR 0x1f
+#define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20
+#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21
+#define HCI_LMP_RESPONSE_TIMEOUT 0x22
+#define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23
+#define HCI_LMP_PDU_NOT_ALLOWED 0x24
+#define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25
+#define HCI_UNIT_LINK_KEY_USED 0x26
+#define HCI_QOS_NOT_SUPPORTED 0x27
+#define HCI_INSTANT_PASSED 0x28
+#define HCI_PAIRING_NOT_SUPPORTED 0x29
+#define HCI_TRANSACTION_COLLISION 0x2a
+#define HCI_QOS_UNACCEPTABLE_PARAMETER 0x2c
+#define HCI_QOS_REJECTED 0x2d
+#define HCI_CLASSIFICATION_NOT_SUPPORTED 0x2e
+#define HCI_INSUFFICIENT_SECURITY 0x2f
+#define HCI_PARAMETER_OUT_OF_RANGE 0x30
+#define HCI_ROLE_SWITCH_PENDING 0x32
+#define HCI_SLOT_VIOLATION 0x34
+#define HCI_ROLE_SWITCH_FAILED 0x35
+#define HCI_EIR_TOO_LARGE 0x36
+#define HCI_SIMPLE_PAIRING_NOT_SUPPORTED 0x37
+#define HCI_HOST_BUSY_PAIRING 0x38
+#define ACL_CONT 0x01
+#define ACL_START 0x02
+#define ACL_ACTIVE_BCAST 0x04
+#define ACL_PICO_BCAST 0x08
+#define SCO_LINK 0x00
+#define ACL_LINK 0x01
+#define ESCO_LINK 0x02
+#define LMP_3SLOT 0x01
+#define LMP_5SLOT 0x02
+#define LMP_ENCRYPT 0x04
+#define LMP_SOFFSET 0x08
+#define LMP_TACCURACY 0x10
+#define LMP_RSWITCH 0x20
+#define LMP_HOLD 0x40
+#define LMP_SNIFF 0x80
+#define LMP_PARK 0x01
+#define LMP_RSSI 0x02
+#define LMP_QUALITY 0x04
+#define LMP_SCO 0x08
+#define LMP_HV2 0x10
+#define LMP_HV3 0x20
+#define LMP_ULAW 0x40
+#define LMP_ALAW 0x80
+#define LMP_CVSD 0x01
+#define LMP_PSCHEME 0x02
+#define LMP_PCONTROL 0x04
+#define LMP_TRSP_SCO 0x08
+#define LMP_BCAST_ENC 0x80
+#define LMP_EDR_ACL_2M 0x02
+#define LMP_EDR_ACL_3M 0x04
+#define LMP_ENH_ISCAN 0x08
+#define LMP_ILACE_ISCAN 0x10
+#define LMP_ILACE_PSCAN 0x20
+#define LMP_RSSI_INQ 0x40
+#define LMP_ESCO 0x80
+#define LMP_EV4 0x01
+#define LMP_EV5 0x02
+#define LMP_AFH_CAP_SLV 0x08
+#define LMP_AFH_CLS_SLV 0x10
+#define LMP_EDR_3SLOT 0x80
+#define LMP_EDR_5SLOT 0x01
+#define LMP_SNIFF_SUBR 0x02
+#define LMP_PAUSE_ENC 0x04
+#define LMP_AFH_CAP_MST 0x08
+#define LMP_AFH_CLS_MST 0x10
+#define LMP_EDR_ESCO_2M 0x20
+#define LMP_EDR_ESCO_3M 0x40
+#define LMP_EDR_3S_ESCO 0x80
+#define LMP_EXT_INQ 0x01
+#define LMP_SIMPLE_PAIR 0x08
+#define LMP_ENCAPS_PDU 0x10
+#define LMP_ERR_DAT_REP 0x20
+#define LMP_NFLUSH_PKTS 0x40
+#define LMP_LSTO 0x01
+#define LMP_INQ_TX_PWR 0x02
+#define LMP_EXT_FEAT 0x80
+#define HCI_LP_RSWITCH 0x0001
+#define HCI_LP_HOLD 0x0002
+#define HCI_LP_SNIFF 0x0004
+#define HCI_LP_PARK 0x0008
+#define HCI_LM_ACCEPT 0x8000
+#define HCI_LM_MASTER 0x0001
+#define HCI_LM_AUTH 0x0002
+#define HCI_LM_ENCRYPT 0x0004
+#define HCI_LM_TRUSTED 0x0008
+#define HCI_LM_RELIABLE 0x0010
+#define HCI_LM_SECURE 0x0020
+#define OGF_LINK_CTL 0x01
+#define OCF_INQUIRY 0x0001
+#define INQUIRY_CP_SIZE 5
+#define STATUS_BDADDR_RP_SIZE 7
+#define OCF_INQUIRY_CANCEL 0x0002
+#define OCF_PERIODIC_INQUIRY 0x0003
+#define PERIODIC_INQUIRY_CP_SIZE 9
+#define OCF_EXIT_PERIODIC_INQUIRY 0x0004
+#define OCF_CREATE_CONN 0x0005
+#define CREATE_CONN_CP_SIZE 13
+#define OCF_DISCONNECT 0x0006
+#define DISCONNECT_CP_SIZE 3
+#define OCF_ADD_SCO 0x0007
+#define ADD_SCO_CP_SIZE 4
+#define OCF_CREATE_CONN_CANCEL 0x0008
+#define CREATE_CONN_CANCEL_CP_SIZE 6
+#define OCF_ACCEPT_CONN_REQ 0x0009
+#define ACCEPT_CONN_REQ_CP_SIZE 7
+#define OCF_REJECT_CONN_REQ 0x000A
+#define REJECT_CONN_REQ_CP_SIZE 7
+#define OCF_LINK_KEY_REPLY 0x000B
+#define LINK_KEY_REPLY_CP_SIZE 22
+#define OCF_LINK_KEY_NEG_REPLY 0x000C
+#define OCF_PIN_CODE_REPLY 0x000D
+#define PIN_CODE_REPLY_CP_SIZE 23
+#define OCF_PIN_CODE_NEG_REPLY 0x000E
+#define OCF_SET_CONN_PTYPE 0x000F
+#define SET_CONN_PTYPE_CP_SIZE 4
+#define OCF_AUTH_REQUESTED 0x0011
+#define AUTH_REQUESTED_CP_SIZE 2
+#define OCF_SET_CONN_ENCRYPT 0x0013
+#define SET_CONN_ENCRYPT_CP_SIZE 3
+#define OCF_CHANGE_CONN_LINK_KEY 0x0015
+#define CHANGE_CONN_LINK_KEY_CP_SIZE 2
+#define OCF_MASTER_LINK_KEY 0x0017
+#define MASTER_LINK_KEY_CP_SIZE 1
+#define OCF_REMOTE_NAME_REQ 0x0019
+#define REMOTE_NAME_REQ_CP_SIZE 10
+#define OCF_REMOTE_NAME_REQ_CANCEL 0x001A
+#define REMOTE_NAME_REQ_CANCEL_CP_SIZE 6
+#define OCF_READ_REMOTE_FEATURES 0x001B
+#define READ_REMOTE_FEATURES_CP_SIZE 2
+#define OCF_READ_REMOTE_EXT_FEATURES 0x001C
+#define READ_REMOTE_EXT_FEATURES_CP_SIZE 3
+#define OCF_READ_REMOTE_VERSION 0x001D
+#define READ_REMOTE_VERSION_CP_SIZE 2
+#define OCF_READ_CLOCK_OFFSET 0x001F
+#define READ_CLOCK_OFFSET_CP_SIZE 2
+#define OCF_READ_LMP_HANDLE 0x0020
+#define OCF_SETUP_SYNC_CONN 0x0028
+#define SETUP_SYNC_CONN_CP_SIZE 17
+#define OCF_ACCEPT_SYNC_CONN_REQ 0x0029
+#define ACCEPT_SYNC_CONN_REQ_CP_SIZE 21
+#define OCF_REJECT_SYNC_CONN_REQ 0x002A
+#define REJECT_SYNC_CONN_REQ_CP_SIZE 7
+#define OCF_IO_CAPABILITY_REPLY 0x002B
+#define IO_CAPABILITY_REPLY_CP_SIZE 9
+#define OCF_USER_CONFIRM_REPLY 0x002C
+#define USER_CONFIRM_REPLY_CP_SIZE 6
+#define OCF_USER_CONFIRM_NEG_REPLY 0x002D
+#define OCF_USER_PASSKEY_REPLY 0x002E
+#define USER_PASSKEY_REPLY_CP_SIZE 10
+#define OCF_USER_PASSKEY_NEG_REPLY 0x002F
+#define OCF_REMOTE_OOB_DATA_REPLY 0x0030
+#define REMOTE_OOB_DATA_REPLY_CP_SIZE 38
+#define OCF_REMOTE_OOB_DATA_NEG_REPLY 0x0033
+#define OCF_IO_CAPABILITY_NEG_REPLY 0x0034
+#define IO_CAPABILITY_NEG_REPLY_CP_SIZE 7
+#define OGF_LINK_POLICY 0x02
+#define OCF_HOLD_MODE 0x0001
+#define HOLD_MODE_CP_SIZE 6
+#define OCF_SNIFF_MODE 0x0003
+#define SNIFF_MODE_CP_SIZE 10
+#define OCF_EXIT_SNIFF_MODE 0x0004
+#define EXIT_SNIFF_MODE_CP_SIZE 2
+#define OCF_PARK_MODE 0x0005
+#define PARK_MODE_CP_SIZE 6
+#define OCF_EXIT_PARK_MODE 0x0006
+#define EXIT_PARK_MODE_CP_SIZE 2
+#define OCF_QOS_SETUP 0x0007
+#define HCI_QOS_CP_SIZE 17
+#define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE)
+#define OCF_ROLE_DISCOVERY 0x0009
+#define ROLE_DISCOVERY_CP_SIZE 2
+#define ROLE_DISCOVERY_RP_SIZE 4
+#define OCF_SWITCH_ROLE 0x000B
+#define SWITCH_ROLE_CP_SIZE 7
+#define OCF_READ_LINK_POLICY 0x000C
+#define READ_LINK_POLICY_CP_SIZE 2
+#define READ_LINK_POLICY_RP_SIZE 5
+#define OCF_WRITE_LINK_POLICY 0x000D
+#define WRITE_LINK_POLICY_CP_SIZE 4
+#define WRITE_LINK_POLICY_RP_SIZE 3
+#define OCF_READ_DEFAULT_LINK_POLICY 0x000E
+#define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F
+#define OCF_FLOW_SPECIFICATION 0x0010
+#define OCF_SNIFF_SUBRATING 0x0011
+#define SNIFF_SUBRATING_CP_SIZE 8
+#define OGF_HOST_CTL 0x03
+#define OCF_SET_EVENT_MASK 0x0001
+#define SET_EVENT_MASK_CP_SIZE 8
+#define OCF_RESET 0x0003
+#define OCF_SET_EVENT_FLT 0x0005
+#define SET_EVENT_FLT_CP_SIZE 2
+#define FLT_CLEAR_ALL 0x00
+#define FLT_INQ_RESULT 0x01
+#define FLT_CONN_SETUP 0x02
+#define INQ_RESULT_RETURN_ALL 0x00
+#define INQ_RESULT_RETURN_CLASS 0x01
+#define INQ_RESULT_RETURN_BDADDR 0x02
+#define CONN_SETUP_ALLOW_ALL 0x00
+#define CONN_SETUP_ALLOW_CLASS 0x01
+#define CONN_SETUP_ALLOW_BDADDR 0x02
+#define CONN_SETUP_AUTO_OFF 0x01
+#define CONN_SETUP_AUTO_ON 0x02
+#define OCF_FLUSH 0x0008
+#define OCF_READ_PIN_TYPE 0x0009
+#define READ_PIN_TYPE_RP_SIZE 2
+#define OCF_WRITE_PIN_TYPE 0x000A
+#define WRITE_PIN_TYPE_CP_SIZE 1
+#define OCF_CREATE_NEW_UNIT_KEY 0x000B
+#define OCF_READ_STORED_LINK_KEY 0x000D
+#define READ_STORED_LINK_KEY_CP_SIZE 7
+#define READ_STORED_LINK_KEY_RP_SIZE 5
+#define OCF_WRITE_STORED_LINK_KEY 0x0011
+#define WRITE_STORED_LINK_KEY_CP_SIZE 1
+#define READ_WRITE_LINK_KEY_RP_SIZE 2
+#define OCF_DELETE_STORED_LINK_KEY 0x0012
+#define DELETE_STORED_LINK_KEY_CP_SIZE 7
+#define DELETE_STORED_LINK_KEY_RP_SIZE 3
+#define OCF_CHANGE_LOCAL_NAME 0x0013
+#define CHANGE_LOCAL_NAME_CP_SIZE 248
+#define OCF_READ_LOCAL_NAME 0x0014
+#define READ_LOCAL_NAME_RP_SIZE 249
+#define OCF_READ_CONN_ACCEPT_TIMEOUT 0x0015
+#define READ_CONN_ACCEPT_TIMEOUT_RP_SIZE 3
+#define OCF_WRITE_CONN_ACCEPT_TIMEOUT 0x0016
+#define WRITE_CONN_ACCEPT_TIMEOUT_CP_SIZE 2
+#define OCF_READ_PAGE_TIMEOUT 0x0017
+#define READ_PAGE_TIMEOUT_RP_SIZE 3
+#define OCF_WRITE_PAGE_TIMEOUT 0x0018
+#define WRITE_PAGE_TIMEOUT_CP_SIZE 2
+#define OCF_READ_SCAN_ENABLE 0x0019
+#define READ_SCAN_ENABLE_RP_SIZE 2
+#define OCF_WRITE_SCAN_ENABLE 0x001A
+#define SCAN_DISABLED 0x00
+#define SCAN_INQUIRY 0x01
+#define SCAN_PAGE 0x02
+#define OCF_READ_PAGE_ACTIVITY 0x001B
+#define READ_PAGE_ACTIVITY_RP_SIZE 5
+#define OCF_WRITE_PAGE_ACTIVITY 0x001C
+#define WRITE_PAGE_ACTIVITY_CP_SIZE 4
+#define OCF_READ_INQ_ACTIVITY 0x001D
+#define READ_INQ_ACTIVITY_RP_SIZE 5
+#define OCF_WRITE_INQ_ACTIVITY 0x001E
+#define WRITE_INQ_ACTIVITY_CP_SIZE 4
+#define OCF_READ_AUTH_ENABLE 0x001F
+#define OCF_WRITE_AUTH_ENABLE 0x0020
+#define AUTH_DISABLED 0x00
+#define AUTH_ENABLED 0x01
+#define OCF_READ_ENCRYPT_MODE 0x0021
+#define OCF_WRITE_ENCRYPT_MODE 0x0022
+#define ENCRYPT_DISABLED 0x00
+#define ENCRYPT_P2P 0x01
+#define ENCRYPT_BOTH 0x02
+#define OCF_READ_CLASS_OF_DEV 0x0023
+#define READ_CLASS_OF_DEV_RP_SIZE 4
+#define OCF_WRITE_CLASS_OF_DEV 0x0024
+#define WRITE_CLASS_OF_DEV_CP_SIZE 3
+#define OCF_READ_VOICE_SETTING 0x0025
+#define READ_VOICE_SETTING_RP_SIZE 3
+#define OCF_WRITE_VOICE_SETTING 0x0026
+#define WRITE_VOICE_SETTING_CP_SIZE 2
+#define OCF_READ_AUTOMATIC_FLUSH_TIMEOUT 0x0027
+#define OCF_WRITE_AUTOMATIC_FLUSH_TIMEOUT 0x0028
+#define OCF_READ_NUM_BROADCAST_RETRANS 0x0029
+#define OCF_WRITE_NUM_BROADCAST_RETRANS 0x002A
+#define OCF_READ_HOLD_MODE_ACTIVITY 0x002B
+#define OCF_WRITE_HOLD_MODE_ACTIVITY 0x002C
+#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D
+#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3
+#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4
+#define OCF_READ_SYNC_FLOW_ENABLE 0x002E
+#define OCF_WRITE_SYNC_FLOW_ENABLE 0x002F
+#define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031
+#define OCF_HOST_BUFFER_SIZE 0x0033
+#define HOST_BUFFER_SIZE_CP_SIZE 7
+#define OCF_HOST_NUM_COMP_PKTS 0x0035
+#define HOST_NUM_COMP_PKTS_CP_SIZE 1
+#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036
+#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5
+#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037
+#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4
+#define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3
+#define OCF_READ_NUM_SUPPORTED_IAC 0x0038
+#define MAX_IAC_LAP 0x40
+#define OCF_READ_CURRENT_IAC_LAP 0x0039
+#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP
+#define OCF_WRITE_CURRENT_IAC_LAP 0x003A
+#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP
+#define OCF_READ_PAGE_SCAN_PERIOD_MODE 0x003B
+#define OCF_WRITE_PAGE_SCAN_PERIOD_MODE 0x003C
+#define OCF_READ_PAGE_SCAN_MODE 0x003D
+#define OCF_WRITE_PAGE_SCAN_MODE 0x003E
+#define OCF_SET_AFH_CLASSIFICATION 0x003F
+#define SET_AFH_CLASSIFICATION_CP_SIZE 10
+#define SET_AFH_CLASSIFICATION_RP_SIZE 1
+#define OCF_READ_INQUIRY_SCAN_TYPE 0x0042
+#define READ_INQUIRY_SCAN_TYPE_RP_SIZE 2
+#define OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043
+#define WRITE_INQUIRY_SCAN_TYPE_CP_SIZE 1
+#define WRITE_INQUIRY_SCAN_TYPE_RP_SIZE 1
+#define OCF_READ_INQUIRY_MODE 0x0044
+#define READ_INQUIRY_MODE_RP_SIZE 2
+#define OCF_WRITE_INQUIRY_MODE 0x0045
+#define WRITE_INQUIRY_MODE_CP_SIZE 1
+#define WRITE_INQUIRY_MODE_RP_SIZE 1
+#define OCF_READ_PAGE_SCAN_TYPE 0x0046
+#define OCF_WRITE_PAGE_SCAN_TYPE 0x0047
+#define OCF_READ_AFH_MODE 0x0048
+#define READ_AFH_MODE_RP_SIZE 2
+#define OCF_WRITE_AFH_MODE 0x0049
+#define WRITE_AFH_MODE_CP_SIZE 1
+#define WRITE_AFH_MODE_RP_SIZE 1
+#define OCF_READ_EXT_INQUIRY_RESPONSE 0x0051
+#define READ_EXT_INQUIRY_RESPONSE_RP_SIZE 242
+#define OCF_WRITE_EXT_INQUIRY_RESPONSE 0x0052
+#define WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE 241
+#define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE 1
+#define OCF_REFRESH_ENCRYPTION_KEY 0x0053
+#define REFRESH_ENCRYPTION_KEY_CP_SIZE 2
+#define REFRESH_ENCRYPTION_KEY_RP_SIZE 1
+#define OCF_READ_SIMPLE_PAIRING_MODE 0x0055
+#define READ_SIMPLE_PAIRING_MODE_RP_SIZE 2
+#define OCF_WRITE_SIMPLE_PAIRING_MODE 0x0056
+#define WRITE_SIMPLE_PAIRING_MODE_CP_SIZE 1
+#define WRITE_SIMPLE_PAIRING_MODE_RP_SIZE 1
+#define OCF_READ_LOCAL_OOB_DATA 0x0057
+#define READ_LOCAL_OOB_DATA_RP_SIZE 33
+#define OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL 0x0058
+#define READ_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 2
+#define OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL 0x0059
+#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE 1
+#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 1
+#define OCF_READ_DEFAULT_ERROR_DATA_REPORTING 0x005A
+#define READ_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 2
+#define OCF_WRITE_DEFAULT_ERROR_DATA_REPORTING 0x005B
+#define WRITE_DEFAULT_ERROR_DATA_REPORTING_CP_SIZE 1
+#define WRITE_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 1
+#define OCF_ENHANCED_FLUSH 0x005F
+#define ENHANCED_FLUSH_CP_SIZE 3
+#define OCF_SEND_KEYPRESS_NOTIFY 0x0060
+#define SEND_KEYPRESS_NOTIFY_CP_SIZE 7
+#define SEND_KEYPRESS_NOTIFY_RP_SIZE 1
+#define OGF_INFO_PARAM 0x04
+#define OCF_READ_LOCAL_VERSION 0x0001
+#define READ_LOCAL_VERSION_RP_SIZE 9
+#define OCF_READ_LOCAL_COMMANDS 0x0002
+#define READ_LOCAL_COMMANDS_RP_SIZE 65
+#define OCF_READ_LOCAL_FEATURES 0x0003
+#define READ_LOCAL_FEATURES_RP_SIZE 9
+#define OCF_READ_LOCAL_EXT_FEATURES 0x0004
+#define READ_LOCAL_EXT_FEATURES_CP_SIZE 1
+#define READ_LOCAL_EXT_FEATURES_RP_SIZE 11
+#define OCF_READ_BUFFER_SIZE 0x0005
+#define READ_BUFFER_SIZE_RP_SIZE 8
+#define OCF_READ_COUNTRY_CODE 0x0007
+#define OCF_READ_BD_ADDR 0x0009
+#define READ_BD_ADDR_RP_SIZE 7
+#define OGF_STATUS_PARAM 0x05
+#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001
+#define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4
+#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002
+#define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4
+#define OCF_READ_LINK_QUALITY 0x0003
+#define READ_LINK_QUALITY_RP_SIZE 4
+#define OCF_READ_RSSI 0x0005
+#define READ_RSSI_RP_SIZE 4
+#define OCF_READ_AFH_MAP 0x0006
+#define READ_AFH_MAP_RP_SIZE 14
+#define OCF_READ_CLOCK 0x0007
+#define READ_CLOCK_CP_SIZE 3
+#define READ_CLOCK_RP_SIZE 9
+#define OGF_TESTING_CMD 0x3e
+#define OCF_READ_LOOPBACK_MODE 0x0001
+#define OCF_WRITE_LOOPBACK_MODE 0x0002
+#define OCF_ENABLE_DEVICE_UNDER_TEST_MODE 0x0003
+#define OCF_WRITE_SIMPLE_PAIRING_DEBUG_MODE 0x0004
+#define WRITE_SIMPLE_PAIRING_DEBUG_MODE_CP_SIZE 1
+#define WRITE_SIMPLE_PAIRING_DEBUG_MODE_RP_SIZE 1
+#define OGF_VENDOR_CMD 0x3f
+#define EVT_INQUIRY_COMPLETE 0x01
+#define EVT_INQUIRY_RESULT 0x02
+#define INQUIRY_INFO_SIZE 14
+#define EVT_CONN_COMPLETE 0x03
+#define EVT_CONN_COMPLETE_SIZE 13
+#define EVT_CONN_REQUEST 0x04
+#define EVT_CONN_REQUEST_SIZE 10
+#define EVT_DISCONN_COMPLETE 0x05
+#define EVT_DISCONN_COMPLETE_SIZE 4
+#define EVT_AUTH_COMPLETE 0x06
+#define EVT_AUTH_COMPLETE_SIZE 3
+#define EVT_REMOTE_NAME_REQ_COMPLETE 0x07
+#define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE 255
+#define EVT_ENCRYPT_CHANGE 0x08
+#define EVT_ENCRYPT_CHANGE_SIZE 5
+#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
+#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE 3
+#define EVT_MASTER_LINK_KEY_COMPLETE 0x0A
+#define EVT_MASTER_LINK_KEY_COMPLETE_SIZE 4
+#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B
+#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11
+#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C
+#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8
+#define EVT_QOS_SETUP_COMPLETE 0x0D
+#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE)
+#define EVT_CMD_COMPLETE 0x0E
+#define EVT_CMD_COMPLETE_SIZE 3
+#define EVT_CMD_STATUS 0x0F
+#define EVT_CMD_STATUS_SIZE 4
+#define EVT_HARDWARE_ERROR 0x10
+#define EVT_HARDWARE_ERROR_SIZE 1
+#define EVT_FLUSH_OCCURRED 0x11
+#define EVT_FLUSH_OCCURRED_SIZE 2
+#define EVT_ROLE_CHANGE 0x12
+#define EVT_ROLE_CHANGE_SIZE 8
+#define EVT_NUM_COMP_PKTS 0x13
+#define EVT_NUM_COMP_PKTS_SIZE 1
+#define EVT_MODE_CHANGE 0x14
+#define EVT_MODE_CHANGE_SIZE 6
+#define EVT_RETURN_LINK_KEYS 0x15
+#define EVT_RETURN_LINK_KEYS_SIZE 1
+#define EVT_PIN_CODE_REQ 0x16
+#define EVT_PIN_CODE_REQ_SIZE 6
+#define EVT_LINK_KEY_REQ 0x17
+#define EVT_LINK_KEY_REQ_SIZE 6
+#define EVT_LINK_KEY_NOTIFY 0x18
+#define EVT_LINK_KEY_NOTIFY_SIZE 23
+#define EVT_LOOPBACK_COMMAND 0x19
+#define EVT_DATA_BUFFER_OVERFLOW 0x1A
+#define EVT_DATA_BUFFER_OVERFLOW_SIZE 1
+#define EVT_MAX_SLOTS_CHANGE 0x1B
+#define EVT_MAX_SLOTS_CHANGE_SIZE 3
+#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C
+#define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE 5
+#define EVT_CONN_PTYPE_CHANGED 0x1D
+#define EVT_CONN_PTYPE_CHANGED_SIZE 5
+#define EVT_QOS_VIOLATION 0x1E
+#define EVT_QOS_VIOLATION_SIZE 2
+#define EVT_PSCAN_REP_MODE_CHANGE 0x20
+#define EVT_PSCAN_REP_MODE_CHANGE_SIZE 7
+#define EVT_FLOW_SPEC_COMPLETE 0x21
+#define EVT_FLOW_SPEC_COMPLETE_SIZE (5 + HCI_QOS_CP_SIZE)
+#define EVT_INQUIRY_RESULT_WITH_RSSI 0x22
+#define INQUIRY_INFO_WITH_RSSI_SIZE 14
+#define INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE 15
+#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE 0x23
+#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE 13
+#define EVT_SYNC_CONN_COMPLETE 0x2C
+#define EVT_SYNC_CONN_COMPLETE_SIZE 17
+#define EVT_SYNC_CONN_CHANGED 0x2D
+#define EVT_SYNC_CONN_CHANGED_SIZE 9
+#define EVT_SNIFF_SUBRATING 0x2E
+#define EVT_SNIFF_SUBRATING_SIZE 11
+#define EVT_EXTENDED_INQUIRY_RESULT 0x2F
+#define EXTENDED_INQUIRY_INFO_SIZE 254
+#define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30
+#define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3
+#define EVT_IO_CAPABILITY_REQUEST 0x31
+#define EVT_IO_CAPABILITY_REQUEST_SIZE 6
+#define EVT_IO_CAPABILITY_RESPONSE 0x32
+#define EVT_IO_CAPABILITY_RESPONSE_SIZE 9
+#define EVT_USER_CONFIRM_REQUEST 0x33
+#define EVT_USER_CONFIRM_REQUEST_SIZE 10
+#define EVT_USER_PASSKEY_REQUEST 0x34
+#define EVT_USER_PASSKEY_REQUEST_SIZE 6
+#define EVT_REMOTE_OOB_DATA_REQUEST 0x35
+#define EVT_REMOTE_OOB_DATA_REQUEST_SIZE 6
+#define EVT_SIMPLE_PAIRING_COMPLETE 0x36
+#define EVT_SIMPLE_PAIRING_COMPLETE_SIZE 7
+#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED 0x38
+#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED_SIZE 4
+#define EVT_ENHANCED_FLUSH_COMPLETE 0x39
+#define EVT_ENHANCED_FLUSH_COMPLETE_SIZE 2
+#define EVT_USER_PASSKEY_NOTIFY 0x3B
+#define EVT_USER_PASSKEY_NOTIFY_SIZE 10
+#define EVT_KEYPRESS_NOTIFY 0x3C
+#define EVT_KEYPRESS_NOTIFY_SIZE 7
+#define EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3D
+#define EVT_REMOTE_HOST_FEATURES_NOTIFY_SIZE 14
+#define EVT_TESTING 0xFE
+#define EVT_VENDOR 0xFF
+#define EVT_STACK_INTERNAL 0xFD
+#define EVT_STACK_INTERNAL_SIZE 2
+#define EVT_SI_DEVICE 0x01
+#define EVT_SI_DEVICE_SIZE 4
+#define EVT_SI_SECURITY 0x02
+#define HCI_TYPE_LEN 1
+#define HCI_COMMAND_HDR_SIZE 3
+#define HCI_EVENT_HDR_SIZE 2
+#define HCI_ACL_HDR_SIZE 4
+#define HCI_SCO_HDR_SIZE 3
+#define HCI_MSG_HDR_SIZE 6
+#define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10))
+#define cmd_opcode_ogf(op) (op >> 10)
+#define cmd_opcode_ocf(op) (op & 0x03ff)
+#define acl_handle_pack(h, f) (uint16_t)((h & 0x0fff)|(f << 12))
+#define acl_handle(h) (h & 0x0fff)
+#define acl_flags(h) (h >> 12)
+#endif
+#define HCI_DATA_DIR 1
+#define HCI_FILTER 2
+#define HCI_TIME_STAMP 3
+#define HCI_CMSG_DIR 0x0001
+#define HCI_CMSG_TSTAMP 0x0002
+#define HCI_DEV_NONE 0xffff
+#define HCI_FLT_TYPE_BITS 31
+#define HCI_FLT_EVENT_BITS 63
+#define HCI_FLT_OGF_BITS 63
+#define HCI_FLT_OCF_BITS 127
+#define IREQ_CACHE_FLUSH 0x0001
+#ifdef __cplusplus
+#endif
+struct hci_dev_stats
+{
+ uint32_t err_rx;
+ uint32_t err_tx;
+ uint32_t cmd_tx;
+ uint32_t evt_rx;
+ uint32_t acl_tx;
+ uint32_t acl_rx;
+ uint32_t sco_tx;
+ uint32_t sco_rx;
+ uint32_t byte_rx;
+ uint32_t byte_tx;
+};
+struct hci_dev_info
+{
+ uint16_t dev_id;
+ char name[8];
+
+ bdaddr_t bdaddr;
+
+ uint32_t flags;
+ uint8_t type;
+
+ uint8_t features[8];
+
+ uint32_t pkt_type;
+ uint32_t link_policy;
+ uint32_t link_mode;
+
+ uint16_t acl_mtu;
+ uint16_t acl_pkts;
+ uint16_t sco_mtu;
+ uint16_t sco_pkts;
+
+ struct hci_dev_stats stat;
+};
+enum
+{
+ HCI_UP,
+ HCI_INIT,
+ HCI_RUNNING,
+
+ HCI_PSCAN,
+ HCI_ISCAN,
+ HCI_AUTH,
+ HCI_ENCRYPT,
+ HCI_INQUIRY,
+
+ HCI_RAW,
+
+ HCI_SECMGR
+};
+struct sockaddr_hci
+{
+ sa_family_t hci_family;
+ unsigned short hci_dev;
+};
+struct hci_conn_info
+{
+ uint16_t handle;
+ bdaddr_t bdaddr;
+ uint8_t type;
+ uint8_t out;
+ uint16_t state;
+ uint32_t link_mode;
+ uint32_t mtu;
+ uint32_t cnt;
+ uint32_t pkts;
+};
+struct hci_conn_list_req
+{
+ uint16_t dev_id;
+ uint16_t conn_num;
+ struct hci_conn_info conn_info[0];
+};
+#endif
--- /dev/null
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Bluez header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to Android. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __HCI_LIB_H
+#define __HCI_LIB_H
+
+#ifdef __cplusplus
+#endif
+#ifdef __cplusplus
+#endif
+static inline int
+hci_test_bit (int nr, void *addr)
+{
+ return *((uint32_t *) addr + (nr >> 5)) & (1 << (nr & 31));
+}
+#endif
--- /dev/null
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __L2CAP_H
+#define __L2CAP_H
+
+#ifdef __cplusplus
+#endif
+#include <sys/socket.h>
+#define L2CAP_DEFAULT_MTU 672
+#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
+#define L2CAP_CONN_TIMEOUT (HZ * 40)
+#define L2CAP_OPTIONS 0x01
+#define L2CAP_CONNINFO 0x02
+#define L2CAP_LM 0x03
+#define L2CAP_LM_MASTER 0x0001
+#define L2CAP_LM_AUTH 0x0002
+#define L2CAP_LM_ENCRYPT 0x0004
+#define L2CAP_LM_TRUSTED 0x0008
+#define L2CAP_LM_RELIABLE 0x0010
+#define L2CAP_LM_SECURE 0x0020
+#define L2CAP_LM_FLUSHABLE 0x0040
+#define L2CAP_COMMAND_REJ 0x01
+#define L2CAP_CONN_REQ 0x02
+#define L2CAP_CONN_RSP 0x03
+#define L2CAP_CONF_REQ 0x04
+#define L2CAP_CONF_RSP 0x05
+#define L2CAP_DISCONN_REQ 0x06
+#define L2CAP_DISCONN_RSP 0x07
+#define L2CAP_ECHO_REQ 0x08
+#define L2CAP_ECHO_RSP 0x09
+#define L2CAP_INFO_REQ 0x0a
+#define L2CAP_INFO_RSP 0x0b
+#define L2CAP_HDR_SIZE 4
+#define L2CAP_CMD_HDR_SIZE 4
+#define L2CAP_CMD_REJ_SIZE 2
+#define L2CAP_CONN_REQ_SIZE 4
+#define L2CAP_CONN_RSP_SIZE 8
+#define L2CAP_CR_SUCCESS 0x0000
+#define L2CAP_CR_PEND 0x0001
+#define L2CAP_CR_BAD_PSM 0x0002
+#define L2CAP_CR_SEC_BLOCK 0x0003
+#define L2CAP_CR_NO_MEM 0x0004
+#define L2CAP_CS_NO_INFO 0x0000
+#define L2CAP_CS_AUTHEN_PEND 0x0001
+#define L2CAP_CS_AUTHOR_PEND 0x0002
+#define L2CAP_CONF_REQ_SIZE 4
+#define L2CAP_CONF_RSP_SIZE 6
+#define L2CAP_CONF_SUCCESS 0x0000
+#define L2CAP_CONF_UNACCEPT 0x0001
+#define L2CAP_CONF_REJECT 0x0002
+#define L2CAP_CONF_UNKNOWN 0x0003
+#define L2CAP_CONF_OPT_SIZE 2
+#define L2CAP_CONF_MTU 0x01
+#define L2CAP_CONF_FLUSH_TO 0x02
+#define L2CAP_CONF_QOS 0x03
+#define L2CAP_CONF_RFC 0x04
+#define L2CAP_CONF_RFC_MODE 0x04
+#define L2CAP_CONF_MAX_SIZE 22
+#define L2CAP_MODE_BASIC 0x00
+#define L2CAP_MODE_RETRANS 0x01
+#define L2CAP_MODE_FLOWCTL 0x02
+#define L2CAP_DISCONN_REQ_SIZE 4
+#define L2CAP_DISCONN_RSP_SIZE 4
+#define L2CAP_INFO_REQ_SIZE 2
+#define L2CAP_INFO_RSP_SIZE 4
+#define L2CAP_IT_CL_MTU 0x0001
+#define L2CAP_IT_FEAT_MASK 0x0002
+#define L2CAP_IR_SUCCESS 0x0000
+#define L2CAP_IR_NOTSUPP 0x0001
+#ifdef __cplusplus
+#endif
+struct sockaddr_l2
+{
+ sa_family_t l2_family;
+ unsigned short l2_psm;
+ bdaddr_t l2_bdaddr;
+};
+#endif
--- /dev/null
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Bluez header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to Android. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __RFCOMM_H
+#define __RFCOMM_H
+
+#ifdef __cplusplus
+#endif
+#include <sys/socket.h>
+#define RFCOMM_DEFAULT_MTU 127
+#define RFCOMM_PSM 3
+#define RFCOMM_CONN_TIMEOUT (HZ * 30)
+#define RFCOMM_DISC_TIMEOUT (HZ * 20)
+#define RFCOMM_CONNINFO 0x02
+#define RFCOMM_LM 0x03
+#define RFCOMM_LM_MASTER 0x0001
+#define RFCOMM_LM_AUTH 0x0002
+#define RFCOMM_LM_ENCRYPT 0x0004
+#define RFCOMM_LM_TRUSTED 0x0008
+#define RFCOMM_LM_RELIABLE 0x0010
+#define RFCOMM_LM_SECURE 0x0020
+#define RFCOMM_MAX_DEV 256
+#define RFCOMMCREATEDEV _IOW('R', 200, int)
+#define RFCOMMRELEASEDEV _IOW('R', 201, int)
+#define RFCOMMGETDEVLIST _IOR('R', 210, int)
+#define RFCOMMGETDEVINFO _IOR('R', 211, int)
+#define RFCOMM_REUSE_DLC 0
+#define RFCOMM_RELEASE_ONHUP 1
+#define RFCOMM_HANGUP_NOW 2
+#define RFCOMM_TTY_ATTACHED 3
+#ifdef __cplusplus
+#endif
+struct sockaddr_rc
+{
+ sa_family_t rc_family;
+ bdaddr_t rc_bdaddr;
+ uint8_t rc_channel;
+};
+#endif
--- /dev/null
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Bluez header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to Android. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __SCO_H
+#define __SCO_H
+
+#ifdef __cplusplus
+#endif
+#define SCO_DEFAULT_MTU 500
+#define SCO_DEFAULT_FLUSH_TO 0xFFFF
+#define SCO_CONN_TIMEOUT (HZ * 40)
+#define SCO_DISCONN_TIMEOUT (HZ * 2)
+#define SCO_CONN_IDLE_TIMEOUT (HZ * 60)
+#define SCO_OPTIONS 0x01
+#define SCO_CONNINFO 0x02
+#ifdef __cplusplus
+#endif
+struct sockaddr_sco
+{
+ sa_family_t sco_family;
+ bdaddr_t sco_bdaddr;
+ uint16_t sco_pkt_type;
+};
+#endif
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,boost))
+
+$(eval $(call gb_Module_add_targets,boost,\
+ StaticLibrary_boostdatetime \
+ StaticLibrary_boost_system \
+ StaticLibrary_boost_iostreams \
+ UnpackedTarball_boost \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Module_add_targets,boost,\
+ StaticLibrary_boostthread \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://www.boost.org/].
+
+Apart from the spirit parsing framework, LibreOffice currently mostly
+uses the smart pointers, pool memory and binders functionality.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,boost_iostreams))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,boost_iostreams))
+
+# disable "auto link" "feature" on MSVC
+$(eval $(call gb_StaticLibrary_add_defs,boost_iostreams,\
+ -DBOOST_ALL_NO_LIB \
+))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,boost_iostreams,boost))
+
+
+$(eval $(call gb_StaticLibrary_use_externals,boost_iostreams, \
+ zlib \
+ boost_headers \
+))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boost_iostreams,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,boost_iostreams,\
+ UnpackedTarball/boost/libs/iostreams/src/zlib \
+ UnpackedTarball/boost/libs/iostreams/src/gzip \
+ UnpackedTarball/boost/libs/iostreams/src/file_descriptor \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,boost_system))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,boost_system,boost))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,boost_system))
+
+# disable "auto link" "feature" on MSVC
+$(eval $(call gb_StaticLibrary_add_defs,boost_system,\
+ -DBOOST_ALL_NO_LIB \
+))
+
+$(eval $(call gb_StaticLibrary_use_external,boost_system,boost_headers))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boost_system,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,boost_system,\
+ UnpackedTarball/boost/libs/system/src/error_code \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,boostdatetime))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,boostdatetime,boost))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,boostdatetime))
+
+# disable "auto link" "feature" on MSVC
+$(eval $(call gb_StaticLibrary_add_defs,boostdatetime,\
+ -DBOOST_ALL_NO_LIB \
+))
+
+$(eval $(call gb_StaticLibrary_use_external,boostdatetime,boost_headers))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boostdatetime,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,boostdatetime,\
+ UnpackedTarball/boost/libs/date_time/src/gregorian/date_generators \
+ UnpackedTarball/boost/libs/date_time/src/gregorian/gregorian_types \
+ UnpackedTarball/boost/libs/date_time/src/gregorian/greg_month \
+ UnpackedTarball/boost/libs/date_time/src/gregorian/greg_weekday \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,boostthread))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,boostthread,boost))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,boostthread))
+
+$(eval $(call gb_StaticLibrary_add_defs,boostthread,\
+ -D_WIN32_WINNT=0x0502 \
+))
+
+# disable "auto link" "feature" on MSVC
+$(eval $(call gb_StaticLibrary_add_defs,boostthread,\
+ -DBOOST_ALL_NO_LIB \
+))
+
+$(eval $(call gb_StaticLibrary_use_external,boostthread,boost_headers))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boostthread,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,boostthread,\
+ UnpackedTarball/boost/libs/thread/src/win32/thread \
+ UnpackedTarball/boost/libs/thread/src/win32/tss_dll \
+ UnpackedTarball/boost/libs/thread/src/win32/tss_pe \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+boost_patches :=
+#https://svn.boost.org/trac/boost/ticket/3780
+boost_patches += boost.3780.aliasing.patch
+#https://svn.boost.org/trac/boost/ticket/9397
+boost_patches += boost.9397.warnings.patch.0
+#http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679
+boost_patches += boost.gcc47679.patch
+#https://svn.boost.org/trac/boost/ticket/6369
+boost_patches += boost.6369.warnings.patch
+#https://svn.boost.org/trac/boost/ticket/7551
+boost_patches += boost.7551.unusedvars.patch
+#https://svn.boost.org/trac/boost/ticket/6142
+boost_patches += boost.6142.warnings.patch.1
+
+# fixed upstream
+boost_patches += boost.bind.Wunused-local-typedefs.warnings.patch
+# fixed upstream
+boost_patches += boost.concept_check.C4100.warnings.patch
+# fixed upstream
+boost_patches += boost.concept_check.Wunused-local-typedefs.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9881
+boost_patches += boost.crc.Wshadow.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9882
+boost_patches += boost.date_time.Wshadow.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9883
+boost_patches += boost.date_time.Wunused-local-typedefs.warnings.patch
+# fixed upstream
+boost_patches += boost.math.Wdeprecated-register.patch.0
+# https://svn.boost.org/trac/boost/ticket/9884
+boost_patches += boost.math.Wunused-local-typedefs.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9885
+boost_patches += boost.multi_array.C4510.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9886
+boost_patches += boost.multi_array.Wshadow.warnings.patch.2
+# https://svn.boost.org/trac/boost/ticket/9887
+boost_patches += boost.multi_array.Wundef.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9888
+boost_patches += boost.multi_array.Wunused-local-typedefs.warnings.patch
+# fixed upstream
+boost_patches += boost.multi_index.Wshadow.warnings.patch.1
+# https://svn.boost.org/trac/boost/ticket/9889
+boost_patches += boost.predef.Wundef.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9891
+boost_patches += boost.preprocessor.Wundef.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9892
+boost_patches += boost.property_tree.Wshadow.warnings.patch.1
+# https://svn.boost.org/trac/boost/ticket/9893
+boost_patches += boost.property_tree.Wtype-limits.warnings.patch.1
+# https://svn.boost.org/trac/boost/ticket/9894
+boost_patches += boost.ptr_container.Wshadow.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9895
+boost_patches += boost.ptr_container.Wignored-qualifiers.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9896
+boost_patches += boost.ptr_container.Wextra.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9897
+boost_patches += boost.ptr_container.Wunused-parameter.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9898
+boost_patches += boost.random.Wshadow.warnings.patch
+# fixed upstream
+boost_patches += boost.random.Wunused-local-typedefs.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9900
+boost_patches += boost.spirit.Wshadow.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9901
+boost_patches += boost.spirit.Wunused-local-typedefs.warnings.patch
+# fixed upstream
+boost_patches += boost.unordered.Wshadow.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9902
+boost_patches += boost.tuple.Wunused-local-typedefs.warnings.patch
+# https://svn.boost.org/trac/boost/ticket/9903
+boost_patches += boost.utility.Wundef.warnings.patch
+# fixed upstream
+boost_patches += boost.uuid.Wshadow.warnings.patch
+
+# https://svn.boost.org/trac/boost/ticket/9890
+boost_patches += boost.endian.patch
+# fixed upstream
+boost_patches += boost.loplugin.patch
+# fixed upstream
+boost_patches += boost.transform_width.patch
+
+# Help static analysis tools (see SAL_UNUSED_PARAMETER in sal/types.h):
+ifeq (GCC,$(COM))
+boost_patches += boost_1_44_0-unused-parameters.patch
+endif
+
+# Clang warnings:
+boost_patches += boost_1_44_0-clang-warnings.patch
+
+boost_patches += boost.auto_link.patch
+boost_patches += boost.std.move.patch
+boost_patches += boost.wunused.patch
+boost_patches += boost.wdeprecated-auto_ptr.patch.0
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,boost,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,boost,\
+ $(foreach patch,$(boost_patches),external/boost/$(patch)) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/boost_1_44_0/boost/function/function_base.hpp
++++ misc/build/boost_1_44_0/boost/function/function_base.hpp
+@@ -314,17 +322,17 @@
+ {
+ if (op == clone_functor_tag || op == move_functor_tag) {
+ const functor_type* in_functor =
+- reinterpret_cast<const functor_type*>(&in_buffer.data);
++ static_cast<const functor_type*>(static_cast<void*>(&in_buffer.data));
+ new (reinterpret_cast<void*>(&out_buffer.data)) functor_type(*in_functor);
+
+ if (op == move_functor_tag) {
+- functor_type* f = reinterpret_cast<functor_type*>(&in_buffer.data);
++ functor_type* f = static_cast<functor_type*>(static_cast<void*>(&in_buffer.data));
+ (void)f; // suppress warning about the value of f not being used (MSVC)
+ f->~Functor();
+ }
+ } else if (op == destroy_functor_tag) {
+ // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
+- functor_type* f = reinterpret_cast<functor_type*>(&out_buffer.data);
++ functor_type* f = static_cast<functor_type*>(static_cast<void*>(&out_buffer.data));
+ (void)f; // suppress warning about the value of f not being used (MSVC)
+ f->~Functor();
+ } else if (op == check_functor_type_tag) {
--- /dev/null
+--- a/boost/mpl/has_xxx.hpp.orig 2011-11-18 13:45:00.000000000 +0100
++++ b/boost/mpl/has_xxx.hpp 2011-11-18 13:47:19.000000000 +0100
+@@ -341,7 +341,7 @@
+ ) \
+ /**/
+
+-# if !BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION
++# if !defined(BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION) || !BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION
+ # define BOOST_MPL_HAS_MEMBER_REJECT(args, member_macro) \
+ template< typename V > \
+ static boost::mpl::aux::no_tag \
+@@ -354,7 +354,7 @@
+ /**/
+ # endif
+
+-# if !BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES
++# if !defined(BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES) || !BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES
+ # define BOOST_MPL_HAS_MEMBER_MULTI_ACCEPT(z, n, args) \
+ template< typename V > \
+ static boost::mpl::aux::yes_tag \
+@@ -383,7 +383,7 @@
+ /**/
+ # endif
+
+-# if !BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION
++# if !defined(BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION) || !BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION
+ # define BOOST_MPL_HAS_MEMBER_TEST(args) \
+ sizeof(BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)< U >(0)) \
+ == sizeof(boost::mpl::aux::yes_tag) \
+@@ -456,7 +456,7 @@
+ ) \
+ /**/
+
+-# if BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE
++# if defined(BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE) && BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE
+
+ # if !defined(BOOST_MPL_HAS_XXX_NEEDS_NAMESPACE_LEVEL_SUBSTITUTE)
+ # if BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
--- /dev/null
+--- misc/boost_1_44_0/boost/date_time/gregorian/gregorian_io.hpp 2012-01-08 20:16:41.321760852 +0000
++++ misc/build/boost_1_44_0/boost/date_time/gregorian/gregorian_io.hpp 2012-01-08 20:25:43.233484675 +0000
+@@ -77,14 +77,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, d);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, d);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, d);
+@@ -138,14 +138,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, dd);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, dd);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, dd);
+@@ -202,14 +202,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, dp);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, dp);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, dp);
+@@ -261,14 +261,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, m);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, m);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, m);
+@@ -318,14 +318,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, wd);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, wd);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, wd);
+@@ -359,14 +359,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, gd);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, gd);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, gd);
+@@ -400,14 +400,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, gy);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, gy);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, gy);
+@@ -458,14 +458,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, pd);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, pd);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, pd);
+@@ -515,14 +515,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, nday);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, nday);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, nday);
+@@ -573,14 +573,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, fkd);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, fkd);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, fkd);
+@@ -631,14 +631,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, lkd);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, lkd);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, lkd);
+@@ -690,14 +690,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, fka);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, fka);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, fka);
+@@ -749,14 +749,14 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
++ typedef typename date_time::date_input_facet<date, CharT> lcl_date_input_facet;
+
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<date_input_facet>(is.getloc())) {
+- std::use_facet<date_input_facet>(is.getloc()).get(sit, str_end, is, fkb);
++ if(std::has_facet<lcl_date_input_facet>(is.getloc())) {
++ std::use_facet<lcl_date_input_facet>(is.getloc()).get(sit, str_end, is, fkb);
+ }
+ else {
+- date_input_facet* f = new date_input_facet();
++ lcl_date_input_facet* f = new lcl_date_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, fkb);
+--- misc/boost_1_44_0/boost/date_time/posix_time/posix_time_io.hpp 2012-01-08 20:16:41.342761072 +0000
++++ misc/build/boost_1_44_0/boost/date_time/posix_time/posix_time_io.hpp 2012-01-09 09:47:25.426730124 +0000
+@@ -75,13 +75,13 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet;
++ typedef typename date_time::time_input_facet<ptime, CharT> lcl_time_input_facet;
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<time_input_facet>(is.getloc())) {
+- std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, pt);
++ if(std::has_facet<lcl_time_input_facet>(is.getloc())) {
++ std::use_facet<lcl_time_input_facet>(is.getloc()).get(sit, str_end, is, pt);
+ }
+ else {
+- time_input_facet* f = new time_input_facet();
++ lcl_time_input_facet* f = new lcl_time_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, pt);
+@@ -143,13 +143,13 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet;
++ typedef typename date_time::time_input_facet<ptime, CharT> lcl_time_input_facet;
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<time_input_facet>(is.getloc())) {
+- std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, tp);
++ if(std::has_facet<lcl_time_input_facet>(is.getloc())) {
++ std::use_facet<lcl_time_input_facet>(is.getloc()).get(sit, str_end, is, tp);
+ }
+ else {
+- time_input_facet* f = new time_input_facet();
++ lcl_time_input_facet* f = new lcl_time_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, tp);
+@@ -208,13 +208,13 @@
+ typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
+ if (strm_sentry) {
+ try {
+- typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet;
++ typedef typename date_time::time_input_facet<ptime, CharT> lcl_time_input_facet;
+ std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
+- if(std::has_facet<time_input_facet>(is.getloc())) {
+- std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, td);
++ if(std::has_facet<lcl_time_input_facet>(is.getloc())) {
++ std::use_facet<lcl_time_input_facet>(is.getloc()).get(sit, str_end, is, td);
+ }
+ else {
+- time_input_facet* f = new time_input_facet();
++ lcl_time_input_facet* f = new lcl_time_input_facet();
+ std::locale l = std::locale(is.getloc(), f);
+ is.imbue(l);
+ f->get(sit, str_end, is, td);
--- /dev/null
+--- misc/boost_1_44_0/boost/date_time/tz_db_base.hpp
++++ misc/build/boost_1_44_0/boost/date_time/tz_db_base.hpp
+@@ -170,7 +170,6 @@
+ /*! May throw data_not_accessible, or bad_field_count exceptions */
+ void load_from_file(const std::string& pathspec)
+ {
+- string_type in_str;
+ std::string buff;
+
+ std::ifstream ifs(pathspec.c_str());
--- /dev/null
+Index: boost/predef/os/bsd/bsdi.h
+===================================================================
+--- boost/predef/os/bsd/bsdi.h (revision 86709)
++++ boost/predef/os/bsd/bsdi.h (working copy)
+@@ -24,7 +24,7 @@
+
+ #define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__bsdi__) \
+ )
+ # ifndef BOOST_OS_BSD_AVAILABLE
+Index: boost/predef/os/bsd/dragonfly.h
+===================================================================
+--- boost/predef/os/bsd/dragonfly.h (revision 86709)
++++ boost/predef/os/bsd/dragonfly.h (working copy)
+@@ -24,7 +24,7 @@
+
+ #define BOOST_OS_BSD_DRAGONFLY BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__DragonFly__) \
+ )
+ # ifndef BOOST_OS_BSD_AVAILABLE
+Index: boost/predef/os/bsd/free.h
+===================================================================
+--- boost/predef/os/bsd/free.h (revision 86709)
++++ boost/predef/os/bsd/free.h (working copy)
+@@ -26,7 +26,7 @@
+
+ #define BOOST_OS_BSD_FREE BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__FreeBSD__) \
+ )
+ # ifndef BOOST_OS_BSD_AVAILABLE
+Index: boost/predef/os/bsd/net.h
+===================================================================
+--- boost/predef/os/bsd/net.h (revision 86709)
++++ boost/predef/os/bsd/net.h (working copy)
+@@ -31,7 +31,7 @@
+
+ #define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__NETBSD__) || defined(__NetBSD__) \
+ )
+ # ifndef BOOST_OS_BSD_AVAILABLE
+Index: boost/predef/os/bsd/open.h
+===================================================================
+--- boost/predef/os/bsd/open.h (revision 86709)
++++ boost/predef/os/bsd/open.h (working copy)
+@@ -55,7 +55,7 @@
+
+ #define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__OpenBSD__) \
+ )
+ # ifndef BOOST_OS_BSD_AVAILABLE
+Index: boost/predef/os/bsd.h
+===================================================================
+--- boost/predef/os/bsd.h (revision 86709)
++++ boost/predef/os/bsd.h (working copy)
+@@ -59,7 +59,7 @@
+ #define BOOST_OS_BSD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+ #endif
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(BSD) || \
+ defined(_SYSTYPE_BSD) \
+ )
+Index: boost/predef/os/macos.h
+===================================================================
+--- boost/predef/os/macos.h (revision 86709)
++++ boost/predef/os/macos.h (working copy)
+@@ -31,7 +31,7 @@
+
+ #define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+-#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
++#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(macintosh) || defined(Macintosh) || \
+ (defined(__APPLE__) && defined(__MACH__)) \
+ )
--- /dev/null
+--- foo/foo/foo/boost/config/auto_link.hpp
++++ foo/foo/foo/boost/config/auto_link.hpp
+@@ -357,37 +357,6 @@
+ # define BOOST_LIB_PREFIX "lib"
+ #endif
+
+-//
+-// now include the lib:
+-//
+-#if defined(BOOST_LIB_NAME) \
+- && defined(BOOST_LIB_PREFIX) \
+- && defined(BOOST_LIB_TOOLSET) \
+- && defined(BOOST_LIB_THREAD_OPT) \
+- && defined(BOOST_LIB_RT_OPT) \
+- && defined(BOOST_LIB_VERSION)
+-
+-#ifdef BOOST_AUTO_LINK_TAGGED
+-# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
+-# ifdef BOOST_LIB_DIAGNOSTIC
+-# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
+-# endif
+-#elif defined(BOOST_AUTO_LINK_NOMANGLE)
+-# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
+-# ifdef BOOST_LIB_DIAGNOSTIC
+-# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
+-# endif
+-#else
+-# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
+-# ifdef BOOST_LIB_DIAGNOSTIC
+-# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
+-# endif
+-#endif
+-
+-#else
+-# error "some required macros where not defined (internal logic error)."
+-#endif
+-
+
+ #endif // _MSC_VER || __BORLANDC__
+
--- /dev/null
+--- misc/boost_1_44_0/boost/bind/arg.hpp
++++ misc/build/boost_1_44_0/boost/bind/arg.hpp
+@@ -35,6 +35,8 @@
+ {
+ // static assert I == is_placeholder<T>::value
+ typedef char T_must_be_placeholder[ I == is_placeholder<T>::value? 1: -1 ];
++ T_must_be_placeholder dummy; (void) dummy;
++ // silence -Werror=unused-local-typedefs (GCC 4.8)
+ }
+ };
+
--- /dev/null
+--- misc/boost_1_44_0/boost/concept/detail/msvc.hpp
++++ misc/build/boost_1_44_0/boost/concept/detail/msvc.hpp
+@@ -12,6 +12,9 @@
+ # include <boost/mpl/if.hpp>
+ # endif
+
++// disable spurious "unreferenced formal parameter" warnings
++#pragma warning( push )
++#pragma warning( disable: 4100 )
+
+ namespace boost { namespace concepts {
+
+@@ -111,4 +114,6 @@
+ # endif
+ }}
+
++#pragma warning( pop )
++
+ #endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
--- /dev/null
+--- misc/boost_1_44_0/boost/concept/detail/general.hpp
++++ misc/build/boost_1_44_0/boost/concept/detail/general.hpp
+@@ -68,7 +68,9 @@
+ # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
+ typedef ::boost::concepts::detail::instantiate< \
+ &::boost::concepts::requirement_<ModelFnPtr>::failed> \
+- BOOST_PP_CAT(boost_concept_check,__LINE__)
++ BOOST_PP_CAT(boost_concept_check,__LINE__); \
++ void BOOST_PP_CAT(boost_concept_check_dummy,__LINE__)(BOOST_PP_CAT(boost_concept_check,__LINE__) *)
++ // silence -Werror=unused-local-typedefs (GCC 4.8)
+
+ }}
+
--- /dev/null
+--- misc/boost_1_44_0/boost/boost/crc.hpp
++++ misc/build/boost_1_44_0/boost/boost/crc.hpp
+@@ -755,15 +755,15 @@ void
+ crc_basic<Bits>::process_bits
+ (
+ unsigned char bits,
+- std::size_t bit_count
++ std::size_t bit_count_
+ )
+ {
+ // ignore the bits above the ones we want
+- bits <<= CHAR_BIT - bit_count;
++ bits <<= CHAR_BIT - bit_count_;
+
+ // compute the CRC for each bit, starting with the upper ones
+ unsigned char const high_bit_mask = 1u << ( CHAR_BIT - 1u );
+- for ( std::size_t i = bit_count ; i > 0u ; --i, bits <<= 1u )
++ for ( std::size_t i = bit_count_ ; i > 0u ; --i, bits <<= 1u )
+ {
+ process_bit( static_cast<bool>(bits & high_bit_mask) );
+ }
--- /dev/null
+--- misc/boost_1_44_0/boost/date_time/date_names_put.hpp 2008-02-27 21:00:24.000000000 +0100
++++ misc/build/boost_1_44_0/boost/date_time/date_names_put.hpp 2011-10-05 16:58:58.413575307 +0200
+@@ -218,14 +218,14 @@
+ const charT* const weekday_long_names[],
+ charT separator_char = '-',
+ ymd_order_spec order_spec = ymd_order_iso,
+- month_format_spec month_format = month_as_short_string) :
++ month_format_spec month_format_ = month_as_short_string) :
+ month_short_names_(month_short_names),
+ month_long_names_(month_long_names),
+ special_value_names_(special_value_names),
+ weekday_short_names_(weekday_short_names),
+ weekday_long_names_(weekday_long_names),
+ order_spec_(order_spec),
+- month_format_spec_(month_format)
++ month_format_spec_(month_format_)
+ {
+ separator_char_[0] = separator_char;
+ separator_char_[1] = '\0';
--- /dev/null
+--- a/b/boost/boost/date_time/gregorian/greg_facet.hpp 2013-05-31 14:03:30.476695310 +0200
++++ a/b/boost/boost/date_time/gregorian/greg_facet.hpp 2013-05-31 14:03:22.894669713 +0200
+@@ -215,7 +215,6 @@
+ {
+ std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos;
+
+- typedef boost::date_time::all_date_names_put<greg_facet_config, charT> facet_def;
+ d = from_stream(beg, eos);
+ return is;
+ }
+--- misc/boost_1_44_0/boost/date_time/date_parsing.hpp
++++ misc/build/boost_1_44_0/boost/date_time/date_parsing.hpp
+@@ -113,7 +113,6 @@
+ spec_str = "mdy";
+ }
+
+- typedef typename date_type::year_type year_type;
+ typedef typename date_type::month_type month_type;
+ unsigned pos = 0;
+ unsigned short year(0), month(0), day(0);
+@@ -159,7 +158,7 @@
+ parse_undelimited_date(const std::string& s) {
+ int offsets[] = {4,2,2};
+ int pos = 0;
+- typedef typename date_type::year_type year_type;
++ //typedef typename date_type::year_type year_type;
+ //typename date_type::ymd_type ymd((year_type::min)(),1,1);
+ unsigned short y = 0, m = 0, d = 0;
+
+--- misc/boost_1_44_0/boost/date_time/local_time/local_time_io.hpp
++++ misc/build/boost_1_44_0/boost/date_time/local_time/local_time_io.hpp
+@@ -36,7 +36,6 @@
+ boost::io::ios_flags_saver iflags(os);
+ typedef local_date_time time_type;//::utc_time_type typename
+ typedef date_time::time_facet<time_type, CharT> custom_time_facet;
+- typedef std::time_put<CharT> std_time_facet;
+ std::ostreambuf_iterator<CharT> oitr(os);
+
+ if(std::has_facet<custom_time_facet>(os.getloc())) {
+@@ -123,7 +122,6 @@
+ const boost::local_time::local_time_period& p) {
+ boost::io::ios_flags_saver iflags(os);
+ typedef boost::date_time::time_facet<local_date_time, CharT> custom_facet;
+- typedef std::time_put<CharT> std_time_facet;
+ std::ostreambuf_iterator<CharT> oitr(os);
+ if (std::has_facet<custom_facet>(os.getloc())) {
+ std::use_facet<custom_facet>(os.getloc()).put(oitr, os, os.fill(), p);
+--- misc/boost_1_44_0/boost/date_time/posix_time/posix_time_io.hpp
++++ misc/build/boost_1_44_0/boost/date_time/posix_time/posix_time_io.hpp
+@@ -47,7 +47,6 @@
+ const ptime& p) {
+ boost::io::ios_flags_saver iflags(os);
+ typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet;
+- typedef std::time_put<CharT> std_ptime_facet;
+ std::ostreambuf_iterator<CharT> oitr(os);
+ if (std::has_facet<custom_ptime_facet>(os.getloc()))
+ std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), p);
+@@ -114,7 +113,6 @@
+ const boost::posix_time::time_period& p) {
+ boost::io::ios_flags_saver iflags(os);
+ typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet;
+- typedef std::time_put<CharT> std_time_facet;
+ std::ostreambuf_iterator<CharT> oitr(os);
+ if (std::has_facet<custom_ptime_facet>(os.getloc())) {
+ std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), p);
+@@ -180,7 +178,6 @@
+ {
+ boost::io::ios_flags_saver iflags(os);
+ typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet;
+- typedef std::time_put<CharT> std_ptime_facet;
+ std::ostreambuf_iterator<CharT> oitr(os);
+ if (std::has_facet<custom_ptime_facet>(os.getloc()))
+ std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), td);
+--- misc/boost_1_44_0/boost/date_time/string_convert.hpp
++++ misc/build/boost_1_44_0/boost/date_time/string_convert.hpp
+@@ -21,7 +21,6 @@
+ inline
+ std::basic_string<OutputT> convert_string_type(const std::basic_string<InputT>& inp_str)
+ {
+- typedef std::basic_string<InputT> input_type;
+ typedef std::basic_string<OutputT> output_type;
+ output_type result;
+ result.insert(result.begin(), inp_str.begin(), inp_str.end());
+--- misc/boost_1_44_0/boost/date_time/strings_from_facet.hpp
++++ misc/build/boost_1_44_0/boost/date_time/strings_from_facet.hpp
+@@ -35,7 +35,6 @@
+ {
+ typedef std::basic_string<charT> string_type;
+ typedef std::vector<string_type> collection_type;
+- typedef std::basic_ostringstream<charT> ostream_type;
+ typedef std::ostreambuf_iterator<charT> ostream_iter_type;
+ typedef std::basic_ostringstream<charT> stringstream_type;
+ typedef std::time_put<charT> time_put_facet_type;
+@@ -85,7 +84,6 @@
+ {
+ typedef std::basic_string<charT> string_type;
+ typedef std::vector<string_type> collection_type;
+- typedef std::basic_ostringstream<charT> ostream_type;
+ typedef std::ostreambuf_iterator<charT> ostream_iter_type;
+ typedef std::basic_ostringstream<charT> stringstream_type;
+ typedef std::time_put<charT> time_put_facet_type;
--- /dev/null
+--- foo/foo/foo/boost/predef/other/endian.h
++++ foo/foo/foo/boost/predef/other/endian.h
+@@ -53,7 +53,7 @@
+ */
+ #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
+ !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
+-# if BOOST_LIB_C_GNU
++# if BOOST_LIB_C_GNU || defined(__ANDROID__)
+ # include <endian.h>
+ # else
+ # if BOOST_OS_MACOS
--- /dev/null
+--- misc/boost_1_44_0/boost/utility/compare_pointees.hpp 2011-02-10 16:39:05.960176555 +0000
++++ misc/build/boost_1_44_0/boost/utility/compare_pointees.hpp 2011-02-10 16:40:59.091423279 +0000
+@@ -29,7 +29,11 @@
+ inline
+ bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+ {
+- return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
++ if (!x && !y)
++ return true;
++ if (!x || !y)
++ return false;
++ return (*x) == (*y);
+ }
+
+ template<class OptionalPointee>
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/primitives/impl/numerics.ipp 2011-03-02 12:22:47.222870106 +0000
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/primitives/impl/numerics.ipp 2011-03-02 12:22:47.222870106 +0000
+@@ -219,6 +219,20 @@
+ }
+ };
+
++ template <int Radix>
++ struct negative_accumulate<unsigned char, Radix>
++ {
++ // Use this accumulator if number is negative
++ static bool add(unsigned char& n, unsigned digit)
++ {
++ n *= Radix;
++ if (n < digit)
++ return false;
++ n -= digit;
++ return true;
++ }
++ };
++
+ template <int MaxDigits>
+ inline bool allow_more_digits(std::size_t i)
+ {
+--- misc/boost_1_44_0/boost/optional/optional.hpp 2011-04-05 13:19:01.223587256 +0100
++++ misc/build/boost_1_44_0/boost/optional/optional.hpp 2011-04-05 13:19:01.223587256 +0100
+@@ -31,6 +31,8 @@
+
+ #include <boost/optional/optional_fwd.hpp>
+
++#include <string.h>
++
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ // VC6.0 has the following bug:
+ // When a templated assignment operator exist, an implicit conversion
+@@ -114,6 +116,11 @@
+
+ public:
+
++ aligned_storage()
++ {
++ memset(&dummy_, 0, sizeof(dummy_));
++ }
++
+ #if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
+ void const* address() const { return &dummy_; }
+ void * address() { return &dummy_; }
--- /dev/null
+--- foo/foo/foo/boost/lexical_cast.hpp
++++ foo/foo/foo/boost/lexical_cast.hpp
+@@ -1016,7 +1016,7 @@
+ if( !has_minus ) value = std::numeric_limits<T>::quiet_NaN();
+ else value = (boost::math::changesign) (std::numeric_limits<T>::quiet_NaN());
+ return true;
+- } else
++ } else {
+ if (( /* 'INF' or 'inf' */
+ end-begin==3
+ &&
+@@ -1031,6 +1031,7 @@
+ else value = (boost::math::changesign) (std::numeric_limits<T>::infinity());
+ return true;
+ }
++ }
+
+ return false;
+ }
--- /dev/null
+--- boost/math/special_functions/detail/lanczos_sse2.hpp
++++ boost/math/special_functions/detail/lanczos_sse2.hpp
+@@ -51,11 +51,11 @@
+ static_cast<double>(23531376880.41075968857200767445163675473L),
+ static_cast<double>(0u)
+ };
+- register __m128d vx = _mm_load1_pd(&x);
+- register __m128d sum_even = _mm_load_pd(coeff);
+- register __m128d sum_odd = _mm_load_pd(coeff+2);
+- register __m128d nc_odd, nc_even;
+- register __m128d vx2 = _mm_mul_pd(vx, vx);
++ __m128d vx = _mm_load1_pd(&x);
++ __m128d sum_even = _mm_load_pd(coeff);
++ __m128d sum_odd = _mm_load_pd(coeff+2);
++ __m128d nc_odd, nc_even;
++ __m128d vx2 = _mm_mul_pd(vx, vx);
+
+ sum_even = _mm_mul_pd(sum_even, vx2);
+ nc_even = _mm_load_pd(coeff + 4);
+@@ -136,11 +136,11 @@
+ static_cast<double>(56906521.91347156388090791033559122686859L),
+ static_cast<double>(0u)
+ };
+- register __m128d vx = _mm_load1_pd(&x);
+- register __m128d sum_even = _mm_load_pd(coeff);
+- register __m128d sum_odd = _mm_load_pd(coeff+2);
+- register __m128d nc_odd, nc_even;
+- register __m128d vx2 = _mm_mul_pd(vx, vx);
++ __m128d vx = _mm_load1_pd(&x);
++ __m128d sum_even = _mm_load_pd(coeff);
++ __m128d sum_odd = _mm_load_pd(coeff+2);
++ __m128d nc_odd, nc_even;
++ __m128d vx2 = _mm_mul_pd(vx, vx);
+
+ sum_even = _mm_mul_pd(sum_even, vx2);
+ nc_even = _mm_load_pd(coeff + 4);
--- /dev/null
+--- a/b/boost/boost/math/special_functions/fpclassify.hpp 2013-05-31 14:02:13.660436127 +0200
++++ a/b/boost/boost/math/special_functions/fpclassify.hpp 2013-05-31 14:01:17.372246240 +0200
+@@ -339,7 +338,6 @@
+ { //!< \brief return true if floating-point type t is finite.
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+- typedef boost::is_floating_point<long double>::type fp_tag;
+ typedef long double value_type;
+ return detail::isfinite_impl(static_cast<value_type>(x), method());
+ }
+@@ -410,7 +407,6 @@
+ {
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+- typedef boost::is_floating_point<long double>::type fp_tag;
+ typedef long double value_type;
+ return detail::isnormal_impl(static_cast<value_type>(x), method());
+ }
+@@ -499,7 +494,6 @@
+ {
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+- typedef boost::is_floating_point<long double>::type fp_tag;
+ typedef long double value_type;
+ return detail::isinf_impl(static_cast<value_type>(x), method());
+ }
+@@ -585,7 +578,6 @@
+ { //!< \brief return true if floating-point type t is NaN (Not A Number).
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+- typedef boost::is_floating_point<long double>::type fp_tag;
+ return detail::isnan_impl(x, method());
+ }
+ #endif
--- /dev/null
+--- misc/boost_1_44_0/boost/multi_array/concept_checks.hpp
++++ misc/build/boost_1_44_0/boost/multi_array/concept_checks.hpp
+@@ -56,6 +56,13 @@
+
+ } // namespace detail
+
++// MSVC 2008 produces 2 warnings "default constructor could not be generated"
++// here that run over ~100 lines :(
++#ifdef _MSC_VER
++#pragma warning(push,1)
++#pragma warning(disable: 4510)
++#pragma warning(disable: 4610)
++#endif
+
+ template <typename Array, std::size_t NumDims >
+ struct ConstMultiArrayConcept
+@@ -117,6 +124,9 @@
+ index_range range;
+ };
+
++#ifdef _MSC_VER
++#pragma warning(pop)
++#endif
+
+ template <typename Array, std::size_t NumDims >
+ struct MutableMultiArrayConcept
--- /dev/null
+From d28b2bc733d85b0bb194f395375f2a460b9be00d Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl@redhat.com>
+Date: Wed, 30 Apr 2014 12:27:55 +0200
+Subject: [PATCH] multi_array: suppress GCC -Wshadow warnings (fixes: #9886)
+
+---
+ include/boost/multi_array.hpp | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/include/boost/multi_array.hpp b/include/boost/multi_array.hpp
+index 8193699..72b2294 100644
+--- a/include/boost/multi_array.hpp
++++ b/include/boost/multi_array.hpp
+@@ -18,6 +18,16 @@
+ // declaration and definition
+ //
+
++#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406)
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
++#if defined(__clang__)
++# pragma clang diagnostic push
++# pragma clang diagnostic ignored "-Wshadow"
++#endif
++
+ #include "boost/multi_array/base.hpp"
+ #include "boost/multi_array/collection_concept.hpp"
+ #include "boost/multi_array/copy_array.hpp"
+@@ -496,4 +501,12 @@ private:
+
+ } // namespace boost
+
++#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406)
++# pragma GCC diagnostic pop
++#endif
++
++#if defined(__clang__)
++# pragma clang diagnostic pop
++#endif
++
+ #endif // BOOST_MULTI_ARRAY_RG071801_HPP
+--
+1.8.3.1
+
--- /dev/null
+--- foo/foo/foo/boost/multi_array/base.hpp
++++ foo/foo/foo/boost/multi_array/base.hpp
+@@ -65,7 +65,7 @@
+ // object creation in small-memory environments. Thus, the objects
+ // can be left undefined by defining BOOST_MULTI_ARRAY_NO_GENERATORS
+ // before loading multi_array.hpp.
+-#if !BOOST_MULTI_ARRAY_NO_GENERATORS
++#if !defined(BOOST_MULTI_ARRAY_NO_GENERATORS) || !BOOST_MULTI_ARRAY_NO_GENERATORS
+ namespace {
+ multi_array_types::extent_gen extents;
+ multi_array_types::index_gen indices;
--- /dev/null
+--- misc/boost_1_44_0/boost/multi_array/concept_checks.hpp
++++ misc/build/boost_1_44_0/boost/multi_array/concept_checks.hpp
+@@ -39,8 +39,6 @@
+
+ template <typename Array, typename IdxGen, typename Call_Type>
+ static void call(Array& a, const IdxGen& idgen, Call_Type c) {
+- typedef typename Array::index_range index_range;
+- typedef typename Array::index index;
+ idgen_helper<N-1>::call(a,idgen[c],c);
+ }
+ };
+@@ -50,8 +48,6 @@
+
+ template <typename Array, typename IdxGen, typename Call_Type>
+ static void call(Array& a, const IdxGen& idgen, Call_Type) {
+- typedef typename Array::index_range index_range;
+- typedef typename Array::index index;
+ a[ idgen ];
+ }
+ };
--- /dev/null
+--- boost/boost/multi_index/sequenced_index.hpp 2008-07-03 18:51:53.000000000 +0200
++++ boost/boost/multi_index/sequenced_index.hpp 2013-05-17 15:44:15.265289335 +0200
+@@ -346,7 +346,7 @@
+ }
+
+ template<typename Modifier,typename Rollback>
+- bool modify(iterator position,Modifier mod,Rollback back)
++ bool modify(iterator position,Modifier mod,Rollback back_)
+ {
+ BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
+ BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
+@@ -363,7 +363,7 @@
+ #endif
+
+ return this->final_modify_(
+- mod,back,static_cast<final_node_type*>(position.get_node()));
++ mod,back_,static_cast<final_node_type*>(position.get_node()));
+ }
+
+ void swap(sequenced_index<SuperMeta,TagList>& x)
+--- boost/boost/multi_index_container.hpp 2010-07-24 11:20:29.000000000 +0200
++++ boost/boost/multi_index_container.hpp 2013-05-17 15:45:56.723899853 +0200
+@@ -360,7 +360,7 @@
+ IteratorType it
+ BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
+ {
+- typedef typename nth_index<N>::type index;
++ typedef typename nth_index<N>::type index_;
+
+ #if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
+ BOOST_STATIC_ASSERT(
+@@ -371,7 +371,7 @@
+ BOOST_MULTI_INDEX_CHECK_IS_OWNER(
+ it,static_cast<typename IteratorType::container_type&>(*this));
+
+- return index::make_iterator(static_cast<node_type*>(it.get_node()));
++ return index_::make_iterator(static_cast<node_type*>(it.get_node()));
+ }
+
+ template<int N,typename IteratorType>
+@@ -379,7 +379,7 @@
+ IteratorType it
+ BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))const
+ {
+- typedef typename nth_index<N>::type index;
++ typedef typename nth_index<N>::type index_;
+
+ #if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
+ BOOST_STATIC_ASSERT((
+@@ -390,7 +390,7 @@
+ BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
+ BOOST_MULTI_INDEX_CHECK_IS_OWNER(
+ it,static_cast<const typename IteratorType::container_type&>(*this));
+- return index::make_iterator(static_cast<node_type*>(it.get_node()));
++ return index_::make_iterator(static_cast<node_type*>(it.get_node()));
+ }
+ #endif
+
+@@ -414,7 +414,7 @@
+ IteratorType it
+ BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))
+ {
+- typedef typename index<Tag>::type index;
++ typedef typename index<Tag>::type index_;
+
+ #if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
+ BOOST_STATIC_ASSERT(
+@@ -424,7 +424,7 @@
+ BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
+ BOOST_MULTI_INDEX_CHECK_IS_OWNER(
+ it,static_cast<typename IteratorType::container_type&>(*this));
+- return index::make_iterator(static_cast<node_type*>(it.get_node()));
++ return index_::make_iterator(static_cast<node_type*>(it.get_node()));
+ }
+
+ template<typename Tag,typename IteratorType>
+@@ -432,7 +432,7 @@
+ IteratorType it
+ BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))const
+ {
+- typedef typename index<Tag>::type index;
++ typedef typename index<Tag>::type index_;
+
+ #if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
+ BOOST_STATIC_ASSERT((
+@@ -443,7 +443,7 @@
+ BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
+ BOOST_MULTI_INDEX_CHECK_IS_OWNER(
+ it,static_cast<const typename IteratorType::container_type&>(*this));
+- return index::make_iterator(static_cast<node_type*>(it.get_node()));
++ return index_::make_iterator(static_cast<node_type*>(it.get_node()));
+ }
+ #endif
+
--- /dev/null
+--- foo/foo/foo/boost/predef/other/endian.h
++++ foo/foo/foo/boost/predef/other/endian.h
+@@ -77,7 +77,7 @@
+ # undef BOOST_ENDIAN_LITTLE_BYTE
+ # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+ # endif
+-# if (__BYTE_ORDER == __PDP_ENDIAN)
++# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
+ # undef BOOST_ENDIAN_LITTLE_WORD
+ # define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
+ # endif
--- /dev/null
+--- foo/foo/foo/boost/preprocessor/config/config.hpp
++++ foo/foo/foo/boost/preprocessor/config/config.hpp
+@@ -90,7 +90,7 @@
+ # define BOOST_PP_VARIADICS 0
+ # endif
+ # /* Wave (C/C++), GCC (C++) */
+-# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__
++# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && defined __GXX_EXPERIMENTAL_CXX0X__ && __GXX_EXPERIMENTAL_CXX0X__
+ # define BOOST_PP_VARIADICS 1
+ # /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */
+ # elif !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
+--- foo/foo/foo/boost/preprocessor/tuple/elem.hpp
++++ foo/foo/foo/boost/preprocessor/tuple/elem.hpp
+@@ -22,7 +22,7 @@
+ # include <boost/preprocessor/variadic/elem.hpp>
+ #
+ # if BOOST_PP_VARIADICS
+-# if BOOST_PP_VARIADICS_MSVC
++# if defined(BOOST_PP_VARIADICS_MSVC) && BOOST_PP_VARIADICS_MSVC
+ # define BOOST_PP_TUPLE_ELEM(...) BOOST_PP_TUPLE_ELEM_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__), (__VA_ARGS__))
+ # define BOOST_PP_TUPLE_ELEM_I(m, args) BOOST_PP_TUPLE_ELEM_II(m, args)
+ # define BOOST_PP_TUPLE_ELEM_II(m, args) BOOST_PP_CAT(m ## args,)
+--- foo/foo/foo/boost/preprocessor/tuple/rem.hpp
++++ foo/foo/foo/boost/preprocessor/tuple/rem.hpp
+@@ -105,7 +105,7 @@
+ # /* BOOST_PP_TUPLE_REM_CTOR */
+ #
+ # if BOOST_PP_VARIADICS
+-# if BOOST_PP_VARIADICS_MSVC
++# if defined(BOOST_PP_VARIADICS_MSVC) && BOOST_PP_VARIADICS_MSVC
+ # define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_TUPLE_REM_CTOR_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__), (__VA_ARGS__))
+ # define BOOST_PP_TUPLE_REM_CTOR_I(m, args) BOOST_PP_TUPLE_REM_CTOR_II(m, args)
+ # define BOOST_PP_TUPLE_REM_CTOR_II(m, args) BOOST_PP_CAT(m ## args,)
+--- foo/foo/foo/boost/preprocessor/tuple/to_list.hpp
++++ foo/foo/foo/boost/preprocessor/tuple/to_list.hpp
+@@ -23,7 +23,7 @@
+ # /* BOOST_PP_TUPLE_TO_LIST */
+ #
+ # if BOOST_PP_VARIADICS
+-# if BOOST_PP_VARIADICS_MSVC
++# if defined(BOOST_PP_VARIADICS_MSVC) && BOOST_PP_VARIADICS_MSVC
+ # define BOOST_PP_TUPLE_TO_LIST(...) BOOST_PP_TUPLE_TO_LIST_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_LIST_O_, __VA_ARGS__), (__VA_ARGS__))
+ # define BOOST_PP_TUPLE_TO_LIST_I(m, args) BOOST_PP_TUPLE_TO_LIST_II(m, args)
+ # define BOOST_PP_TUPLE_TO_LIST_II(m, args) BOOST_PP_CAT(m ## args,)
+--- foo/foo/foo/boost/preprocessor/variadic/elem.hpp
++++ foo/foo/foo/boost/preprocessor/variadic/elem.hpp
+@@ -19,7 +19,7 @@
+ # /* BOOST_PP_VARIADIC_ELEM */
+ #
+ # if BOOST_PP_VARIADICS
+-# if BOOST_PP_VARIADICS_MSVC
++# if defined(BOOST_PP_VARIADICS_MSVC) && BOOST_PP_VARIADICS_MSVC
+ # define BOOST_PP_VARIADIC_ELEM(n, ...) BOOST_PP_VARIADIC_ELEM_I(n,__VA_ARGS__)
+ # define BOOST_PP_VARIADIC_ELEM_I(n, ...) BOOST_PP_CAT(BOOST_PP_CAT(BOOST_PP_VARIADIC_ELEM_, n)(__VA_ARGS__,),)
+ # else
+--- foo/foo/foo/boost/preprocessor/variadic/size.hpp
++++ foo/foo/foo/boost/preprocessor/variadic/size.hpp
+@@ -19,7 +19,7 @@
+ # /* BOOST_PP_VARIADIC_SIZE */
+ #
+ # if BOOST_PP_VARIADICS
+-# if BOOST_PP_VARIADICS_MSVC
++# if defined(BOOST_PP_VARIADICS_MSVC) && BOOST_PP_VARIADICS_MSVC
+ # define BOOST_PP_VARIADIC_SIZE(...) BOOST_PP_CAT(BOOST_PP_VARIADIC_SIZE_I(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,),)
+ # else
+ # define BOOST_PP_VARIADIC_SIZE(...) BOOST_PP_VARIADIC_SIZE_I(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,)
--- /dev/null
+--- boost/boost/property_tree/detail/json_parser_error.hpp 2007-05-13 00:02:53.000000000 +0200
++++ boost/boost/property_tree/detail/json_parser_error.hpp 2013-05-17 15:36:44.605902442 +0200
+@@ -20,10 +20,10 @@
+ class json_parser_error: public file_parser_error
+ {
+ public:
+- json_parser_error(const std::string &message,
+- const std::string &filename,
+- unsigned long line):
+- file_parser_error(message, filename, line)
++ json_parser_error(const std::string &message_,
++ const std::string &filename_,
++ unsigned long line_):
++ file_parser_error(message_, filename_, line_)
+ {
+ }
+ };
+--- boost/boost/property_tree/detail/json_parser_read.hpp 2013-05-17 15:57:23.740638395 +0200
++++ boost/boost/property_tree/detail/json_parser_read.hpp 2013-05-17 15:31:05.666857356 +0200
+@@ -45,7 +45,7 @@
+ struct a_object_s
+ {
+ context &c;
+- a_object_s(context &c): c(c) { }
++ a_object_s(context &c_): c(c_) { }
+ void operator()(Ch) const
+ {
+ if (c.stack.empty())
+@@ -63,7 +63,7 @@
+ struct a_object_e
+ {
+ context &c;
+- a_object_e(context &c): c(c) { }
++ a_object_e(context &c_): c(c_) { }
+ void operator()(Ch) const
+ {
+ BOOST_ASSERT(c.stack.size() >= 1);
+@@ -74,7 +74,7 @@
+ struct a_name
+ {
+ context &c;
+- a_name(context &c): c(c) { }
++ a_name(context &c_): c(c_) { }
+ void operator()(It, It) const
+ {
+ c.name.swap(c.string);
+@@ -85,7 +85,7 @@
+ struct a_string_val
+ {
+ context &c;
+- a_string_val(context &c): c(c) { }
++ a_string_val(context &c_): c(c_) { }
+ void operator()(It, It) const
+ {
+ BOOST_ASSERT(c.stack.size() >= 1);
+@@ -98,7 +98,7 @@
+ struct a_literal_val
+ {
+ context &c;
+- a_literal_val(context &c): c(c) { }
++ a_literal_val(context &c_): c(c_) { }
+ void operator()(It b, It e) const
+ {
+ BOOST_ASSERT(c.stack.size() >= 1);
+@@ -111,8 +111,8 @@
+ struct a_char
+ {
+ context &c;
+- a_char(context &c): c(c) { }
+- void operator()(It b, It e) const
++ a_char(context &c_): c(c_) { }
++ void operator()(It b, It /* e */) const
+ {
+ c.string += *b;
+ }
+@@ -121,7 +121,7 @@
+ struct a_escape
+ {
+ context &c;
+- a_escape(context &c): c(c) { }
++ a_escape(context &c_): c(c_) { }
+ void operator()(Ch ch) const
+ {
+ switch (ch)
+@@ -142,7 +142,7 @@
+ struct a_unicode
+ {
+ context &c;
+- a_unicode(context &c): c(c) { }
++ a_unicode(context &c_): c(c_) { }
+ void operator()(unsigned long u) const
+ {
+ u = (std::min)(u, static_cast<unsigned long>((std::numeric_limits<Ch>::max)()));
+--- boost/boost/property_tree/detail/ptree_implementation.hpp 2010-07-03 22:59:45.000000000 +0200
++++ boost/boost/property_tree/detail/ptree_implementation.hpp 2013-05-17 15:55:56.449713452 +0200
+@@ -539,48 +539,48 @@
+
+ template<class K, class D, class C>
+ basic_ptree<K, D, C> &
+- basic_ptree<K, D, C>::get_child(const path_type &path)
++ basic_ptree<K, D, C>::get_child(const path_type &path_)
+ {
+- path_type p(path);
++ path_type p(path_);
+ self_type *n = walk_path(p);
+ if (!n) {
+- BOOST_PROPERTY_TREE_THROW(ptree_bad_path("No such node", path));
++ BOOST_PROPERTY_TREE_THROW(ptree_bad_path("No such node", path_));
+ }
+ return *n;
+ }
+
+ template<class K, class D, class C> inline
+ const basic_ptree<K, D, C> &
+- basic_ptree<K, D, C>::get_child(const path_type &path) const
++ basic_ptree<K, D, C>::get_child(const path_type &path_) const
+ {
+- return const_cast<self_type*>(this)->get_child(path);
++ return const_cast<self_type*>(this)->get_child(path_);
+ }
+
+ template<class K, class D, class C> inline
+ basic_ptree<K, D, C> &
+- basic_ptree<K, D, C>::get_child(const path_type &path,
++ basic_ptree<K, D, C>::get_child(const path_type &path_,
+ self_type &default_value)
+ {
+- path_type p(path);
++ path_type p(path_);
+ self_type *n = walk_path(p);
+ return n ? *n : default_value;
+ }
+
+ template<class K, class D, class C> inline
+ const basic_ptree<K, D, C> &
+- basic_ptree<K, D, C>::get_child(const path_type &path,
++ basic_ptree<K, D, C>::get_child(const path_type &path_,
+ const self_type &default_value) const
+ {
+- return const_cast<self_type*>(this)->get_child(path,
++ return const_cast<self_type*>(this)->get_child(path_,
+ const_cast<self_type&>(default_value));
+ }
+
+
+ template<class K, class D, class C>
+ optional<basic_ptree<K, D, C> &>
+- basic_ptree<K, D, C>::get_child_optional(const path_type &path)
++ basic_ptree<K, D, C>::get_child_optional(const path_type &path_)
+ {
+- path_type p(path);
++ path_type p(path_);
+ self_type *n = walk_path(p);
+ if (!n) {
+ return optional<self_type&>();
+@@ -590,9 +590,9 @@
+
+ template<class K, class D, class C>
+ optional<const basic_ptree<K, D, C> &>
+- basic_ptree<K, D, C>::get_child_optional(const path_type &path) const
++ basic_ptree<K, D, C>::get_child_optional(const path_type &path_) const
+ {
+- path_type p(path);
++ path_type p(path_);
+ self_type *n = walk_path(p);
+ if (!n) {
+ return optional<const self_type&>();
+@@ -602,10 +602,10 @@
+
+ template<class K, class D, class C>
+ basic_ptree<K, D, C> &
+- basic_ptree<K, D, C>::put_child(const path_type &path,
++ basic_ptree<K, D, C>::put_child(const path_type &path_,
+ const self_type &value)
+ {
+- path_type p(path);
++ path_type p(path_);
+ self_type &parent = force_path(p);
+ // Got the parent. Now get the correct child.
+ key_type fragment = p.reduce();
+@@ -620,10 +620,10 @@
+
+ template<class K, class D, class C>
+ basic_ptree<K, D, C> &
+- basic_ptree<K, D, C>::add_child(const path_type &path,
++ basic_ptree<K, D, C>::add_child(const path_type &path_,
+ const self_type &value)
+ {
+- path_type p(path);
++ path_type p(path_);
+ self_type &parent = force_path(p);
+ // Got the parent.
+ key_type fragment = p.reduce();
+@@ -709,26 +709,26 @@
+ template<class K, class D, class C>
+ template<class Type, class Translator> inline
+ typename boost::enable_if<detail::is_translator<Translator>, Type>::type
+- basic_ptree<K, D, C>::get(const path_type &path,
++ basic_ptree<K, D, C>::get(const path_type &path_,
+ Translator tr) const
+ {
+- return get_child(path).BOOST_NESTED_TEMPLATE get_value<Type>(tr);
++ return get_child(path_).BOOST_NESTED_TEMPLATE get_value<Type>(tr);
+ }
+
+ template<class K, class D, class C>
+ template<class Type> inline
+- Type basic_ptree<K, D, C>::get(const path_type &path) const
++ Type basic_ptree<K, D, C>::get(const path_type &path_) const
+ {
+- return get_child(path).BOOST_NESTED_TEMPLATE get_value<Type>();
++ return get_child(path_).BOOST_NESTED_TEMPLATE get_value<Type>();
+ }
+
+ template<class K, class D, class C>
+ template<class Type, class Translator> inline
+- Type basic_ptree<K, D, C>::get(const path_type &path,
++ Type basic_ptree<K, D, C>::get(const path_type &path_,
+ const Type &default_value,
+ Translator tr) const
+ {
+- return get_optional<Type>(path, tr).get_value_or(default_value);
++ return get_optional<Type>(path_, tr).get_value_or(default_value);
+ }
+
+ template<class K, class D, class C>
+@@ -738,18 +738,18 @@
+ std::basic_string<Ch>
+ >::type
+ basic_ptree<K, D, C>::get(
+- const path_type &path, const Ch *default_value, Translator tr) const
++ const path_type &path_, const Ch *default_value, Translator tr) const
+ {
+- return get<std::basic_string<Ch>, Translator>(path, default_value, tr);
++ return get<std::basic_string<Ch>, Translator>(path_, default_value, tr);
+ }
+
+ template<class K, class D, class C>
+ template<class Type> inline
+ typename boost::disable_if<detail::is_translator<Type>, Type>::type
+- basic_ptree<K, D, C>::get(const path_type &path,
++ basic_ptree<K, D, C>::get(const path_type &path_,
+ const Type &default_value) const
+ {
+- return get_optional<Type>(path).get_value_or(default_value);
++ return get_optional<Type>(path_).get_value_or(default_value);
+ }
+
+ template<class K, class D, class C>
+@@ -759,17 +759,17 @@
+ std::basic_string<Ch>
+ >::type
+ basic_ptree<K, D, C>::get(
+- const path_type &path, const Ch *default_value) const
++ const path_type &path_, const Ch *default_value) const
+ {
+- return get< std::basic_string<Ch> >(path, default_value);
++ return get< std::basic_string<Ch> >(path_, default_value);
+ }
+
+ template<class K, class D, class C>
+ template<class Type, class Translator>
+- optional<Type> basic_ptree<K, D, C>::get_optional(const path_type &path,
++ optional<Type> basic_ptree<K, D, C>::get_optional(const path_type &path_,
+ Translator tr) const
+ {
+- if (optional<const self_type&> child = get_child_optional(path))
++ if (optional<const self_type&> child = get_child_optional(path_))
+ return child.get().
+ BOOST_NESTED_TEMPLATE get_value_optional<Type>(tr);
+ else
+@@ -778,9 +778,9 @@
+ template<class K, class D, class C>
+ template<class Type>
+ optional<Type> basic_ptree<K, D, C>::get_optional(
+- const path_type &path) const
++ const path_type &path_) const
+ {
+- if (optional<const self_type&> child = get_child_optional(path))
++ if (optional<const self_type&> child = get_child_optional(path_))
+ return child.get().BOOST_NESTED_TEMPLATE get_value_optional<Type>();
+ else
+ return optional<Type>();
+@@ -809,13 +809,13 @@
+ template<class K, class D, class C>
+ template<class Type, typename Translator>
+ basic_ptree<K, D, C> & basic_ptree<K, D, C>::put(
+- const path_type &path, const Type &value, Translator tr)
++ const path_type &path_, const Type &value, Translator tr)
+ {
+- if(optional<self_type &> child = get_child_optional(path)) {
++ if(optional<self_type &> child = get_child_optional(path_)) {
+ child.get().put_value(value, tr);
+ return *child;
+ } else {
+- self_type &child2 = put_child(path, self_type());
++ self_type &child2 = put_child(path_, self_type());
+ child2.put_value(value, tr);
+ return child2;
+ }
+@@ -824,18 +824,18 @@
+ template<class K, class D, class C>
+ template<class Type> inline
+ basic_ptree<K, D, C> & basic_ptree<K, D, C>::put(
+- const path_type &path, const Type &value)
++ const path_type &path_, const Type &value)
+ {
+- return put(path, value,
++ return put(path_, value,
+ typename translator_between<data_type, Type>::type());
+ }
+
+ template<class K, class D, class C>
+ template<class Type, typename Translator> inline
+ basic_ptree<K, D, C> & basic_ptree<K, D, C>::add(
+- const path_type &path, const Type &value, Translator tr)
++ const path_type &path_, const Type &value, Translator tr)
+ {
+- self_type &child = add_child(path, self_type());
++ self_type &child = add_child(path_, self_type());
+ child.put_value(value, tr);
+ return child;
+ }
+@@ -843,9 +843,9 @@
+ template<class K, class D, class C>
+ template<class Type> inline
+ basic_ptree<K, D, C> & basic_ptree<K, D, C>::add(
+- const path_type &path, const Type &value)
++ const path_type &path_, const Type &value)
+ {
+- return add(path, value,
++ return add(path_, value,
+ typename translator_between<data_type, Type>::type());
+ }
+
+--- a/boost/property_tree/string_path.hpp
++++ a/boost/property_tree/string_path.hpp
+@@ -88,14 +88,14 @@ namespace boost { namespace property_tree
+ typedef typename String::value_type char_type;
+
+ /// Create an empty path.
+- explicit string_path(char_type separator = char_type('.'));
++ explicit string_path(char_type separator_ = char_type('.'));
+ /// Create a path by parsing the given string.
+ /// @param value A sequence, possibly with separators, that describes
+ /// the path, e.g. "one.two.three".
+ /// @param separator The separator used in parsing. Defaults to '.'.
+ /// @param tr The translator used by this path to convert the individual
+ /// parts to keys.
+- string_path(const String &value, char_type separator = char_type('.'),
++ string_path(const String &value, char_type separator_ = char_type('.'),
+ Translator tr = Translator());
+ /// Create a path by parsing the given string.
+ /// @param value A zero-terminated array of values. Only use if zero-
+@@ -106,7 +106,7 @@ namespace boost { namespace property_tree
+ /// @param tr The translator used by this path to convert the individual
+ /// parts to keys.
+ string_path(const char_type *value,
+- char_type separator = char_type('.'),
++ char_type separator_ = char_type('.'),
+ Translator tr = Translator());
+
+ // Default copying doesn't do the right thing with the iterator
+@@ -162,23 +162,23 @@ namespace boost { namespace property_tree
+ };
+
+ template <typename String, typename Translator> inline
+- string_path<String, Translator>::string_path(char_type separator)
+- : m_separator(separator), m_start(m_value.begin())
++ string_path<String, Translator>::string_path(char_type separator_)
++ : m_separator(separator_), m_start(m_value.begin())
+ {}
+
+ template <typename String, typename Translator> inline
+ string_path<String, Translator>::string_path(const String &value,
+- char_type separator,
++ char_type separator_,
+ Translator tr)
+- : m_value(value), m_separator(separator),
++ : m_value(value), m_separator(separator_),
+ m_tr(tr), m_start(m_value.begin())
+ {}
+
+ template <typename String, typename Translator> inline
+ string_path<String, Translator>::string_path(const char_type *value,
+- char_type separator,
++ char_type separator_,
+ Translator tr)
+- : m_value(value), m_separator(separator),
++ : m_value(value), m_separator(separator_),
+ m_tr(tr), m_start(m_value.begin())
+ {}
+
--- /dev/null
+diff -ur boost.org/boost/property_tree/detail/json_parser_write.hpp boost/boost/property_tree/detail/json_parser_write.hpp
+--- boost.org/boost/property_tree/detail/json_parser_write.hpp 2014-04-20 13:27:59.126224368 +0300
++++ boost/boost/property_tree/detail/json_parser_write.hpp 2014-04-20 13:32:35.206229552 +0300
+@@ -29,25 +29,26 @@
+ typename std::basic_string<Ch>::const_iterator e = s.end();
+ while (b != e)
+ {
++ typename std::basic_string<Ch>::traits_type::int_type bDref = *b;
+ // This assumes an ASCII superset. But so does everything in PTree.
+ // We escape everything outside ASCII, because this code can't
+ // handle high unicode characters.
+- if (*b == 0x20 || *b == 0x21 || (*b >= 0x23 && *b <= 0x2E) ||
+- (*b >= 0x30 && *b <= 0x5B) || (*b >= 0x5D && *b <= 0xFF))
+- result += *b;
+- else if (*b == Ch('\b')) result += Ch('\\'), result += Ch('b');
+- else if (*b == Ch('\f')) result += Ch('\\'), result += Ch('f');
+- else if (*b == Ch('\n')) result += Ch('\\'), result += Ch('n');
+- else if (*b == Ch('\r')) result += Ch('\\'), result += Ch('r');
+- else if (*b == Ch('/')) result += Ch('\\'), result += Ch('/');
+- else if (*b == Ch('"')) result += Ch('\\'), result += Ch('"');
+- else if (*b == Ch('\\')) result += Ch('\\'), result += Ch('\\');
++ if (bDref == 0x20 || bDref == 0x21 || (bDref >= 0x23 && bDref <= 0x2E) ||
++ (bDref >= 0x30 && bDref <= 0x5B) || (bDref >= 0x5D && bDref <= 0xFF))
++ result += bDref;
++ else if (bDref == Ch('\b')) result += Ch('\\'), result += Ch('b');
++ else if (bDref == Ch('\f')) result += Ch('\\'), result += Ch('f');
++ else if (bDref == Ch('\n')) result += Ch('\\'), result += Ch('n');
++ else if (bDref == Ch('\r')) result += Ch('\\'), result += Ch('r');
++ else if (bDref == Ch('/')) result += Ch('\\'), result += Ch('/');
++ else if (bDref == Ch('"')) result += Ch('\\'), result += Ch('"');
++ else if (bDref == Ch('\\')) result += Ch('\\'), result += Ch('\\');
+ else
+ {
+ const char *hexdigits = "0123456789ABCDEF";
+ typedef typename make_unsigned<Ch>::type UCh;
+ unsigned long u = (std::min)(static_cast<unsigned long>(
+- static_cast<UCh>(*b)),
++ static_cast<UCh>(bDref)),
+ 0xFFFFul);
+ int d1 = u / 4096; u -= d1 * 4096;
+ int d2 = u / 256; u -= d2 * 256;
--- /dev/null
+base class ‘class boost::ptr_container_detail::ptr_map_adapter_base<chart::VDataSequence, std::__debug::map<rtl::OUString, void*, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, void*> > >, boost::heap_clone_allocator, true>’ should be explicitly initialized in the copy constructor [-Werror=extra]
+
+--- misc/boost_1_44_0/boost/ptr_container/ptr_map_adapter.hpp 2008-06-24 22:37:35.000000000 +0200
++++ misc/build/boost_1_44_0/boost/ptr_container/ptr_map_adapter.hpp 2011-02-04 16:39:19.000000000 +0100
+@@ -477,6 +477,7 @@
+ }
+
+ ptr_map_adapter( const ptr_map_adapter& r )
++ : base_type()
+ {
+ map_basic_clone_and_insert( r.begin(), r.end() );
+ }
--- /dev/null
+--- misc/boost_1_44_0/boost/ptr_container/detail/map_iterator.hpp 2008-06-24 22:37:35.000000000 +0200
++++ misc/build/boost_1_44_0/boost/ptr_container/detail/map_iterator.hpp 2011-02-04 16:39:19.000000000 +0100
+@@ -49,7 +49,7 @@
+ : first(rp->first), second(rp->second)
+ { }
+
+- const ref_pair* const operator->() const
++ const ref_pair* operator->() const
+ {
+ return this;
+ }
--- /dev/null
+--- misc/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp 2009-11-01 12:07:12.000000000 +0100
++++ misc/build/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp 2011-02-04 16:39:19.000000000 +0100
+@@ -476,19 +476,19 @@
+ public: // C-array support
+
+ void transfer( iterator before, value_type* from,
+- size_type size, bool delete_from = true ) // strong
++ size_type size_, bool delete_from = true ) // strong
+ {
+ BOOST_ASSERT( from != 0 );
+ if( delete_from )
+ {
+ BOOST_DEDUCED_TYPENAME base_type::scoped_deleter
+- deleter( from, size ); // nothrow
+- this->base().insert( before.base(), from, from + size ); // strong
++ deleter( from, size_ ); // nothrow
++ this->base().insert( before.base(), from, from + size_ ); // strong
+ deleter.release(); // nothrow
+ }
+ else
+ {
+- this->base().insert( before.base(), from, from + size ); // strong
++ this->base().insert( before.base(), from, from + size_ ); // strong
+ }
+ }
+
+--- misc/boost_1_44_0/boost/ptr_container/exception.hpp 2011-02-05 09:42:56.074932485 +0000
++++ misc/build/boost_1_44_0/boost/ptr_container/exception.hpp 2011-02-05 09:43:00.350931536 +0000
+@@ -24,7 +24,7 @@
+ {
+ const char* what_;
+ public:
+- bad_ptr_container_operation( const char* what ) : what_( what )
++ bad_ptr_container_operation( const char* _what ) : what_( _what )
+ { }
+
+ virtual const char* what() const throw()
+@@ -38,7 +38,7 @@
+ class bad_index : public bad_ptr_container_operation
+ {
+ public:
+- bad_index( const char* what ) : bad_ptr_container_operation( what )
++ bad_index( const char* _what ) : bad_ptr_container_operation( _what )
+ { }
+ };
+
+--- misc/boost_1_44_0/boost/ptr_container/detail/reversible_ptr_container.hpp 2011-02-05 09:49:30.373931807 +0000
++++ misc/build/boost_1_44_0/boost/ptr_container/detail/reversible_ptr_container.hpp 2011-02-05 09:49:34.804931932 +0000
+@@ -278,9 +278,9 @@
+
+ private:
+ template< class ForwardIterator >
+- ForwardIterator advance( ForwardIterator begin, size_type n )
++ ForwardIterator advance( ForwardIterator begin_, size_type n )
+ {
+- ForwardIterator iter = begin;
++ ForwardIterator iter = begin_;
+ std::advance( iter, n );
+ return iter;
+ }
+--- misc/boost_1_44_0/boost/ptr_container/detail/move.hpp 2011-02-05 10:01:21.156931884 +0000
++++ misc/build/boost_1_44_0/boost/ptr_container/detail/move.hpp 2011-02-05 10:01:14.160931007 +0000
+@@ -20,7 +20,7 @@
+ template<typename Ptr>
+ class move_source {
+ public:
+- move_source(Ptr& ptr) : ptr_(ptr) {}
++ move_source(Ptr& _ptr) : ptr_(_ptr) {}
+ Ptr& ptr() const { return ptr_; }
+ private:
+ Ptr& ptr_;
+--- misc/boost_1_44_0/boost/ptr_container/detail/static_move_ptr.hpp 2011-02-05 09:55:44.846931338 +0000
++++ misc/build/boost_1_44_0/boost/ptr_container/detail/static_move_ptr.hpp 2011-02-05 09:56:42.760931701 +0000
+@@ -151,7 +151,7 @@
+ deleter_const_reference get_deleter() const { return impl_.second(); }
+ private:
+ template<typename TT, typename DD>
+- void check(const static_move_ptr<TT, DD>& ptr)
++ void check(const static_move_ptr<TT, DD>&)
+ {
+ typedef move_ptrs::is_smart_ptr_convertible<TT, T> convertible;
+ BOOST_STATIC_ASSERT(convertible::value);
+--- misc/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp 2011-02-09 08:49:00.416529470 +0000
++++ misc/build/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp 2011-02-09 08:50:44.607653864 +0000
+@@ -510,72 +510,72 @@
+
+ public: // resize
+
+- void resize( size_type size ) // basic
++ void resize( size_type size_ ) // basic
+ {
+ size_type old_size = this->size();
+- if( old_size > size )
++ if( old_size > size_ )
+ {
+- this->erase( boost::next( this->begin(), size ), this->end() );
++ this->erase( boost::next( this->begin(), size_ ), this->end() );
+ }
+- else if( size > old_size )
++ else if( size_ > old_size )
+ {
+- for( ; old_size != size; ++old_size )
++ for( ; old_size != size_; ++old_size )
+ this->push_back( new BOOST_DEDUCED_TYPENAME
+ boost::remove_pointer<value_type>::type() );
+ }
+
+- BOOST_ASSERT( this->size() == size );
++ BOOST_ASSERT( this->size() == size_ );
+ }
+
+- void resize( size_type size, value_type to_clone ) // basic
++ void resize( size_type size_, value_type to_clone ) // basic
+ {
+ size_type old_size = this->size();
+- if( old_size > size )
++ if( old_size > size_ )
+ {
+- this->erase( boost::next( this->begin(), size ), this->end() );
++ this->erase( boost::next( this->begin(), size_ ), this->end() );
+ }
+- else if( size > old_size )
++ else if( size_ > old_size )
+ {
+- for( ; old_size != size; ++old_size )
++ for( ; old_size != size_; ++old_size )
+ this->push_back( this->null_policy_allocate_clone( to_clone ) );
+ }
+
+- BOOST_ASSERT( this->size() == size );
++ BOOST_ASSERT( this->size() == size_ );
+ }
+
+- void rresize( size_type size ) // basic
++ void rresize( size_type size_ ) // basic
+ {
+ size_type old_size = this->size();
+- if( old_size > size )
++ if( old_size > size_ )
+ {
+ this->erase( this->begin(),
+- boost::next( this->begin(), old_size - size ) );
++ boost::next( this->begin(), old_size - size_ ) );
+ }
+- else if( size > old_size )
++ else if( size_ > old_size )
+ {
+- for( ; old_size != size; ++old_size )
++ for( ; old_size != size_; ++old_size )
+ this->push_front( new BOOST_DEDUCED_TYPENAME
+ boost::remove_pointer<value_type>::type() );
+ }
+
+- BOOST_ASSERT( this->size() == size );
++ BOOST_ASSERT( this->size() == size_ );
+ }
+
+- void rresize( size_type size, value_type to_clone ) // basic
++ void rresize( size_type size_, value_type to_clone ) // basic
+ {
+ size_type old_size = this->size();
+- if( old_size > size )
++ if( old_size > size_ )
+ {
+ this->erase( this->begin(),
+- boost::next( this->begin(), old_size - size ) );
++ boost::next( this->begin(), old_size - size_ ) );
+ }
+- else if( size > old_size )
++ else if( size_ > old_size )
+ {
+- for( ; old_size != size; ++old_size )
++ for( ; old_size != size_; ++old_size )
+ this->push_front( this->null_policy_allocate_clone( to_clone ) );
+ }
+
+- BOOST_ASSERT( this->size() == size );
++ BOOST_ASSERT( this->size() == size_ );
+ }
+
+ public: // algorithms
--- /dev/null
+--- misc/boost_1_44_0/boost/ptr_container/detail/reversible_ptr_container.hpp 2011-03-04 11:33:36.269274940 +0000
++++ misc/build/boost_1_44_0/boost/ptr_container/detail/reversible_ptr_container.hpp 2011-03-04 11:33:36.269274940 +0000
+@@ -259,6 +259,10 @@
+
+ static void enforce_null_policy( const Ty_* x, const char* msg )
+ {
++#ifdef BOOST_PTR_CONTAINER_NO_EXCEPTIONS
++ (void)x;
++ (void)msg;
++#endif
+ if( !allow_null )
+ {
+ BOOST_PTR_CONTAINER_THROW_EXCEPTION( 0 == x && "null not allowed",
+--- misc/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp 2009-11-01 12:07:12.000000000 +0100
++++ misc/build/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp 2011-02-04 16:39:19.000000000 +0100
+@@ -671,6 +671,7 @@
+ void range_check_impl( iterator first, iterator last,
+ std::random_access_iterator_tag )
+ {
++ (void)first; (void)last;
+ BOOST_ASSERT( first <= last && "out of range unique()/erase_if()" );
+ BOOST_ASSERT( this->begin() <= first && "out of range unique()/erase_if()" );
+ BOOST_ASSERT( last <= this->end() && "out of range unique()/erase_if)(" );
--- /dev/null
+--- misc/boost_1_44_0/boost/random/mersenne_twister.hpp
++++ misc/build/boost_1_44_0/boost/random/mersenne_twister.hpp
+@@ -195,19 +195,19 @@
+ * Returns true if the two generators are in the same state,
+ * and will thus produce identical sequences.
+ */
+- friend bool operator==(const mersenne_twister_engine& x,
+- const mersenne_twister_engine& y)
++ friend bool operator==(const mersenne_twister_engine& x_arg,
++ const mersenne_twister_engine& y_arg)
+ {
+- if(x.i < y.i) return x.equal_imp(y);
+- else return y.equal_imp(x);
++ if(x_arg.i < y_arg.i) return x_arg.equal_imp(y_arg);
++ else return y_arg.equal_imp(x_arg);
+ }
+
+ /**
+ * Returns true if the two generators are in different states.
+ */
+- friend bool operator!=(const mersenne_twister_engine& x,
+- const mersenne_twister_engine& y)
+- { return !(x == y); }
++ friend bool operator!=(const mersenne_twister_engine& x_arg,
++ const mersenne_twister_engine& y_arg)
++ { return !(x_arg == y_arg); }
+
+ private:
+ /// \cond show_private
+--- foo/foo/foo/boost/random/binomial_distribution.hpp
++++ foo/foo/foo/boost/random/binomial_distribution.hpp
+@@ -272,21 +272,21 @@
+ using std::sqrt;
+ using std::pow;
+
+- RealType p = (0.5 < _p)? (1 - _p) : _p;
+- IntType t = _t;
++ RealType p_lcl = (0.5 < _p)? (1 - _p) : _p;
++ IntType t_lcl = _t;
+
+- m = static_cast<IntType>((t+1)*p);
++ m = static_cast<IntType>((t_lcl+1)*p_lcl);
+
+ if(use_inversion()) {
+- q_n = pow((1 - p), static_cast<RealType>(t));
++ q_n = pow((1 - p_lcl), static_cast<RealType>(t_lcl));
+ } else {
+- btrd.r = p/(1-p);
+- btrd.nr = (t+1)*btrd.r;
+- btrd.npq = t*p*(1-p);
++ btrd.r = p_lcl/(1-p_lcl);
++ btrd.nr = (t_lcl+1)*btrd.r;
++ btrd.npq = t_lcl*p_lcl*(1-p_lcl);
+ RealType sqrt_npq = sqrt(btrd.npq);
+ btrd.b = 1.15 + 2.53 * sqrt_npq;
+- btrd.a = -0.0873 + 0.0248*btrd.b + 0.01*p;
+- btrd.c = t*p + 0.5;
++ btrd.a = -0.0873 + 0.0248*btrd.b + 0.01*p_lcl;
++ btrd.c = t_lcl*p_lcl + 0.5;
+ btrd.alpha = (2.83 + 5.1/btrd.b) * sqrt_npq;
+ btrd.v_r = 0.92 - 4.2/btrd.b;
+ btrd.u_rv_r = 0.86*btrd.v_r;
+@@ -304,9 +304,9 @@
+ RealType u;
+ RealType v = uniform_01<RealType>()(urng);
+ if(v <= btrd.u_rv_r) {
+- RealType u = v/btrd.v_r - 0.43;
++ RealType u_lcl = v/btrd.v_r - 0.43;
+ return static_cast<IntType>(floor(
+- (2*btrd.a/(0.5 - abs(u)) + btrd.b)*u + btrd.c));
++ (2*btrd.a/(0.5 - abs(u_lcl)) + btrd.b)*u_lcl + btrd.c));
+ }
+
+ if(v >= btrd.v_r) {
+@@ -344,9 +344,9 @@
+ v = log(v);
+ RealType rho =
+ (km/btrd.npq)*(((km/3. + 0.625)*km + 1./6)/btrd.npq + 0.5);
+- RealType t = -km*km/(2*btrd.npq);
+- if(v < t - rho) return k;
+- if(v > t + rho) continue;
++ RealType t_lcl = -km*km/(2*btrd.npq);
++ if(v < t_lcl - rho) return k;
++ if(v > t_lcl + rho) continue;
+
+ IntType nm = _t - m + 1;
+ RealType h = (m + 0.5)*log((m + 1)/(btrd.r*nm))
+@@ -367,11 +367,11 @@
+ }
+
+ template<class URNG>
+- IntType invert(IntType t, RealType p, URNG& urng) const
++ IntType invert(IntType t_arg, RealType p_arg, URNG& urng) const
+ {
+- RealType q = 1 - p;
+- RealType s = p / q;
+- RealType a = (t + 1) * s;
++ RealType q = 1 - p_arg;
++ RealType s = p_arg / q;
++ RealType a = (t_arg + 1) * s;
+ RealType r = q_n;
+ RealType u = uniform_01<RealType>()(urng);
+ IntType x = 0;
+--- foo/foo/foo/boost/random/geometric_distribution.hpp
++++ foo/foo/foo/boost/random/geometric_distribution.hpp
+@@ -104,8 +104,8 @@
+ *
+ * Requires: 0 < p < 1
+ */
+- explicit geometric_distribution(const RealType& p = RealType(0.5))
+- : _p(p)
++ explicit geometric_distribution(const RealType& p_arg = RealType(0.5))
++ : _p(p_arg)
+ {
+ BOOST_ASSERT(RealType(0) < _p && _p < RealType(1));
+ init();
+--- foo/foo/foo/boost/random/shuffle_order.hpp
++++ foo/foo/foo/boost/random/shuffle_order.hpp
+@@ -200,8 +200,8 @@
+ }
+
+ /** Returns true if the two generators will produce identical sequences. */
+- BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(shuffle_order_engine, x, y)
+- { return x._rng == y._rng && x.y == y.y && std::equal(x.v, x.v+k, y.v); }
++ BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(shuffle_order_engine, x, y_arg)
++ { return x._rng == y_arg._rng && x.y == y_arg.y && std::equal(x.v, x.v+k, y_arg.v); }
+ /** Returns true if the two generators will produce different sequences. */
+ BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(shuffle_order_engine)
+
+--- foo/foo/foo/boost/random/subtract_with_carry.hpp
++++ foo/foo/foo/boost/random/subtract_with_carry.hpp
+@@ -268,21 +268,21 @@
+
+ friend struct detail::subtract_with_carry_discard;
+
+- IntType do_update(std::size_t current, std::size_t short_index, IntType carry)
++ IntType do_update(std::size_t current, std::size_t short_index, IntType carry_arg)
+ {
+ IntType delta;
+- IntType temp = x[current] + carry;
++ IntType temp = x[current] + carry_arg;
+ if (x[short_index] >= temp) {
+ // x(n) >= 0
+ delta = x[short_index] - temp;
+- carry = 0;
++ carry_arg = 0;
+ } else {
+ // x(n) < 0
+ delta = modulus - temp + x[short_index];
+- carry = 1;
++ carry_arg = 1;
+ }
+ x[current] = delta;
+- return carry;
++ return carry_arg;
+ }
+ /// \endcond
+
+@@ -498,17 +498,17 @@
+
+ friend struct detail::subtract_with_carry_discard;
+
+- RealType do_update(std::size_t current, std::size_t short_index, RealType carry)
++ RealType do_update(std::size_t current, std::size_t short_index, RealType carry_arg)
+ {
+- RealType delta = x[short_index] - x[current] - carry;
++ RealType delta = x[short_index] - x[current] - carry_arg;
+ if(delta < 0) {
+ delta += RealType(1);
+- carry = RealType(1)/_modulus;
++ carry_arg = RealType(1)/_modulus;
+ } else {
+- carry = 0;
++ carry_arg = 0;
+ }
+ x[current] = delta;
+- return carry;
++ return carry_arg;
+ }
+ /// \endcond
+ std::size_t k;
--- /dev/null
+--- a/b/boost/boost/random/generate_canonical.hpp 2013-05-31 18:13:09.804149686 +0200
++++ a/b/boost/boost/random/generate_canonical.hpp 2013-05-31 18:13:30.020195845 +0200
+@@ -55,7 +55,6 @@
+ using std::floor;
+ BOOST_ASSERT((g.min)() == 0);
+ BOOST_ASSERT((g.max)() == 1);
+- typedef typename URNG::result_type base_result;
+ std::size_t digits = std::numeric_limits<RealType>::digits;
+ std::size_t engine_bits = detail::generator_bits<URNG>::value();
+ std::size_t b = (std::min)(bits, digits);
+--- a/b/boost/boost/random/uniform_real_distribution.hpp 2013-05-31 18:15:04.571429634 +0200
++++ a/b/boost/boost/random/uniform_real_distribution.hpp 2013-05-31 18:14:28.452337186 +0200
+@@ -36,7 +36,6 @@
+ {
+ for(;;) {
+ typedef T result_type;
+- typedef typename Engine::result_type base_result;
+ result_type numerator = static_cast<T>(eng() - (eng.min)());
+ result_type divisor = static_cast<T>((eng.max)() - (eng.min)());
+ BOOST_ASSERT(divisor > 0);
--- /dev/null
+--- misc/boost_1_44_0/boost/spirit/home/classic/symbols/symbols.hpp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/symbols/symbols.hpp 2011-02-04 16:39:19.000000000 +0100
+@@ -102,13 +102,13 @@
+ {
+ typedef typename ScannerT::iterator_t iterator_t;
+ iterator_t first = scan.first;
+- typename SetT::search_info result = SetT::find(scan);
++ typename SetT::search_info result_ = SetT::find(scan);
+
+- if (result.data)
++ if (result_.data)
+ return scan.
+ create_match(
+- result.length,
+- symbol_ref_t(*result.data),
++ result_.length,
++ symbol_ref_t(*result_.data),
+ first,
+ scan.first);
+ else
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/subrule.hpp 2011-02-08 09:24:50.817320629 +0000
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/subrule.hpp 2011-02-08 09:25:20.496639901 +0000
+@@ -210,7 +210,7 @@
+ subrule_list<
+ subrule_parser<ID2, DefT2, ContextT2>,
+ nil_t> >
+- operator,(subrule_parser<ID2, DefT2, ContextT2> const& rhs) const
++ operator,(subrule_parser<ID2, DefT2, ContextT2> const& rhs_) const
+ {
+ return subrule_list<
+ self_t,
+@@ -220,7 +220,7 @@
+ *this,
+ subrule_list<
+ subrule_parser<ID2, DefT2, ContextT2>, nil_t>(
+- rhs, nil_t()));
++ rhs_, nil_t()));
+ }
+
+ typename DefT::embed_t rhs;
+--- misc/boost_1_44_0/boost/spirit/home/classic/debug/impl/parser_names.ipp 2012-04-10 21:23:48.599238472 +0100
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/debug/impl/parser_names.ipp 2012-04-10 21:24:02.752394878 +0100
+@@ -395,13 +395,13 @@
+ }
+
+ bool register_node(void const *r, char const *name_to_register,
+- bool trace_node)
++ bool trace_node_)
+ {
+ if (infos.find(r) != infos.end())
+ return false;
+
+ return infos.insert(rule_infos::value_type(r,
+- rule_info(std::string(name_to_register), trace_node))
++ rule_info(std::string(name_to_register), trace_node_))
+ ).second;
+ }
+
+--- a/a/boost/boost/spirit/home/classic/error_handling/exceptions.hpp 2013-05-17 15:57:23.722638823 +0200
++++ a/a/boost/boost/spirit/home/classic/error_handling/exceptions.hpp 2013-05-17 15:26:32.319247352 +0200
+@@ -126,8 +126,8 @@
+ typedef unary<ParserT, parser<self_t> > base_t;
+ typedef unary_parser_category parser_category_t;
+
+- assertive_parser(ParserT const& parser, ErrorDescrT descriptor_)
+- : base_t(parser), descriptor(descriptor_) {}
++ assertive_parser(ParserT const& parser_, ErrorDescrT descriptor_)
++ : base_t(parser_), descriptor(descriptor_) {}
+
+ template <typename ScannerT>
+ struct result
--- /dev/null
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
+@@ -307,7 +307,6 @@
+ #if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE)
+ typedef impl::grammar_helper_base<GrammarT> helper_base_t;
+ typedef grammar_helper_list<GrammarT> helper_list_t;
+- typedef typename helper_list_t::vector_t::reverse_iterator iterator_t;
+
+ helper_list_t& helpers =
+ # if !defined(__GNUC__) || (__GNUC__ > 2)
+@@ -318,6 +317,7 @@
+
+ # if (defined(BOOST_MSVC) && (BOOST_MSVC < 1300)) \
+ || defined(BOOST_INTEL_CXX_VERSION)
++ typedef typename helper_list_t::vector_t::reverse_iterator iterator_t;
+ for (iterator_t i = helpers.rbegin(); i != helpers.rend(); ++i)
+ (*i)->undefine(self);
+ # else
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/primitives/primitives.hpp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/primitives/primitives.hpp
+@@ -47,7 +47,6 @@
+ typename parser_result<self_t, ScannerT>::type
+ parse(ScannerT const& scan) const
+ {
+- typedef typename parser_result<self_t, ScannerT>::type result_t;
+ typedef typename ScannerT::value_t value_t;
+ typedef typename ScannerT::iterator_t iterator_t;
+
+--- misc/boost_1_44_0/boost/spirit/home/classic/error_handling/exceptions.hpp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/error_handling/exceptions.hpp
+@@ -140,7 +140,6 @@
+ parse(ScannerT const& scan) const
+ {
+ typedef typename parser_result<ParserT, ScannerT>::type result_t;
+- typedef typename ScannerT::iterator_t iterator_t;
+
+ result_t hit = this->subject().parse(scan);
+ if (!hit)
+--- misc/boost_1_44_0/boost/spirit/home/classic/utility/functor_parser.hpp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/utility/functor_parser.hpp
+@@ -49,8 +49,6 @@
+ typename parser_result<self_t, ScannerT>::type
+ parse(ScannerT const& scan) const
+ {
+- typedef typename parser_result<self_t, ScannerT>::type result_t;
+- typedef typename ScannerT::value_t value_t;
+ typedef typename ScannerT::iterator_t iterator_t;
+
+ iterator_t const s(scan.first);
--- /dev/null
+--- foo/foo/foo/boost/config/compiler/clang.hpp
++++ foo/foo/foo/boost/config/compiler/clang.hpp
+@@ -10,6 +10,8 @@
+
+ #define BOOST_HAS_PRAGMA_ONCE
+
++#include <utility>
++
+ #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
+ # define BOOST_NO_EXCEPTIONS
+ #endif
+@@ -128,7 +130,7 @@
+ # define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+ #endif
+
+-#if !__has_feature(cxx_rvalue_references)
++#if !__has_feature(cxx_rvalue_references) || (defined(__APPLE__) && !defined(_LIBCPP_VERSION))
+ # define BOOST_NO_CXX11_RVALUE_REFERENCES
+ #endif
+
--- /dev/null
+--- foo/foo/foo/boost/archive/iterators/transform_width.hpp
++++ foo/foo/foo/boost/archive/iterators/transform_width.hpp
+@@ -23,6 +23,8 @@
+ // stream length is some common multiple of x and y. E.G. Base64 6 bit
+ // character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters
+ // or 3 8 bit characters
++
++#include <algorithm>
+
+ #include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME & PTFO
+ #include <boost/serialization/pfto.hpp>
--- /dev/null
+--- a/b/boost/boost/tuple/detail/tuple_basic.hpp 2013-05-31 13:31:21.682966336 +0200
++++ a/b/boost/boost/tuple/detail/tuple_basic.hpp 2013-05-31 13:32:44.067231648 +0200
+@@ -225,7 +225,6 @@
+ get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<cons<HT, TT> > impl;
+- typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
+ return impl::call(c).head;
+ }
+
--- /dev/null
+--- foo/foo/foo/boost/unordered/detail/equivalent.hpp
++++ foo/foo/foo/boost/unordered/detail/equivalent.hpp
+@@ -536,9 +536,9 @@
+ node_pointer first_node = static_cast<node_pointer>(prev->next_);
+ link_pointer end = first_node->group_prev_->next_;
+
+- std::size_t count = this->delete_nodes(prev, end);
++ std::size_t count_lcl = this->delete_nodes(prev, end);
+ this->fix_bucket(bucket_index, prev);
+- return count;
++ return count_lcl;
+ }
+
+ iterator erase(c_iterator r)
+@@ -557,21 +557,21 @@
+ return iterator(r2.node_);
+ }
+
+- link_pointer erase_nodes(node_pointer begin, node_pointer end)
++ link_pointer erase_nodes(node_pointer begin_arg, node_pointer end)
+ {
+- std::size_t bucket_index = this->hash_to_bucket(begin->hash_);
++ std::size_t bucket_index = this->hash_to_bucket(begin_arg->hash_);
+
+- // Split the groups containing 'begin' and 'end'.
+- // And get the pointer to the node before begin while
++ // Split the groups containing 'begin_arg' and 'end.'
++ // And get the pointer to the node before begin_arg while
+ // we're at it.
+- link_pointer prev = split_groups(begin, end);
++ link_pointer prev = split_groups(begin_arg, end);
+
+- // If we don't have a 'prev' it means that begin is at the
++ // If we don't have a 'prev' it means that begin_arg is at the
+ // beginning of a block, so search through the blocks in the
+ // same bucket.
+ if (!prev) {
+ prev = this->get_previous_start(bucket_index);
+- while (prev->next_ != begin)
++ while (prev->next_ != begin_arg)
+ prev = static_cast<node_pointer>(prev->next_)->group_prev_;
+ }
+
+@@ -586,27 +586,27 @@
+ return prev;
+ }
+
+- static link_pointer split_groups(node_pointer begin, node_pointer end)
++ static link_pointer split_groups(node_pointer begin_arg, node_pointer end)
+ {
+- node_pointer prev = begin->group_prev_;
+- if (prev->next_ != begin) prev = node_pointer();
++ node_pointer prev = begin_arg->group_prev_;
++ if (prev->next_ != begin_arg) prev = node_pointer();
+
+ if (end) {
+ node_pointer first = end;
+- while (first != begin && first->group_prev_->next_ == first) {
++ while (first != begin_arg && first->group_prev_->next_ == first) {
+ first = first->group_prev_;
+ }
+
+ boost::swap(first->group_prev_, end->group_prev_);
+- if (first == begin) return prev;
++ if (first == begin_arg) return prev;
+ }
+
+ if (prev) {
+ node_pointer first = prev;
+ while (first->group_prev_->next_ == first) {
+ first = first->group_prev_;
+ }
+- boost::swap(first->group_prev_, begin->group_prev_);
++ boost::swap(first->group_prev_, begin_arg->group_prev_);
+ }
+
+ return prev;
+--- foo/foo/foo/boost/unordered/detail/table.hpp
++++ foo/foo/foo/boost/unordered/detail/table.hpp
+@@ -256,9 +256,9 @@
+ return prev ? iterator(prev->next_) : iterator();
+ }
+
+- std::size_t hash_to_bucket(std::size_t hash) const
++ std::size_t hash_to_bucket(std::size_t hash_arg) const
+ {
+- return policy::to_bucket(bucket_count_, hash);
++ return policy::to_bucket(bucket_count_, hash_arg);
+ }
+
+ float load_factor() const
+@@ -655,8 +655,8 @@
+ // assign_nodes takes ownership of the container's elements,
+ // assigning to them if possible, and deleting any that are
+ // left over.
+- assign_nodes<table> assign(*this);
+- table_impl::fill_buckets(x.begin(), *this, assign);
++ assign_nodes<table> assign_lcl(*this);
++ table_impl::fill_buckets(x.begin(), *this, assign_lcl);
+ }
+
+ void assign(table const& x, true_type)
+@@ -732,9 +732,9 @@
+ // move_assign_nodes takes ownership of the container's
+ // elements, assigning to them if possible, and deleting
+ // any that are left over.
+- move_assign_nodes<table> assign(*this);
++ move_assign_nodes<table> assign_lcl(*this);
+ node_holder<node_allocator> nodes(x);
+- table_impl::fill_buckets(nodes.begin(), *this, assign);
++ table_impl::fill_buckets(nodes.begin(), *this, assign_lcl);
+ }
+ }
+
+--- foo/foo/foo/boost/unordered/detail/unique.hpp
++++ foo/foo/foo/boost/unordered/detail/unique.hpp
+@@ -531,9 +531,9 @@
+
+ link_pointer end = static_cast<node_pointer>(prev->next_)->next_;
+
+- std::size_t count = this->delete_nodes(prev, end);
++ std::size_t count_lcl = this->delete_nodes(prev, end);
+ this->fix_bucket(bucket_index, prev);
+- return count;
++ return count_lcl;
+ }
+
+ iterator erase(c_iterator r)
+@@ -552,13 +552,13 @@
+ return iterator(r2.node_);
+ }
+
+- void erase_nodes(node_pointer begin, node_pointer end)
++ void erase_nodes(node_pointer begin_arg, node_pointer end)
+ {
+- std::size_t bucket_index = this->hash_to_bucket(begin->hash_);
++ std::size_t bucket_index = this->hash_to_bucket(begin_arg->hash_);
+
+- // Find the node before begin.
++ // Find the node before begin_arg.
+ link_pointer prev = this->get_previous_start(bucket_index);
+- while(prev->next_ != begin) prev = prev->next_;
++ while(prev->next_ != begin_arg) prev = prev->next_;
+
+ // Delete the nodes.
+ do {
--- /dev/null
+--- foo/foo/foo/boost/utility/result_of.hpp
++++ foo/foo/foo/boost/utility/result_of.hpp
+@@ -72,7 +72,7 @@
+ // There doesn't seem to be any other way to turn this off such that the presence of
+ // the user-defined operator,() below doesn't cause spurious warning all over the place,
+ // so unconditionally turn it off.
+-#if BOOST_MSVC
++#if defined(BOOST_MSVC) && BOOST_MSVC
+ # pragma warning(disable: 4913) // user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used
+ #endif
+
--- /dev/null
+--- misc/boost_1_44_0/boost/uuid/uuid_io.hpp
++++ misc/build/boost_1_44_0/boost/uuid/uuid_io.hpp
+@@ -59,7 +59,7 @@
+ }
+
+ if (flags & std::ios_base::left) {
+- for (std::streamsize i=uuid_width; i<width; i++) {
++ for (std::streamsize s=uuid_width; s<width; ++s) {
+ os << fill;
+ }
+ }
+--- misc/boost_1_44_0/boost/uuid/name_generator.hpp
++++ misc/build/boost_1_44_0/boost/uuid/name_generator.hpp
+@@ -30,8 +30,8 @@
+ public:
+ typedef uuid result_type;
+
+- explicit name_generator(uuid const& namespace_uuid)
+- : namespace_uuid(namespace_uuid)
++ explicit name_generator(uuid const& namespace_uuid_)
++ : namespace_uuid(namespace_uuid_)
+ {}
+
+ uuid operator()(const char* name) {
--- /dev/null
+--- misc/build/boost_1_44_0/boost/config/compiler/visualc.hpp
++++ misc/build/boost_1_44_0/boost/config/compiler/visualc.hpp
+@@ -101,6 +101,11 @@
+ # define BOOST_NO_ADL_BARRIER
+ #endif
+
++#if _MSC_VER >= 1700 // 1700 == VC++ 11.0
++ // Removed in VC11:
++# define BOOST_NO_0X_HDR_INITIALIZER_LIST
++#endif
++
+
+ #if (_MSC_VER <= 1600)
+ // MSVC (including the latest checked version) has not yet completely
+@@ -269,8 +269,8 @@
+ #error "Compiler not supported or configured - please reconfigure"
+ #endif
+ //
+-// last known and checked version is 1600 (VC10, aka 2010):
+-#if (_MSC_VER > 1600)
++// last known and checked version is 1700 (VC12, aka 2012):
++#if (_MSC_VER > 1700)
+ # if defined(BOOST_ASSERT_CONFIG)
+ # error "Unknown compiler version - please run the configure tests and report the results"
+ # else
--- /dev/null
+--- boost/ptr_container/ptr_map.hpp
++++ boost/ptr_container/ptr_map.hpp
+@@ -16,6 +16,12 @@
+ # pragma once
+ #endif
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #include <map>
+ #include <boost/ptr_container/ptr_map_adapter.hpp>
+
+@@ -162,4 +168,8 @@
+
+ }
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif
+--- boost/ptr_container/ptr_map_adapter.hpp
++++ boost/ptr_container/ptr_map_adapter.hpp
+@@ -16,6 +16,12 @@
+ # pragma once
+ #endif
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #include <boost/ptr_container/detail/map_iterator.hpp>
+ #include <boost/ptr_container/detail/associative_ptr_container.hpp>
+ #include <boost/ptr_container/detail/meta_functions.hpp>
+@@ -876,4 +876,8 @@
+
+ } // namespace 'boost'
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif
+--- boost/ptr_container/ptr_set_adapter.hpp
++++ boost/ptr_container/ptr_set_adapter.hpp
+@@ -16,6 +16,12 @@
+ # pragma once
+ #endif
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #include <boost/ptr_container/detail/associative_ptr_container.hpp>
+ #include <boost/ptr_container/detail/meta_functions.hpp>
+ #include <boost/ptr_container/detail/void_ptr_iterator.hpp>
+@@ -693,4 +693,8 @@
+
+ } // namespace 'boost'
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif
+--- boost/ptr_container/ptr_sequence_adapter.hpp
++++ boost/ptr_container/ptr_sequence_adapter.hpp
+@@ -16,6 +16,11 @@
+ # pragma once
+ #endif
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
+
+ #include <boost/ptr_container/detail/reversible_ptr_container.hpp>
+ #include <boost/ptr_container/indirect_fun.hpp>
+@@ -773,4 +777,8 @@
+
+ } // namespace 'boost'
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif
+--- boost/ptr_container/ptr_vector.hpp
++++ boost/ptr_container/ptr_vector.hpp
+@@ -16,6 +16,12 @@
+ # pragma once
+ #endif
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #include <vector>
+ #include <boost/ptr_container/ptr_sequence_adapter.hpp>
+
+@@ -74,4 +80,8 @@
+
+ }
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif
+--- boost/smart_ptr/detail/shared_count.hpp
++++ boost/smart_ptr/detail/shared_count.hpp
+@@ -18,6 +18,12 @@
+ // http://www.boost.org/LICENSE_1_0.txt)
+ //
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #ifdef __BORLANDC__
+ # pragma warn -8027 // Functions containing try are not expanded inline
+ #endif
+@@ -604,4 +604,8 @@
+ # pragma warn .8027 // Functions containing try are not expanded inline
+ #endif
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif // #ifndef BOOST_SMART_PTR_DETAIL_SHARED_COUNT_HPP_INCLUDED
+--- boost/smart_ptr/scoped_ptr.hpp
++++ boost/smart_ptr/scoped_ptr.hpp
+@@ -11,6 +11,12 @@
+ // http://www.boost.org/libs/smart_ptr/scoped_ptr.htm
+ //
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #include <boost/config.hpp>
+ #include <boost/assert.hpp>
+ #include <boost/checked_delete.hpp>
+@@ -158,4 +158,8 @@
+
+ } // namespace boost
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif // #ifndef BOOST_SMART_PTR_SCOPED_PTR_HPP_INCLUDED
+--- boost/smart_ptr/shared_ptr.hpp
++++ boost/smart_ptr/shared_ptr.hpp
+@@ -14,6 +14,12 @@
+ // See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
+ //
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ #include <boost/config.hpp> // for broken compiler workarounds
+
+ #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+@@ -1036,4 +1036,9 @@
+
+ #endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif // #ifndef BOOST_SMART_PTR_SHARED_PTR_HPP_INCLUDED
--- /dev/null
+--- misc/build/boost_1_44_0/boost/pool/detail/mutex.hpp
++++ misc/build/boost_1_44_0/boost/pool/detail/mutex.hpp
+@@ -45,7 +45,9 @@
+
+ #ifndef BOOST_NO_MT
+ # ifdef BOOST_WINDOWS
++# define NOMINMAX
+ # include <windows.h>
++# undef NOMINMAX
+ # endif
+ # if defined(_POSIX_THREADS) || defined(BOOST_HAS_PTHREADS)
+ # include <pthread.h>
--- /dev/null
+--- foo/foo/foo/boost/multi_array/base.hpp
++++ foo/foo/foo/boost/multi_array/base.hpp
+@@ -501,6 +501,7 @@
+ // the "far side" of the range (the top if stride is positive, the bottom
+ // if stride is negative).
+ index bound_adjustment = stride < 0 ? 1 : 0;
++ (void) bound_adjustment;
+ BOOST_ASSERT(((index_bases[n] - bound_adjustment) <= finish) &&
+ (finish <= (index_bases[n] + index(extents[n]) - bound_adjustment)));
+ #endif // BOOST_DISABLE_ASSERTS
+--- foo/foo/foo/boost/unordered/detail/table.hpp
++++ foo/foo/foo/boost/unordered/detail/table.hpp
+@@ -458,6 +458,7 @@
+ // According to 23.2.1.8, if propagate_on_container_swap is
+ // false the behaviour is undefined unless the allocators
+ // are equal.
++ (void) other;
+ BOOST_ASSERT(node_alloc() == other.node_alloc());
+ }
+
--- /dev/null
+--- misc/boost_1_44_0/boost/random/lagged_fibonacci.hpp
++++ misc/build/boost_1_44_0/boost/random/lagged_fibonacci.hpp
+@@ -16,6 +16,12 @@
+ #ifndef BOOST_RANDOM_LAGGED_FIBONACCI_HPP
+ #define BOOST_RANDOM_LAGGED_FIBONACCI_HPP
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
+ #include <istream>
+ #include <iosfwd>
+ #include <algorithm> // std::max
+@@ -537,4 +537,8 @@
+
+ } // namespace boost
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif // BOOST_RANDOM_LAGGED_FIBONACCI_HPP
+--- misc/boost_1_44_0/boost/random/shuffle_output.hpp
++++ misc/build/boost_1_44_0/boost/random/shuffle_output.hpp
+@@ -16,6 +16,12 @@
+ #ifndef BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
+ #define BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
+ #include <boost/random/shuffle_order.hpp>
+
+ namespace boost {
+@@ -52,4 +52,8 @@
+ }
+ }
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif // BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
+--- misc/boost_1_44_0/boost/random/subtract_with_carry.hpp
++++ misc/build/boost_1_44_0/boost/random/subtract_with_carry.hpp
+@@ -16,6 +16,12 @@
+ #ifndef BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
+ #define BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
+ #include <boost/config/no_tr1/cmath.hpp> // std::pow
+ #include <iostream>
+ #include <algorithm> // std::equal
+@@ -614,4 +614,8 @@
+ } // namespace random
+ } // namespace boost
+
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
++
+ #endif // BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
+
--- /dev/null
+--- misc/boost_1_44_0/boost/bind/bind.hpp 2009-11-30 21:30:22.000000000 +0100
++++ misc/build/boost_1_44_0/boost/bind/bind.hpp 2012-01-20 12:44:07.111316403 +0100
+@@ -143,7 +143,7 @@
+
+ template<class F> struct unwrapper
+ {
+- static inline F & unwrap( F & f, long )
++ static inline F & unwrap( F & f, __attribute__ ((unused)) long )
+ {
+ return f;
+ }
+@@ -226,7 +226,7 @@
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+
+- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
++ A1 operator[] (__attribute__ ((unused)) boost::arg<1> (*) ()) const { return base_type::a1_; }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+@@ -238,22 +238,22 @@
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
++ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, __attribute__ ((unused)) long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
++ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, __attribute__ ((unused)) long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
++ template<class F, class A> void operator()(type<void>, F & f, A & a, __attribute__ ((unused)) int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
++ template<class F, class A> void operator()(type<void>, F const & f, A & a, __attribute__ ((unused)) int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+@@ -285,8 +285,8 @@
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+
+- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
++ A1 operator[] (__attribute__ ((unused)) boost::arg<1> (*) ()) const { return base_type::a1_; }
++ A2 operator[] (__attribute__ ((unused)) boost::arg<2> (*) ()) const { return base_type::a2_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+@@ -298,22 +298,22 @@
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
++ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, __attribute__ ((unused)) long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
++ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, __attribute__ ((unused)) long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
++ template<class F, class A> void operator()(type<void>, F & f, A & a, __attribute__ ((unused)) int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
++ template<class F, class A> void operator()(type<void>, F const & f, A & a, __attribute__ ((unused)) int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+@@ -377,7 +377,7 @@
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
++ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, __attribute__ ((unused)) long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+@@ -387,12 +387,12 @@
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
++ template<class F, class A> void operator()(type<void>, F & f, A & a, __attribute__ ((unused)) int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
++ template<class F, class A> void operator()(type<void>, F const & f, A & a, __attribute__ ((unused)) int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+@@ -427,10 +427,10 @@
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+
+- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
++ A1 operator[] (__attribute__ ((unused)) boost::arg<1> (*) ()) const { return base_type::a1_; }
++ A2 operator[] (__attribute__ ((unused)) boost::arg<2> (*) ()) const { return base_type::a2_; }
++ A3 operator[] (__attribute__ ((unused)) boost::arg<3> (*) ()) const { return base_type::a3_; }
++ A4 operator[] (__attribute__ ((unused)) boost::arg<4> (*) ()) const { return base_type::a4_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+@@ -442,7 +442,7 @@
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
++ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, __attribute__ ((unused)) long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+@@ -452,7 +452,7 @@
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
++ template<class F, class A> void operator()(type<void>, F & f, A & a, __attribute__ ((unused)) int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+@@ -510,7 +510,7 @@
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
++ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, __attribute__ ((unused)) long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+@@ -520,7 +520,7 @@
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
++ template<class F, class A> void operator()(type<void>, F & f, A & a, __attribute__ ((unused)) int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+@@ -591,7 +591,7 @@
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
++ template<class F, class A> void operator()(type<void>, F & f, A & a, __attribute__ ((unused)) int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+--- misc/boost_1_44_0/boost/bind/mem_fn.hpp 2009-03-02 17:15:40.000000000 +0100
++++ misc/build/boost_1_44_0/boost/bind/mem_fn.hpp 2012-01-20 12:44:07.112316398 +0100
+@@ -328,7 +328,7 @@
+ return (u.*f_);
+ }
+
+- template<class U> R const & call(U & u, void const *) const
++ template<class U> R const & call(U & u, __attribute__ ((unused)) void const *) const
+ {
+ return (get_pointer(u)->*f_);
+ }
+--- misc/boost_1_44_0/boost/bind/mem_fn_template.hpp 2009-12-03 18:44:37.000000000 +0100
++++ misc/build/boost_1_44_0/boost/bind/mem_fn_template.hpp 2012-01-20 12:44:07.112316398 +0100
+@@ -35,7 +35,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)();
+ }
+
+- template<class U> R call(U & u, void const *) const
++ template<class U> R call(U & u, __attribute__ ((unused)) void const *) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
+ }
+@@ -100,7 +100,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)();
+ }
+
+- template<class U> R call(U & u, void const *) const
++ template<class U> R call(U & u, __attribute__ ((unused)) void const *) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
+ }
+@@ -146,12 +146,12 @@
+ BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1))
+ F f_;
+
+- template<class U, class B1> R call(U & u, T const *, B1 & b1) const
++ template<class U, class B1> R call(U & u, __attribute__ ((unused)) T const *, B1 & b1) const
+ {
+ BOOST_MEM_FN_RETURN (u.*f_)(b1);
+ }
+
+- template<class U, class B1> R call(U & u, void const *, B1 & b1) const
++ template<class U, class B1> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
+ }
+@@ -217,7 +217,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)(b1);
+ }
+
+- template<class U, class B1> R call(U & u, void const *, B1 & b1) const
++ template<class U, class B1> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
+ }
+@@ -266,7 +266,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
+ }
+
+- template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
++ template<class U, class B1, class B2> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1, B2 & b2) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
+ }
+@@ -330,7 +330,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
+ }
+
+- template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
++ template<class U, class B1, class B2> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1, B2 & b2) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
+ }
+@@ -379,7 +379,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
+ }
+
+- template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
++ template<class U, class B1, class B2, class B3> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1, B2 & b2, B3 & b3) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
+ }
+@@ -492,7 +492,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
+ }
+
+- template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
++ template<class U, class B1, class B2, class B3, class B4> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
+ }
+@@ -556,7 +556,7 @@
+ BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
+ }
+
+- template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
++ template<class U, class B1, class B2, class B3, class B4> R call(U & u, __attribute__ ((unused)) void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
+ {
+ BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
+ }
+--- misc/boost_1_44_0/boost/detail/dynamic_bitset.hpp 2008-10-21 20:13:59.000000000 +0200
++++ misc/build/boost_1_44_0/boost/detail/dynamic_bitset.hpp 2012-01-20 12:44:07.113316394 +0100
+@@ -100,8 +100,8 @@
+
+ template <typename Iterator>
+ inline std::size_t do_count(Iterator first, std::size_t length,
+- int /*dummy param*/,
+- value_to_type<access_by_bytes>* )
++ __attribute__ ((unused)) int /*dummy param*/,
++ __attribute__ ((unused)) value_to_type<access_by_bytes>* )
+ {
+ std::size_t num = 0;
+ if (length)
+--- misc/boost_1_44_0/boost/foreach.hpp 2010-07-30 22:26:40.000000000 +0200
++++ misc/build/boost_1_44_0/boost/foreach.hpp 2012-01-20 12:44:07.114316390 +0100
+@@ -610,7 +610,7 @@
+ }
+
+ template<typename T>
+-inline auto_any<T *> contain(T &t, boost::mpl::false_ *) // lvalue
++inline auto_any<T *> contain(T &t, __attribute__ ((unused)) boost::mpl::false_ *) // lvalue
+ {
+ // Cannot seem to get sunpro to handle addressof() with array types.
+ #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x570))
+@@ -641,7 +641,7 @@
+
+ template<typename T, typename C>
+ inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>
+-begin(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *) // lvalue
++begin(auto_any_t col, __attribute__ ((unused)) type2type<T, C> *, __attribute__ ((unused)) boost::mpl::false_ *) // lvalue
+ {
+ typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type;
+ typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iterator;
+@@ -678,7 +678,7 @@
+
+ template<typename T, typename C>
+ inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>
+-end(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *) // lvalue
++end(auto_any_t col, __attribute__ ((unused)) type2type<T, C> *, __attribute__ ((unused)) boost::mpl::false_ *) // lvalue
+ {
+ typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type;
+ typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iterator;
+@@ -707,7 +707,7 @@
+ // done
+ //
+ template<typename T, typename C>
+-inline bool done(auto_any_t cur, auto_any_t end, type2type<T, C> *)
++inline bool done(auto_any_t cur, auto_any_t end, __attribute__ ((unused)) type2type<T, C> *)
+ {
+ typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iter_t;
+ return auto_any_cast<iter_t, boost::mpl::false_>(cur) == auto_any_cast<iter_t, boost::mpl::false_>(end);
+@@ -725,7 +725,7 @@
+ // next
+ //
+ template<typename T, typename C>
+-inline void next(auto_any_t cur, type2type<T, C> *)
++inline void next(auto_any_t cur, __attribute__ ((unused)) type2type<T, C> *)
+ {
+ typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iter_t;
+ ++auto_any_cast<iter_t, boost::mpl::false_>(cur);
+@@ -736,7 +736,7 @@
+ //
+ template<typename T, typename C>
+ inline BOOST_DEDUCED_TYPENAME foreach_reference<T, C>::type
+-deref(auto_any_t cur, type2type<T, C> *)
++deref(auto_any_t cur, __attribute__ ((unused)) type2type<T, C> *)
+ {
+ typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iter_t;
+ return *auto_any_cast<iter_t, boost::mpl::false_>(cur);
+--- misc/boost_1_44_0/boost/function/function_template.hpp 2009-07-09 01:23:52.000000000 +0200
++++ misc/build/boost_1_44_0/boost/function/function_template.hpp 2012-01-20 15:29:25.217770399 +0100
+@@ -711,7 +711,7 @@
+ template<typename Functor>
+ BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f
+ #ifndef BOOST_NO_SFINAE
+- ,typename enable_if_c<
++ ,__attribute__ ((unused)) typename enable_if_c<
+ (boost::type_traits::ice_not<
+ (is_integral<Functor>::value)>::value),
+ int>::type = 0
+@@ -724,7 +724,7 @@
+ template<typename Functor,typename Allocator>
+ BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a
+ #ifndef BOOST_NO_SFINAE
+- ,typename enable_if_c<
++ ,__attribute__ ((unused)) typename enable_if_c<
+ (boost::type_traits::ice_not<
+ (is_integral<Functor>::value)>::value),
+ int>::type = 0
+@@ -1055,7 +1055,7 @@
+ template<typename Functor>
+ function(Functor f
+ #ifndef BOOST_NO_SFINAE
+- ,typename enable_if_c<
++ ,__attribute__ ((unused)) typename enable_if_c<
+ (boost::type_traits::ice_not<
+ (is_integral<Functor>::value)>::value),
+ int>::type = 0
+@@ -1067,7 +1067,7 @@
+ template<typename Functor,typename Allocator>
+ function(Functor f, Allocator a
+ #ifndef BOOST_NO_SFINAE
+- ,typename enable_if_c<
++ ,__attribute__ ((unused)) typename enable_if_c<
+ (boost::type_traits::ice_not<
+ (is_integral<Functor>::value)>::value),
+ int>::type = 0
+--- misc/boost_1_44_0/boost/iterator/reverse_iterator.hpp 2004-08-12 19:13:07.000000000 +0200
++++ misc/build/boost_1_44_0/boost/iterator/reverse_iterator.hpp 2012-01-20 12:44:07.122316355 +0100
+@@ -34,7 +34,7 @@
+ template<class OtherIterator>
+ reverse_iterator(
+ reverse_iterator<OtherIterator> const& r
+- , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
++ , __attribute__ ((unused)) typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
+ )
+ : super_t(r.base())
+ {}
+--- misc/boost_1_44_0/boost/optional/optional.hpp 2012-01-20 15:24:32.364576113 +0100
++++ misc/build/boost_1_44_0/boost/optional/optional.hpp 2012-01-20 12:44:07.123316351 +0100
+@@ -365,7 +365,7 @@
+ // Converting constructions of optional<T> from optional<U> uses this function with
+ // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
+ template<class Expr>
+- void construct ( Expr const& expr, void const* )
++ void construct ( Expr const& expr, __attribute__ ((unused)) void const* )
+ {
+ new (m_storage.address()) internal_type(expr) ;
+ m_initialized = true ;
+@@ -376,7 +376,7 @@
+ // Converting assignments of optional<T> from optional<U> uses this function with
+ // 'Expr' being of type 'U' and relying on a converting assignment of T from U.
+ template<class Expr>
+- void assign_expr_to_initialized ( Expr const& expr, void const* )
++ void assign_expr_to_initialized ( Expr const& expr, __attribute__ ((unused)) void const* )
+ {
+ assign_value(expr, is_reference_predicate());
+ }
+@@ -846,12 +846,12 @@
+
+ template<class T>
+ inline
+-bool operator == ( none_t , optional<T> const& y )
++bool operator == ( __attribute__ ((unused)) none_t , optional<T> const& y )
+ { return equal_pointees(optional<T>() ,y); }
+
+ template<class T>
+ inline
+-bool operator < ( none_t , optional<T> const& y )
++bool operator < ( __attribute__ ((unused)) none_t , optional<T> const& y )
+ { return less_pointees(optional<T>() ,y); }
+
+ template<class T>
+--- misc/boost_1_44_0/boost/spirit/home/classic/actor/ref_const_ref_actor.hpp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/actor/ref_const_ref_actor.hpp 2012-01-20 12:44:07.124316347 +0100
+@@ -63,8 +63,8 @@
+
+ template<typename IteratorT>
+ void operator()(
+- IteratorT const& /*first*/,
+- IteratorT const& /*last*/
++ __attribute__ ((unused)) IteratorT const& /*first*/,
++ __attribute__ ((unused)) IteratorT const& /*last*/
+ ) const
+ {
+ this->act(ref,value_ref); // defined in ActionT
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/composite/no_actions.hpp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/composite/no_actions.hpp
+@@ -38,10 +38,10 @@
+ template<typename ActorT, typename AttrT, typename IteratorT>
+ void
+ do_action(
+- ActorT const& actor,
+- AttrT& val,
+- IteratorT const& first,
+- IteratorT const& last) const
++ __attribute__ ((unused)) ActorT const& actor,
++ __attribute__ ((unused)) AttrT& val,
++ __attribute__ ((unused)) IteratorT const& first,
++ __attribute__ ((unused)) IteratorT const& last) const
+ {}
+ };
+
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/composite/impl/directives.ipp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/composite/impl/directives.ipp 2012-01-20 12:44:07.124316347 +0100
+@@ -41,7 +41,7 @@
+ contiguous_parser_parse(
+ ST const& s,
+ ScannerT const& scan,
+- skipper_iteration_policy<BaseT> const&)
++ __attribute__ ((unused)) skipper_iteration_policy<BaseT> const&)
+ {
+ typedef scanner_policies<
+ no_skipper_iteration_policy<
+@@ -61,7 +61,7 @@
+ contiguous_parser_parse(
+ ST const& s,
+ ScannerT const& scan,
+- no_skipper_iteration_policy<BaseT> const&)
++ __attribute__ ((unused)) no_skipper_iteration_policy<BaseT> const&)
+ {
+ return s.parse(scan);
+ }
+@@ -85,7 +85,7 @@
+ implicit_lexeme_parse(
+ ParserT const& p,
+ ScannerT const& scan,
+- skipper_iteration_policy<BaseT> const&)
++ __attribute__ ((unused)) skipper_iteration_policy<BaseT> const&)
+ {
+ typedef scanner_policies<
+ no_skipper_iteration_policy<
+@@ -129,7 +129,7 @@
+ inhibit_case_parser_parse(
+ ST const& s,
+ ScannerT const& scan,
+- iteration_policy const&)
++ __attribute__ ((unused)) iteration_policy const&)
+ {
+ typedef scanner_policies<
+ inhibit_case_iteration_policy<
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
+@@ -83,7 +83,7 @@
+ { // Does _not_ copy the helpers member !
+ }
+
+- grammar_helper_list& operator=(grammar_helper_list const& x)
++ grammar_helper_list& operator=(__attribute__ ((unused)) grammar_helper_list const& x)
+ { // Does _not_ copy the helpers member !
+ return *this;
+ }
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/parser_context.hpp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/non_terminal/parser_context.hpp 2012-01-20 12:44:07.124316347 +0100
+@@ -51,15 +51,15 @@
+ typedef parser_context_linker<parser_context<AttrT> > context_linker_t;
+
+ template <typename ParserT>
+- parser_context(ParserT const&) {}
++ parser_context(__attribute__ ((unused)) ParserT const&) {}
+
+ template <typename ParserT, typename ScannerT>
+ void
+- pre_parse(ParserT const&, ScannerT const&) {}
++ pre_parse(__attribute__ ((unused)) ParserT const&, __attribute__ ((unused)) ScannerT const&) {}
+
+ template <typename ResultT, typename ParserT, typename ScannerT>
+ ResultT&
+- post_parse(ResultT& hit, ParserT const&, ScannerT const&)
++ post_parse(ResultT& hit, __attribute__ ((unused)) ParserT const&, __attribute__ ((unused)) ScannerT const&)
+ { return hit; }
+ };
+
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/primitives/impl/numerics.ipp 2012-01-20 15:24:32.364576113 +0100
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/primitives/impl/numerics.ipp 2012-01-20 12:44:07.125316343 +0100
+@@ -240,7 +240,7 @@
+ }
+
+ template <>
+- inline bool allow_more_digits<-1>(std::size_t)
++ inline bool allow_more_digits<-1>(__attribute__ ((unused)) std::size_t)
+ {
+ return true;
+ }
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/primitives/primitives.hpp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/primitives/primitives.hpp 2012-01-20 12:44:07.125316343 +0100
+@@ -316,7 +316,7 @@
+ anychar_parser() {}
+
+ template <typename CharT>
+- bool test(CharT) const
++ bool test(__attribute__ ((unused)) CharT) const
+ {
+ return true;
+ }
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/scanner/impl/skipper.ipp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/scanner/impl/skipper.ipp 2012-01-20 12:44:07.125316343 +0100
+@@ -122,7 +122,7 @@
+ IteratorT const& first_,
+ IteratorT const& last,
+ ParserT const& p,
+- space_parser const&)
++ __attribute__ ((unused)) space_parser const&)
+ {
+ typedef skipper_iteration_policy<> iter_policy_t;
+ typedef scanner_policies<iter_policy_t> scanner_policies_t;
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/scanner/scanner.hpp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/scanner/scanner.hpp 2012-01-20 12:44:07.126316338 +0100
+@@ -82,18 +82,18 @@
+ create_match(
+ std::size_t length,
+ AttrT const& val,
+- IteratorT const& /*first*/,
+- IteratorT const& /*last*/) const
++ __attribute__ ((unused)) IteratorT const& /*first*/,
++ __attribute__ ((unused)) IteratorT const& /*last*/) const
+ {
+ return match<AttrT>(length, val);
+ }
+
+ template <typename MatchT, typename IteratorT>
+ void group_match(
+- MatchT& /*m*/,
+- parser_id const& /*id*/,
+- IteratorT const& /*first*/,
+- IteratorT const& /*last*/) const {}
++ __attribute__ ((unused)) MatchT& /*m*/,
++ __attribute__ ((unused)) parser_id const& /*id*/,
++ __attribute__ ((unused)) IteratorT const& /*first*/,
++ __attribute__ ((unused)) IteratorT const& /*last*/) const {}
+
+ template <typename Match1T, typename Match2T>
+ void concat_match(Match1T& l, Match2T const& r) const
+@@ -126,8 +126,8 @@
+ call(
+ ActorT const& actor,
+ AttrT& val,
+- IteratorT const&,
+- IteratorT const&)
++ __attribute__ ((unused)) IteratorT const&,
++ __attribute__ ((unused)) IteratorT const&)
+ {
+ actor(val);
+ }
+--- misc/boost_1_44_0/boost/spirit/home/classic/core/scanner/skipper.hpp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/core/scanner/skipper.hpp 2012-01-20 12:44:07.126316338 +0100
+@@ -82,7 +82,7 @@
+
+ template <typename ScannerT>
+ void
+- skip(ScannerT const& /*scan*/) const {}
++ skip(__attribute__ ((unused)) ScannerT const& /*scan*/) const {}
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+--- misc/boost_1_44_0/boost/spirit/home/classic/meta/impl/refactoring.ipp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/meta/impl/refactoring.ipp 2012-01-20 12:44:07.126316338 +0100
+@@ -92,7 +92,7 @@
+
+ template <typename ParserT, typename ScannerT, typename BinaryT>
+ static typename parser_result<ParserT, ScannerT>::type
+- parse(ParserT const &, ScannerT const& scan, BinaryT const& binary)
++ parse(__attribute__ ((unused)) ParserT const &, ScannerT const& scan, BinaryT const& binary)
+ {
+ return binary.parse(scan);
+ }
+@@ -140,7 +140,7 @@
+ template <typename ParserT, typename ScannerT, typename BinaryT>
+ static typename parser_result<ParserT, ScannerT>::type
+ parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary,
+- non_nested_refactoring const&)
++ __attribute__ ((unused)) non_nested_refactoring const&)
+ {
+ typedef
+ typename BinaryT::left_t::parser_category_t
+@@ -205,7 +205,7 @@
+ typename NestedT
+ >
+ static typename parser_result<ParserT, ScannerT>::type
+- parse(ParserT const &, ScannerT const& scan, BinaryT const& binary,
++ parse(__attribute__ ((unused)) ParserT const &, ScannerT const& scan, BinaryT const& binary,
+ NestedT const& nested_d)
+ {
+ typedef typename BinaryT::parser_generator_t binary_gen_t;
+@@ -324,7 +324,7 @@
+ >
+ static typename parser_result<ParserT, ScannerT>::type
+ parse(ParserT const &, ScannerT const& scan, ActionT const &action,
+- NestedT const& nested_d)
++ __attribute__ ((unused)) NestedT const& nested_d)
+ {
+ return action.parse(scan);
+ }
+--- misc/boost_1_44_0/boost/spirit/home/classic/utility/impl/chset.ipp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/utility/impl/chset.ipp
+@@ -129,7 +129,7 @@
+ }
+
+ template <typename CharT>
+-inline chset<CharT>::chset(nothing_parser arg_)
++inline chset<CharT>::chset(__attribute__ ((unused)) nothing_parser arg_)
+ : ptr(new basic_chset<CharT>()) {}
+
+ template <typename CharT>
+@@ -182,7 +182,7 @@
+
+ template <typename CharT>
+ inline chset<CharT>&
+-chset<CharT>::operator=(anychar_parser rhs)
++chset<CharT>::operator=(__attribute__ ((unused)) anychar_parser rhs)
+ {
+ utility::impl::detach_clear(ptr);
+ ptr->set(
+@@ -194,7 +194,7 @@
+
+ template <typename CharT>
+ inline chset<CharT>&
+-chset<CharT>::operator=(nothing_parser rhs)
++chset<CharT>::operator=(__attribute__ ((unused)) nothing_parser rhs)
+ {
+ utility::impl::detach_clear(ptr);
+ return *this;
+--- misc/boost_1_44_0/boost/spirit/home/classic/utility/impl/chset_operators.ipp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/utility/impl/chset_operators.ipp 2012-01-20 12:44:07.127316333 +0100
+@@ -576,7 +576,7 @@
+ //////////////////////////////////
+ template <typename CharT>
+ inline chset<CharT>
+-operator-(anychar_parser, chset<CharT> const& b)
++operator-(__attribute__ ((unused)) anychar_parser, chset<CharT> const& b)
+ {
+ return ~b;
+ }
+--- misc/boost_1_44_0/boost/spirit/home/classic/utility/impl/lists.ipp 2008-06-22 17:05:38.000000000 +0200
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/utility/impl/lists.ipp 2012-01-20 12:44:07.127316333 +0100
+@@ -64,8 +64,8 @@
+ typename ItemT, typename DelimT
+ >
+ static typename parser_result<ParserT, ScannerT>::type
+- parse(ScannerT const& scan, ParserT const& /*p*/,
+- ItemT const &item, DelimT const &delim, no_list_endtoken const&)
++ parse(ScannerT const& scan, __attribute__ ((unused)) ParserT const& /*p*/,
++ ItemT const &item, DelimT const &delim, __attribute__ ((unused)) no_list_endtoken const&)
+ {
+ typedef refactor_action_gen<refactor_unary_gen<> > refactor_t;
+ const refactor_t refactor_item_d = refactor_t(refactor_unary_d);
+@@ -112,8 +112,8 @@
+ typename ItemT, typename DelimT
+ >
+ static typename parser_result<ParserT, ScannerT>::type
+- parse(ScannerT const& scan, ParserT const& /*p*/,
+- ItemT const &item, DelimT const &delim, no_list_endtoken const&)
++ parse(ScannerT const& scan, __attribute__ ((unused)) ParserT const& /*p*/,
++ ItemT const &item, DelimT const &delim, __attribute__ ((unused)) no_list_endtoken const&)
+ {
+ return (
+ (item - delim)
+--- misc/boost_1_44_0/boost/spirit/home/classic/phoenix/tuples.hpp
++++ misc/build/boost_1_44_0/boost/spirit/home/classic/phoenix/tuples.hpp
+@@ -211,7 +211,7 @@
+ typedef nil_t& rtype;
+ typedef nil_t const& crtype;
+
+- static nil_t get(TupleT const& t) { return nil_t(); }
++ static nil_t get(__attribute__ ((unused)) TupleT const& t) { return nil_t(); }
+ };
+
+ //////////////////////////////////
+--- misc/boost_1_44_0/boost/throw_exception.hpp 2010-07-03 23:32:02.000000000 +0200
++++ misc/build/boost_1_44_0/boost/throw_exception.hpp 2012-01-20 12:44:07.127316333 +0100
+@@ -49,7 +49,7 @@
+
+ #else
+
+-inline void throw_exception_assert_compatibility( std::exception const & ) { }
++inline void throw_exception_assert_compatibility( __attribute__ ((unused)) std::exception const & ) { }
+
+ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
+ {
+--- misc/boost_1_44_0/boost/utility/addressof.hpp 2009-05-16 20:15:17.000000000 +0200
++++ misc/build/boost_1_44_0/boost/utility/addressof.hpp 2012-01-20 12:44:07.128316328 +0100
+@@ -34,7 +34,7 @@
+
+ template<class T> struct addressof_impl
+ {
+- static inline T * f( T & v, long )
++ static inline T * f( T & v, __attribute__ ((unused)) long )
+ {
+ return reinterpret_cast<T*>(
+ &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
+--- misc/boost_1_44_0/boost/variant/detail/visitation_impl.hpp 2010-06-10 17:32:07.000000000 +0200
++++ misc/build/boost_1_44_0/boost/variant/detail/visitation_impl.hpp 2012-01-20 12:44:07.128316328 +0100
+@@ -121,7 +121,7 @@
+ inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+ visitation_impl_invoke_impl(
+- int, Visitor& visitor, VoidPtrCV storage, T*
++ int, Visitor& visitor, VoidPtrCV storage, __attribute__ ((unused)) T*
+ , mpl::true_// never_uses_backup
+ )
+ {
+@@ -158,7 +158,7 @@
+ visitation_impl_invoke(
+ int internal_which, Visitor& visitor, VoidPtrCV storage, T* t
+ , NoBackupFlag
+- , int
++ , __attribute__ ((unused)) int
+ )
+ {
+ typedef typename mpl::or_<
+@@ -176,7 +176,7 @@
+ template <typename Visitor, typename VoidPtrCV, typename NBF>
+ inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+-visitation_impl_invoke(int, Visitor&, VoidPtrCV, apply_visitor_unrolled*, NBF, long)
++visitation_impl_invoke(__attribute__ ((unused)) int, __attribute__ ((unused)) Visitor&, VoidPtrCV, __attribute__ ((unused)) apply_visitor_unrolled*, NBF, __attribute__ ((unused)) long)
+ {
+ // should never be here at runtime:
+ BOOST_ASSERT(false);
+@@ -198,9 +198,9 @@
+ inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+ visitation_impl(
+- int, int, Visitor&, VPCV
++ __attribute__ ((unused)) int, __attribute__ ((unused)) int, __attribute__ ((unused)) Visitor&, VPCV
+ , mpl::true_ // is_apply_visitor_unrolled
+- , NBF, W* = 0, S* = 0
++ , NBF, __attribute__ ((unused)) W* = 0, __attribute__ ((unused)) S* = 0
+ )
+ {
+ // should never be here at runtime:
+@@ -221,7 +221,7 @@
+ , Visitor& visitor, VoidPtrCV storage
+ , mpl::false_ // is_apply_visitor_unrolled
+ , NoBackupFlag no_backup_flag
+- , Which* = 0, step0* = 0
++ , __attribute__ ((unused)) Which* = 0, __attribute__ ((unused)) step0* = 0
+ )
+ {
+ // Typedef apply_visitor_unrolled steps and associated types...
+--- misc/boost_1_44_0/boost/variant/get.hpp 2005-08-25 18:27:28.000000000 +0200
++++ misc/build/boost_1_44_0/boost/variant/get.hpp 2012-01-20 12:44:07.129316324 +0100
+@@ -85,7 +85,7 @@
+ }
+
+ template <typename U>
+- pointer operator()(const U&) const
++ pointer operator()(__attribute__ ((unused)) const U&) const
+ {
+ return static_cast<pointer>(0);
+ }
+--- misc/boost_1_44_0/boost/variant/variant.hpp 2010-06-10 17:32:07.000000000 +0200
++++ misc/build/boost_1_44_0/boost/variant/variant.hpp 2012-01-20 12:44:07.129316324 +0100
+@@ -290,7 +290,7 @@
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+- internal_visit(T& operand, int) const
++ internal_visit(T& operand, __attribute__ ((unused)) int) const
+ {
+ operand.~T();
+
+@@ -404,7 +404,7 @@
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+- internal_visit(const T& operand, int) const
++ internal_visit(const T& operand, __attribute__ ((unused)) int) const
+ {
+ new(storage_) T(operand);
+ BOOST_VARIANT_AUX_RETURN_VOID;
+@@ -454,7 +454,7 @@
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+- internal_visit(T& lhs_content, int) const
++ internal_visit(T& lhs_content, __attribute__ ((unused)) int) const
+ {
+ // NOTE TO USER :
+ // Compile error here indicates one of variant's bounded types does
+@@ -502,7 +502,7 @@
+ }
+
+ template <typename U>
+- bool operator()(U&) BOOST_NOEXCEPT
++ bool operator()(__attribute__ ((unused)) U&) BOOST_NOEXCEPT
+ {
+ return false;
+ }
+@@ -827,7 +827,7 @@
+ public: // internal visitor interfaces
+
+ template <typename T>
+- result_type internal_visit(T& operand, int)
++ result_type internal_visit(T& operand, __attribute__ ((unused)) int)
+ {
+ return visitor_(operand);
+ }
+@@ -1225,7 +1225,7 @@
+ public: // internal visitor interfaces (below)
+
+ template <typename T>
+- int internal_visit(T& operand, int) const
++ int internal_visit(T& operand, __attribute__ ((unused)) int) const
+ {
+ // NOTE TO USER :
+ // Compile error here indicates one of the source variant's types
+@@ -1288,7 +1288,7 @@
+ template <typename T>
+ void convert_construct(
+ T& operand
+- , int
++ , __attribute__ ((unused)) int
+ , mpl::false_ = mpl::false_() // is_foreign_variant
+ )
+ {
+@@ -1308,7 +1308,7 @@
+ template <typename Variant>
+ void convert_construct(
+ Variant& operand
+- , long
++ , __attribute__ ((unused)) long
+ , mpl::true_// is_foreign_variant
+ )
+ {
+@@ -1348,7 +1348,7 @@
+ template <BOOST_VARIANT_ENUM_PARAMS(typename U)>
+ void convert_construct(
+ boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)>& operand
+- , long
++ , __attribute__ ((unused)) long
+ )
+ {
+ convert_construct_variant(operand);
+@@ -1553,7 +1553,7 @@
+
+ template <typename RhsT>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+- internal_visit(const RhsT& rhs_content, int)
++ internal_visit(const RhsT& rhs_content, __attribute__ ((unused)) int)
+ {
+ typedef typename has_nothrow_copy<RhsT>::type
+ nothrow_copy;
+--- misc/boost_1_44_0/boost/ptr_container/detail/default_deleter.hpp
++++ misc/build/boost_1_44_0/boost/ptr_container/detail/default_deleter.hpp
+@@ -61,7 +61,7 @@
+ {
+ default_deleter() { }
+ template<typename TT>
+- default_deleter(default_deleter<TT> tt) { }
++ default_deleter(__attribute__ ((unused)) default_deleter<TT> tt) { }
+ };
+
+ } } } // End namespaces ptr_container_detail, move_ptrs, boost.
+--- misc/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp
++++ misc/build/boost_1_44_0/boost/ptr_container/ptr_sequence_adapter.hpp
+@@ -664,8 +664,8 @@
+
+ }
+
+- void range_check_impl( iterator first, iterator last,
+- std::bidirectional_iterator_tag )
++ void range_check_impl( __attribute__ ((unused)) iterator first, __attribute__ ((unused)) iterator last,
++ std::bidirectional_iterator_tag )
+ { /* do nothing */ }
+
+ void range_check_impl( iterator first, iterator last,
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,cairo,cairo))
+
+$(eval $(call gb_ExternalPackage_use_external_project,cairo,cairo))
+
+$(eval $(call gb_ExternalPackage_add_file,cairo,$(LIBO_LIB_FOLDER)/libcairo.so.2,src/.libs/libcairo.so.2.11000.2))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,pixman,pixman))
+
+$(eval $(call gb_ExternalPackage_use_external_project,pixman,pixman))
+
+$(eval $(call gb_ExternalPackage_add_file,pixman,$(LIBO_LIB_FOLDER)/libpixman-1.so.0,pixman/.libs/libpixman-1.so.0.24.4))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,cairo))
+
+$(eval $(call gb_ExternalProject_use_external_project,cairo,pixman))
+
+$(eval $(call gb_ExternalProject_register_targets,cairo,\
+ build \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+
+$(call gb_ExternalProject_get_state_target,cairo,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(MAKE) -f Makefile.win32 CFG=release ZLIB3RDLIB=zlib.lib \
+ )
+
+
+else
+
+# overwrite src/cairo-version.h because that is just a dummy file and included
+# from cairo.h in non-overridable way
+
+$(call gb_ExternalProject_get_state_target,cairo,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ $(if $(debug),STRIP=" ") \
+ CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS)" \
+ $(if $(filter ANDROID IOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \
+ pixman_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,pixman)/pixman" \
+ pixman_LIBS="-L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs -lpixman-1" \
+ COMPRESS=$(if $(SYSTEM_ZLIB),compress,z_compress) \
+ ZLIB3RDLIB="$(if $(SYSTEM_ZLIB),,-L$(WORKDIR)/LinkTarget/StaticLibrary) -lz" \
+ png_REQUIRES="trick_configure_into_using_png_CFLAGS_and_LIBS" \
+ png_CFLAGS="$(LIBPNG_CFLAGS)" png_LIBS="$(LIBPNG_LIBS)" \
+ $(if $(filter IOS,$(OS)),--disable-shared,--disable-static) \
+ $(if $(filter ANDROID IOS,$(OS)),--disable-xlib,--enable-xlib) \
+ $(if $(filter IOS,$(OS)),--enable-quartz --enable-quartz-font) \
+ --disable-valgrind \
+ $(if $(filter IOS,$(OS)),--disable-ft,--enable-ft --enable-fc) \
+ --disable-svg --enable-gtk-doc=no --enable-test-surfaces=no \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && cp cairo-version.h src/cairo-version.h \
+ && cd src && $(MAKE) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,pixman))
+
+$(eval $(call gb_ExternalProject_register_targets,pixman,\
+ build \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+
+$(call gb_ExternalProject_get_state_target,pixman,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(MAKE) -f Makefile.win32 MMX=on SSE2=on CFG=release \
+ ,pixman)
+
+else
+
+# ANDROID:
+# The pixman-cpu.c code wants to read /proc/<pid>/auxv, but
+# the Android headers don't define Elf32_auxv_t.
+#
+# Maybe we should instead just patch the arm_has_* booleans in
+# pixman-cpu.c to be hardcoded as TRUE and patch out the run-time
+# check?
+$(call gb_ExternalProject_get_state_target,pixman,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ $(if $(filter MACOSX IOS,$(OS)),--disable-shared,--disable-static) \
+ $(if $(filter ANDROID,$(OS)),--disable-arm-simd --disable-arm-neon --disable-arm-iwmmxt) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,cairo))
+
+$(eval $(call gb_Module_add_targets,cairo,\
+ ExternalPackage_cairo \
+ ExternalPackage_pixman \
+ ExternalProject_cairo \
+ ExternalProject_pixman \
+ UnpackedTarball_cairo \
+ UnpackedTarball_pixman \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+The graphics library, used for anti-aliasing. From [http://cairographics.org/].
+
+This code is used by default only on Linux, though it is also
+available on Mac. There is a cairo-canvas implementation that is the
+main customer, and it is enabled via 'use hardware acceleration' in
+the general options.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,cairo))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,cairo,$(CAIRO_TARBALL),,cairo))
+
+$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
+ external/cairo/cairo/cairo-1.10.2.patch \
+ external/cairo/cairo/cairo.dlsym.lcdfilter.patch \
+ external/cairo/cairo/cairo-1.10.2-oldfontconfig.patch \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
+ external/cairo/cairo/cairo-1.10.2.wntmsc.patch \
+))
+endif
+
+# FIXME add cairo/cairo/cairo-1.10.2.no-atsui.patch for MACOSX >= 1070
+ifeq ($(OS),IOS)
+$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
+ external/cairo/cairo/cairo-1.10.2.no-atsui.patch \
+ external/cairo/cairo/cairo-1.10.2.ios.patch \
+))
+endif
+
+ifeq ($(OS),ANDROID)
+$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
+ external/cairo/cairo/cairo-1.10.2.android.patch \
+))
+endif
+
+ifneq (,$(filter ANDROID IOS,$(OS)))
+$(eval $(call gb_UnpackedTarball_add_file,cairo,.,external/cairo/cairo/dummy_pkg_config))
+endif
+
+ifeq ($(COM_GCC_IS_CLANG),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,cairo,\
+ external/cairo/cairo/no-flto-clang.patch \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,pixman))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,pixman,$(PIXMAN_TARBALL),,cairo))
+
+$(eval $(call gb_UnpackedTarball_add_patches,pixman,\
+ external/cairo/pixman/pixman-0.24.4.patch \
+))
+
+ifeq ($(OS),ANDROID)
+$(eval $(call gb_UnpackedTarball_add_patches,pixman,\
+ external/cairo/pixman/pixman-0.24.4.android.patch \
+))
+endif
+
+ifeq ($(OS)$(COM),WNTMSC)
+$(eval $(call gb_UnpackedTarball_add_file,pixman,pixman,external/cairo/pixman/Makefile.win32.common))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/cairo-1.10.2/configure 2012-02-20 23:25:52.000000000 -0800
++++ misc/build/cairo-1.10.2/configure 2012-02-20 11:53:05.000000000 -0800
+@@ -29672,7 +29672,7 @@
+ fi
+
+
+-FONTCONFIG_MIN_VERSION=2.2.95
++FONTCONFIG_MIN_VERSION=2.2.3
+ # Check whether --enable-fc was given.
+ if test "${enable_fc+set}" = set; then :
+ enableval=$enable_fc; enable_fc=$enableval
--- /dev/null
+--- misc/cairo-1.10.2/build/ltmain.sh
++++ misc/build/cairo-1.10.2/build/ltmain.sh
+@@ -3228,6 +3228,10 @@
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
++ # Force no versioning suffix for Android
++
++ version_type=none
++
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
--- /dev/null
+--- misc/cairo-1.10.2/configure 2011-12-16 10:02:39.626077757 +0100
++++ misc/build/cairo-1.10.2/configure 2011-12-16 10:02:23.518237109 +0100
+@@ -22766,11 +22766,13 @@
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "ApplicationServices/ApplicationServices.h" "ac_cv_header_ApplicationServices_ApplicationServices_h" "$ac_includes_default"
++if false; then
+ if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" = x""yes; then :
+
+ else
+ use_quartz="no (requires ApplicationServices framework)"
+ fi
++fi
+
+
+ if test "x$use_quartz" != "xyes" ; then
+--- misc/cairo-1.10.2/src/cairo-quartz.h 2011-12-16 10:02:39.639079241 +0100
++++ misc/build/cairo-1.10.2/src/cairo-quartz.h 2011-12-16 10:01:18.404789245 +0100
+@@ -40,7 +40,7 @@
+
+ #if CAIRO_HAS_QUARTZ_SURFACE
+
+-#include <ApplicationServices/ApplicationServices.h>
++#include <CoreGraphics/CoreGraphics.h>
+
+ CAIRO_BEGIN_DECLS
+
--- /dev/null
+--- misc/cairo-1.10.2/src/cairo-quartz-font.c 2010-12-25 15:21:34.000000000 +0100
++++ misc/build/cairo-1.10.2/src/cairo-quartz-font.c 2011-12-16 09:54:18.672445207 +0100
+@@ -777,7 +777,7 @@
+ return ffont->cgFont;
+ }
+
+-#ifndef __LP64__
++#if 0
+ /*
+ * compat with old ATSUI backend
+ */
+--- misc/cairo-1.10.2/src/cairo-quartz.h 2010-06-18 13:47:13.000000000 +0200
++++ misc/build/cairo-1.10.2/src/cairo-quartz.h 2011-12-16 09:52:53.081501547 +0100
+@@ -66,7 +66,7 @@
+ cairo_public cairo_font_face_t *
+ cairo_quartz_font_face_create_for_cgfont (CGFontRef font);
+
+-#ifndef __LP64__
++#if 0
+ cairo_public cairo_font_face_t *
+ cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id);
+ #endif
--- /dev/null
+--- misc/cairo-1.10.2/build/Makefile.win32.features 2010-08-18 09:47:30.000000000 +0200
++++ misc/build/cairo-1.10.2/build/Makefile.win32.features 2011-12-20 09:57:06.428170146 +0100
+@@ -30,7 +30,7 @@
+ CAIRO_HAS_FC_FONT=0
+ CAIRO_HAS_PS_SURFACE=1
+ CAIRO_HAS_PDF_SURFACE=1
+-CAIRO_HAS_SVG_SURFACE=1
++CAIRO_HAS_SVG_SURFACE=0
+ CAIRO_HAS_TEST_SURFACES=0
+ CAIRO_HAS_TEE_SURFACE=0
+ CAIRO_HAS_XML_SURFACE=0
+--- misc/cairo-1.10.2/build/Makefile.win32.common 2009-06-14 23:53:24.000000000 +0200
++++ misc/build/cairo-1.10.2/build/Makefile.win32.common 2009-06-14 23:53:24.000000000 +0200
+@@ -22,24 +22,26 @@
+ OPT := -MD -O2
+ endif
+
+-PIXMAN_CFLAGS := -I$(top_srcdir)/../pixman/pixman
+-PIXMAN_LIBS := $(top_builddir)/../pixman/pixman/$(CFG)/pixman-1.lib
++PIXMAN_CFLAGS := -I../../../../inc
++PIXMAN_LIBS := ../../../../lib/pixman-1.lib
+
+ CAIRO_LIBS = gdi32.lib msimg32.lib user32.lib
+ ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
+ LIBPNG_CFLAGS += -I$(top_srcdir)/../libpng/
+-CAIRO_LIBS += $(top_builddir)/../libpng/libpng.lib
++CAIRO_LIBS += libpng.lib
+ endif
+ ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00)
+ else
+ ZLIB_CFLAGS += -I$(top_srcdir)/../zlib/
+-CAIRO_LIBS += $(top_builddir)/../zlib/zdll.lib
++CAIRO_LIBS += $(ZLIB3RDLIB)
+ endif
+
+ DEFAULT_CFLAGS = -nologo $(MS_MDFLAGS) $(OPT)
+ DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+ DEFAULT_CFLAGS += -I. -I$(top_srcdir)
+ DEFAULT_CFLAGS += $(PIXMAN_CFLAGS) $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS)
++DEFAULT_CFLAGS += $(SOLARINC)
++DEFAULT_CFLAGS += -DDISABLE_SOME_FLOATING_POINT=1
+
+ CAIRO_CFLAGS = $(DEFAULT_CFLAGS) $(CFLAGS)
+
+@@ -61,7 +63,7 @@
+
+ $(CFG)/%.obj: %.c
+ @mkdir -p $(CFG)
+- @$(CC) $(CAIRO_CFLAGS) -c -Fo"$@" $<
++ $(CC) $(CAIRO_CFLAGS) -c -Fo"$@" $<
+
+ $(CFG)/%-static.obj: %.c
+ @mkdir -p $(CFG)
+--- misc/cairo-1.10.2/build/config.sub 2009-08-14 23:33:32.000000000 +0200
++++ misc/build/cairo-1.10.2/build/config.sub 2009-08-14 23:33:32.000000000 +0200
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1272,7 +1272,7 @@
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -udi* | -linux-androideabi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+--- misc/cairo-1.10.2/configure 2010-12-25 15:22:57.000000000 +0100
++++ misc/build/cairo-1.10.2/configure 2010-12-25 15:22:57.000000000 +0100
+@@ -19259,61 +19259,11 @@
+ rm -f confcache
+
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5
+-$as_echo_n "checking for compress in -lz... " >&6; }
+-if test "${ac_cv_lib_z_compress+set}" = set; then :
+- $as_echo_n "(cached) " >&6
+-else
+- ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lz $LIBS"
+-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
+-/* Override any GCC internal prototype to avoid an error.
+- Use char because int might match the return type of a GCC
+- builtin and then its argument prototype would still apply. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char compress ();
+-int
+-main ()
+-{
+-return compress ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_z_compress=yes
+-else
+- ac_cv_lib_z_compress=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5
+-$as_echo "$ac_cv_lib_z_compress" >&6; }
+-if test "x$ac_cv_lib_z_compress" = x""yes; then :
+- ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+-if test "x$ac_cv_header_zlib_h" = x""yes; then :
+-
+ have_libz=yes
+
+ $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+
+
+-else
+- have_libz="no (requires zlib http://www.gzip.org/zlib/)"
+-fi
+-
+-
+-else
+- have_libz="no (requires zlib http://www.gzip.org/zlib/)"
+-fi
+-
+-
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5
+ $as_echo_n "checking for dlsym in -ldl... " >&6; }
+ if test "${ac_cv_lib_dl_dlsym+set}" = set; then :
+@@ -26427,7 +26367,7 @@
+
+ if test "x$png_REQUIRES" = x; then
+ # libpng13 is GnuWin32's libpng-1.2.8 :-(
+- for l in libpng libpng14 libpng12 libpng13 libpng10; do
++ for l in libpng libpng14 libpng12 libpng15 libpng13 libpng10; do
+ if $PKG_CONFIG --exists $l ; then
+ png_REQUIRES=$l
+ use_png=yes
+@@ -29424,7 +29424,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - OK" >&5
+ $as_echo "$FREETYPE_VERSION - OK" >&6; }
+ ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags`
+- ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs`
++ ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs | $SED -e 's/-lz//g'`
+ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_VERSION - Too old" >&5
+ $as_echo "$FREETYPE_VERSION - Too old" >&6; }
+ use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)"
+@@ -29434,7 +29434,7 @@
+ fi
+
+ ft_CFLAGS="$FREETYPE_CFLAGS"
+- ft_LIBS="$FREETYPE_LIBS"
++ ft_LIBS=`echo "$FREETYPE_LIBS" | $SED -e 's/-lz//g'`
+
+ cairo_cv_ft_use=$use_ft
+ cairo_cv_ft_cache_vars=" BASE REQUIRES CFLAGS NONPKGCONFIG_CFLAGS LIBS NONPKGCONFIG_LIBS NONPKGCONFIG_EXTRA_LIBS"
+@@ -30121,7 +30121,7 @@
+
+ # The ps backend requires zlib.
+ use_ps=$have_libz
+- ps_NONPKGCONFIG_LIBS=-lz
++ ps_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+
+ cairo_cv_ps_use=$use_ps
+ cairo_cv_ps_cache_vars=" BASE REQUIRES CFLAGS NONPKGCONFIG_CFLAGS LIBS NONPKGCONFIG_LIBS NONPKGCONFIG_EXTRA_LIBS"
+@@ -30549,7 +30549,7 @@
+
+ # The pdf backend requires zlib.
+ use_pdf=$have_libz
+- pdf_NONPKGCONFIG_LIBS=-lz
++ pdf_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+
+ cairo_cv_pdf_use=$use_pdf
+ cairo_cv_pdf_cache_vars=" BASE REQUIRES CFLAGS NONPKGCONFIG_CFLAGS LIBS NONPKGCONFIG_LIBS NONPKGCONFIG_EXTRA_LIBS"
+@@ -32296,7 +32296,7 @@
+
+
+ use_xml=$have_libz
+- xml_NONPKGCONFIG_LIBS=-lz
++ xml_NONPKGCONFIG_LIBS=$ZLIB3RDLIB
+
+ cairo_cv_xml_use=$use_xml
+ cairo_cv_xml_cache_vars=" BASE REQUIRES CFLAGS NONPKGCONFIG_CFLAGS LIBS NONPKGCONFIG_LIBS NONPKGCONFIG_EXTRA_LIBS"
+@@ -32864,7 +32864,7 @@
+ $_compile_program
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- cairo_cc_stderr=`test -f conftest.err && cat conftest.err`
++ cairo_cc_stderr=`test -f conftest.err && grep -v 'ld: warning: object file compiled with -mlong-branch which is no longer needed.' conftest.err`
+ cairo_cc_flag=yes
+ else
+ cairo_cc_stderr=`test -f conftest.err && cat conftest.err`
+--- misc/cairo-1.10.2/src/cairo-output-stream.c 2010-07-12 10:57:03.000000000 +0200
++++ misc/build/cairo-1.10.2/src/cairo-output-stream.c 2010-07-12 10:57:03.000000000 +0200
+@@ -313,7 +313,11 @@
+ d = 0.0;
+
+ locale_data = localeconv ();
++#ifdef __ANDROID__
++ decimal_point = ".";
++#else
+ decimal_point = locale_data->decimal_point;
++#endif
+ decimal_point_len = strlen (decimal_point);
+
+ assert (decimal_point_len != 0);
+--- misc/cairo-1.10.2/src/cairo-ft-font.c 2010-12-25 15:21:34.000000000 +0100
++++ misc/build/cairo-1.10.2/src/cairo-ft-font.c 2010-12-25 15:21:34.000000000 +0100
+@@ -534,16 +534,16 @@
+ ret = FcPatternGetFTFace (pattern, FC_FT_FACE, 0, &font_face);
+ if (ret == FcResultMatch)
+ goto DONE;
+- if (ret == FcResultOutOfMemory)
++ if (ret == 4 /*FcResultOutOfMemory*/)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+
+ ret = FcPatternGetString (pattern, FC_FILE, 0, (FcChar8 **) &filename);
+- if (ret == FcResultOutOfMemory)
++ if (ret == 4 /*FcResultOutOfMemory*/)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ if (ret == FcResultMatch) {
+ /* If FC_INDEX is not set, we just use 0 */
+ ret = FcPatternGetInteger (pattern, FC_INDEX, 0, &id);
+- if (ret == FcResultOutOfMemory)
++ if (ret == 4 /*FcResultOutOfMemory*/)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+
+ goto DONE;
--- /dev/null
+--- misc/cairo-1.10.2/src/Makefile.sources 2010-12-25 07:21:34.000000000 -0700
++++ misc/build/cairo-1.10.2/src/Makefile.sources 2011-12-16 08:44:19.209301900 -0700
+@@ -214,7 +214,7 @@
+ cairo_pdf_headers = cairo-pdf.h
+ cairo_pdf_private = cairo-pdf-surface-private.h
+ cairo_pdf_sources = cairo-pdf-surface.c
+-if CAIRO_HAS_PDF_SURFACE
++ifeq ($(CAIRO_HAS_PDF_SURFACE),1)
+ req_cairo_deflate_stream_sources = $(cairo_deflate_stream_sources)
+ endif
+
+@@ -248,7 +248,7 @@
+ cairo-xlib-surface-private.h \
+ cairo-xlib-xrender-private.h \
+ $(NULL)
+-if BUILD_XLIB_XCB
++ifeq ($(BUILD_XLIB_XCB),1)
+ cairo_xlib_sources = cairo-xlib-xcb-surface.c
+ else
+ cairo_xlib_sources = \
+@@ -273,7 +273,7 @@
+ cairo-xcb-surface-core.c \
+ cairo-xcb-surface-render.c \
+ $(NULL)
+-if BUILD_XCB_SHM
++ifeq ($(BUILD_XCB_SHM),1)
+ cairo_xcb_sources += \
+ cairo-xcb-shm.c \
+ cairo-xcb-connection-shm.c \
+@@ -322,7 +322,7 @@
+ cairo-gl-gradient.c \
+ cairo-gl-shaders.c \
+ cairo-gl-surface.c
+-if BUILD_PRIVATE_GLEW
++ifeq ($(BUILD_PRIVATE_GLEW),1)
+ cairo_gl_sources += glew/glew.c
+ endif
+
+@@ -373,7 +373,7 @@
+
+ cairo_script_headers = cairo-script.h
+ cairo_script_sources = cairo-script-surface.c
+-if CAIRO_HAS_SCRIPT_SURFACE
++ifeq ($(CAIRO_HAS_SCRIPT_SURFACE),1)
+ req_cairo_deflate_stream_sources = $(cairo_deflate_stream_sources)
+ endif
+
+@@ -383,7 +383,7 @@
+
+ cairo_xml_headers = cairo-xml.h
+ cairo_xml_sources = cairo-xml-surface.c
+-if CAIRO_HAS_XML_SURFACE
++ifeq ($(CAIRO_HAS_XML_SURFACE),1)
+ req_cairo_deflate_stream_sources = $(cairo_deflate_stream_sources)
+ endif
+
--- /dev/null
+--- misc/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:09:21.500373823 +0000
++++ misc/build/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:31:01.645238786 +0000
+@@ -59,6 +59,8 @@
+
+ #if HAVE_FT_LIBRARY_SETLCDFILTER
+ #include FT_LCD_FILTER_H
++#elif HAVE_DLFCN_H
++#include <dlfcn.h>
+ #endif
+
+ /* Fontconfig version older than 2.6 didn't have these options */
+@@ -1217,6 +1219,26 @@
+ return CAIRO_STATUS_SUCCESS;
+ }
+
++static void try_FT_Library_SetLcdFilter( FT_Library library,
++ int lcd_filter )
++{
++#if HAVE_FT_LIBRARY_SETLCDFILTER
++ FT_Library_SetLcdFilter (library, lcd_filter);
++#elif HAVE_DLFCN_H
++ static void (*pFT_Library_SetLcdFilter) (FT_Library, int);
++ static int dlsymed = 0;
++
++ if (!dlsymed)
++ {
++ pFT_Library_SetLcdFilter = dlsym(RTLD_DEFAULT, "FT_Library_SetLcdFilter");
++ dlsymed = 1;
++ }
++
++ if (pFT_Library_SetLcdFilter)
++ (*pFT_Library_SetLcdFilter) (library, lcd_filter);
++#endif
++}
++
+ /* Converts an outline FT_GlyphSlot into an image
+ *
+ * This could go through _render_glyph_bitmap as well, letting
+@@ -1350,15 +1372,11 @@
+ break;
+ }
+
+-#if HAVE_FT_LIBRARY_SETLCDFILTER
+- FT_Library_SetLcdFilter (library, lcd_filter);
+-#endif
++ try_FT_Library_SetLcdFilter(library, lcd_filter);
+
+ fterror = FT_Render_Glyph (face->glyph, render_mode);
+
+-#if HAVE_FT_LIBRARY_SETLCDFILTER
+- FT_Library_SetLcdFilter (library, FT_LCD_FILTER_NONE);
+-#endif
++ try_FT_Library_SetLcdFilter(library, FT_LCD_FILTER_NONE);
+
+ if (fterror != 0)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
--- /dev/null
+#!/bin/sh
+
+
--- /dev/null
+--- misc/cairo-1.10.2/configure.sav 2013-06-26 15:00:42.000000000 +0200
++++ misc/cairo-1.10.2/configure 2013-06-26 15:03:36.995117032 +0200
+@@ -17236,7 +17236,7 @@ MAYBE_WARN="-Wall -Wextra \
+ MAYBE_WARN="$MAYBE_WARN -erroff=E_ENUM_TYPE_MISMATCH_ARG \
+ -erroff=E_ENUM_TYPE_MISMATCH_OP"
+
+-MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common -flto"
++MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
+
+ MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2"
+
--- /dev/null
+LIBRARY = pixman-1
+
+CC = cl
+LD = link
+AR = lib
+PERL = perl
+
+ifeq ($(top_builddir),)
+top_builddir = $(top_srcdir)
+endif
+
+CFG_VAR = $(CFG)
+ifeq ($(CFG_VAR),)
+CFG_VAR = release
+endif
+
+ifeq ($(CFG_VAR),debug)
+CFG_CFLAGS = -MD -Od -Zi
+CFG_LDFLAGS = -DEBUG
+else
+CFG_CFLAGS = -MD -O2
+CFG_LDFLAGS =
+endif
+
+# Package definitions, to be used instead of those provided in config.h
+PKG_CFLAGS = -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
+
+BASE_CFLAGS = -nologo -I. -I$(top_srcdir) -I$(top_srcdir)/pixman
+
+PIXMAN_CFLAGS = $(BASE_CFLAGS) $(PKG_CFLAGS) $(CFG_CFLAGS) $(CFLAGS)
+PIXMAN_LDFLAGS = -nologo $(CFG_LDFLAGS) $(LDFLAGS)
+PIXMAN_ARFLAGS = -nologo $(LDFLAGS)
+
+
+inform:
+ifneq ($(CFG),release)
+ifneq ($(CFG),debug)
+ifneq ($(CFG),)
+ @echo "Invalid specified configuration option: "$(CFG)"."
+ @echo
+ @echo "Possible choices for configuration are 'release' and 'debug'"
+ @exit 1
+endif
+ @echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
+endif
+endif
+
+
+$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES)
+ @mkdir -p $(CFG_VAR)
+ @$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
+
+clean: inform
+ @$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} $(BUILT_SOURCES) || exit 0
--- /dev/null
+--- misc/pixman-0.24.4/ltmain.sh
++++ misc/build/pixman-0.24.4/ltmain.sh
+@@ -3228,6 +3228,10 @@
+ fi
+ else
+
++ # Force no versioning suffix for Android
++
++ version_type=none
++
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
--- /dev/null
+--- misc/pixman-0.24.4/Makefile.in 2011-11-06 22:11:25.000000000 +0100
++++ misc/build/pixman-0.24.4/Makefile.in 2011-12-16 09:06:45.317211035 +0100
+@@ -272,7 +272,7 @@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = pixman demos test
++SUBDIRS = pixman
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = pixman-1.pc
+ GPGKEY = 6FF7C1A8
+--- misc/pixman-0.24.4/config.sub 2008-08-30 00:27:25.000000000 +0200
++++ misc/build/pixman-0.24.4/config.sub 2011-12-16 09:05:14.595773609 +0100
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1247,7 +1247,7 @@
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -udi* | -linux-androideabi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+--- misc/pixman-0.24.4/configure 2011-11-06 22:11:27.000000000 +0100
++++ misc/build/pixman-0.24.4/configure 2011-12-16 09:06:16.482898083 +0100
+@@ -20202,6 +20202,13 @@
+
+
+
++# getisax is falsely detected when using OOo build script on Linux/FBSD...
++case "$build_os" in
++ linux-gnu*)
++ ;;
++ freebsd*)
++ ;;
++ *)
+
+ for ac_func in getisax
+ do
+@@ -20304,6 +20311,8 @@
+ done
+
+
++ ;;
++esac
+ { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+ $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+ if test "${ac_cv_c_bigendian+set}" = set; then
+@@ -24552,7 +24552,7 @@
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+- pixman_cc_stderr=`test -f conftest.err && cat conftest.err`
++ pixman_cc_stderr=`test -f conftest.err && grep -v 'ld: warning: object file compiled with -mlong-branch which is no longer needed.' conftest.err`
+ pixman_cc_flag=yes
+ else
+ $as_echo "$as_me: failed program was:" >&5
+--- misc/pixman-0.24.4/pixman/pixman-utils.c
++++ misc/build/pixman-0.24.4/pixman/pixman-utils.c
+@@ -27,6 +27,7 @@
+ #endif
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <limits.h>
+
+ #include "pixman-private.h"
+
+--- misc/pixman-0.24.4/pixman/pixman-mmx.c 2011-11-06 13:47:42.000000000 -0700
++++ misc/build/pixman-0.24.4/pixman/pixman-mmx.c 2011-12-19 00:41:42.280402800 -0700
+@@ -309,7 +309,7 @@
+
+ /* Elemental unaligned loads */
+
+-static __inline__ __m64 ldq_u(uint64_t *p)
++static inline __m64 ldq_u(uint64_t *p)
+ {
+ #ifdef USE_X86_MMX
+ /* x86's alignment restrictions are very relaxed. */
+@@ -328,7 +328,7 @@
+ #endif
+ }
+
+-static __inline__ uint32_t ldl_u(uint32_t *p)
++static inline uint32_t ldl_u(uint32_t *p)
+ {
+ #ifdef USE_X86_MMX
+ /* x86's alignment restrictions are very relaxed. */
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,clucene))
+
+$(eval $(call gb_Library_use_external,clucene,zlib))
+
+$(eval $(call gb_Library_use_unpacked,clucene,clucene))
+
+$(eval $(call gb_Library_set_warnings_not_errors,clucene))
+
+$(eval $(call gb_Library_set_include,clucene,\
+ -I$(WORKDIR)/UnpackedTarball/clucene/inc/internal \
+ -I$(WORKDIR)/UnpackedTarball/clucene/src/core \
+ -I$(WORKDIR)/UnpackedTarball/clucene/src/contribs-lib \
+ -I$(WORKDIR)/UnpackedTarball/clucene/src/shared \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,clucene,\
+ -Dclucene_shared_EXPORTS \
+ -Dclucene_core_EXPORTS \
+ -Dclucene_contribs_lib_EXPORTS \
+ $(LFS_CFLAGS) \
+))
+
+# clucene is riddled with warnings... let's spare use
+# the pointless spamming
+$(eval $(call gb_Library_add_cxxflags,clucene,\
+ -w \
+))
+$(eval $(call gb_Library_add_cflags,clucene,\
+ -w \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,clucene,\
+ -lm \
+ -ldl \
+ -lpthread \
+))
+endif
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,clucene,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,clucene,\
+ UnpackedTarball/clucene/src/shared/CLucene/SharedHeader \
+ UnpackedTarball/clucene/src/shared/CLucene/config/gunichartables \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcslwr \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcstoll \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcscasecmp \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tprintf \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_lltot \
+ UnpackedTarball/clucene/src/shared/CLucene/config/repl_tcstod \
+ UnpackedTarball/clucene/src/shared/CLucene/config/utf8 \
+ UnpackedTarball/clucene/src/shared/CLucene/config/threads \
+ UnpackedTarball/clucene/src/shared/CLucene/debug/condition \
+ UnpackedTarball/clucene/src/shared/CLucene/util/StringBuffer \
+ UnpackedTarball/clucene/src/shared/CLucene/util/Misc \
+ UnpackedTarball/clucene/src/shared/CLucene/util/dirent \
+ UnpackedTarball/clucene/src/core/CLucene/StdHeader \
+ UnpackedTarball/clucene/src/core/CLucene/debug/error \
+ UnpackedTarball/clucene/src/core/CLucene/util/ThreadLocal \
+ UnpackedTarball/clucene/src/core/CLucene/util/Reader \
+ UnpackedTarball/clucene/src/core/CLucene/util/Equators \
+ UnpackedTarball/clucene/src/core/CLucene/util/FastCharStream \
+ UnpackedTarball/clucene/src/core/CLucene/util/MD5Digester \
+ UnpackedTarball/clucene/src/core/CLucene/util/StringIntern \
+ UnpackedTarball/clucene/src/core/CLucene/util/BitSet \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/FastCharStream \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/MultiFieldQueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/QueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/QueryParserTokenManager \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/QueryToken \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/Lexer \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/MultiFieldQueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/QueryParser \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/QueryParserBase \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/QueryToken \
+ UnpackedTarball/clucene/src/core/CLucene/queryParser/legacy/TokenList \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardAnalyzer \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardFilter \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/standard/StandardTokenizer \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/Analyzers \
+ UnpackedTarball/clucene/src/core/CLucene/analysis/AnalysisHeader \
+ UnpackedTarball/clucene/src/core/CLucene/store/MMapInput \
+ UnpackedTarball/clucene/src/core/CLucene/store/IndexInput \
+ UnpackedTarball/clucene/src/core/CLucene/store/Lock \
+ UnpackedTarball/clucene/src/core/CLucene/store/LockFactory \
+ UnpackedTarball/clucene/src/core/CLucene/store/IndexOutput \
+ UnpackedTarball/clucene/src/core/CLucene/store/Directory \
+ UnpackedTarball/clucene/src/core/CLucene/store/FSDirectory \
+ UnpackedTarball/clucene/src/core/CLucene/store/RAMDirectory \
+ UnpackedTarball/clucene/src/core/CLucene/document/Document \
+ UnpackedTarball/clucene/src/core/CLucene/document/DateField \
+ UnpackedTarball/clucene/src/core/CLucene/document/DateTools \
+ UnpackedTarball/clucene/src/core/CLucene/document/Field \
+ UnpackedTarball/clucene/src/core/CLucene/document/FieldSelector \
+ UnpackedTarball/clucene/src/core/CLucene/document/NumberTools \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexFileNames \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexFileNameFilter \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexDeletionPolicy \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentMergeInfo \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentInfos \
+ UnpackedTarball/clucene/src/core/CLucene/index/MergeScheduler \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermDocs \
+ UnpackedTarball/clucene/src/core/CLucene/index/FieldsWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermInfosWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/Term \
+ UnpackedTarball/clucene/src/core/CLucene/index/Terms \
+ UnpackedTarball/clucene/src/core/CLucene/index/MergePolicy \
+ UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/DocumentsWriterThreadState \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermVector \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermVectorReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/FieldInfos \
+ UnpackedTarball/clucene/src/core/CLucene/index/CompoundFile \
+ UnpackedTarball/clucene/src/core/CLucene/index/SkipListReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/SkipListWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexFileDeleter \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/DirectoryIndexReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermVectorWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermPositions \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentMerger \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexWriter \
+ UnpackedTarball/clucene/src/core/CLucene/index/MultiReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/MultiSegmentReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/Payload \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentTermEnum \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermInfo \
+ UnpackedTarball/clucene/src/core/CLucene/index/IndexModifier \
+ UnpackedTarball/clucene/src/core/CLucene/index/SegmentMergeQueue \
+ UnpackedTarball/clucene/src/core/CLucene/index/FieldsReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/TermInfosReader \
+ UnpackedTarball/clucene/src/core/CLucene/index/MultipleTermPositions \
+ UnpackedTarball/clucene/src/core/CLucene/search/Compare \
+ UnpackedTarball/clucene/src/core/CLucene/search/Scorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/ScorerDocQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/PhraseScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/SloppyPhraseScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/DisjunctionSumScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/ConjunctionScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/PhraseQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/PrefixQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/ExactPhraseScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/TermScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/Similarity \
+ UnpackedTarball/clucene/src/core/CLucene/search/BooleanScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/BooleanScorer2 \
+ UnpackedTarball/clucene/src/core/CLucene/search/HitQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldCacheImpl \
+ UnpackedTarball/clucene/src/core/CLucene/search/ChainedFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/RangeFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/CachingWrapperFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/QueryFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/TermQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/FuzzyQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/SearchHeader \
+ UnpackedTarball/clucene/src/core/CLucene/search/RangeQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/IndexSearcher \
+ UnpackedTarball/clucene/src/core/CLucene/search/Sort \
+ UnpackedTarball/clucene/src/core/CLucene/search/PhrasePositions \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldDocSortedHitQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/WildcardTermEnum \
+ UnpackedTarball/clucene/src/core/CLucene/search/MultiSearcher \
+ UnpackedTarball/clucene/src/core/CLucene/search/Hits \
+ UnpackedTarball/clucene/src/core/CLucene/search/MultiTermQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/FilteredTermEnum \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldSortedHitQueue \
+ UnpackedTarball/clucene/src/core/CLucene/search/WildcardQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/Explanation \
+ UnpackedTarball/clucene/src/core/CLucene/search/BooleanQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/FieldCache \
+ UnpackedTarball/clucene/src/core/CLucene/search/DateFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/MatchAllDocsQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/MultiPhraseQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/ConstantScoreQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/CachingSpanFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/SpanQueryFilter \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/NearSpansOrdered \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/NearSpansUnordered \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanFirstQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanNearQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanNotQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanOrQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanScorer \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanTermQuery \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/SpanWeight \
+ UnpackedTarball/clucene/src/core/CLucene/search/spans/TermSpans \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/LanguageBasedAnalyzer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/Snowball \
+))
+
+$(eval $(call gb_Library_add_generated_cobjects,clucene,\
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/libstemmer/libstemmer \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_danish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_dutch \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_english \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_finnish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_french \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_german \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_italian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_norwegian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_porter \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_portuguese \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_spanish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_ISO_8859_1_swedish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_KOI8_R_russian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_danish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_dutch \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_english \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_finnish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_french \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_german \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_italian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_norwegian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_porter \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_portuguese \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_russian \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_spanish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/src_c/stem_UTF_8_swedish \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/runtime/utilities \
+ UnpackedTarball/clucene/src/contribs-lib/CLucene/snowball/runtime/api \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,clucene))
+
+# do we need the Android check below? Shouldn't it be already covered by
+# gb_Helper_optional in Module_external.mk?
+ifneq ($(OS),ANDROID)
+$(eval $(call gb_Module_add_targets,clucene,\
+ Library_clucene \
+ UnpackedTarball_clucene \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+External package containing clucene.
+
+This is used to index our downloadable help packages, and allow them
+to be searched efficiently at run-time.
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,clucene))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,clucene,$(CLUCENE_TARBALL)))
+
+ifneq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_set_post_action,clucene,\
+ mkdir -p inc/internal/CLucene/util && \
+ mv src/shared/CLucene/util/dirent.h inc/internal/CLucene/util \
+))
+endif
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,clucene,0))
+
+# clucene-multimap-put.patch was proposed upstream, see
+# http://sourceforge.net/mailarchive/message.php?msg_id=29143260
+# clucene-mutex.patch was proposed upstream, see
+# http://sourceforge.net/mailarchive/message.php?msg_id=32314782
+$(eval $(call gb_UnpackedTarball_add_patches,clucene,\
+ external/clucene/patches/clucene-debug.patch \
+ external/clucene/patches/clucene-multimap-put.patch \
+ external/clucene/patches/clucene-narrowing-conversions.patch \
+ external/clucene/patches/clucene-nullptr.patch \
+ external/clucene/patches/clucene-warnings.patch \
+ external/clucene/patches/clucene-aix.patch \
+ external/clucene/patches/clucene-git1-win64.patch \
+ external/clucene/patches/clucene-ub.patch \
+ external/clucene/patches/clucene-mutex.patch \
+))
+
+ifneq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_patches,clucene,\
+ external/clucene/patches/clucene-libcpp.patch \
+))
+endif
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,external/clucene/configs/_clucene-config-MSVC.h))
+ifeq ($(COM),MSC)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-MSVC.h))
+else
+ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-MINGW-atomic.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-MINGW.h))
+endif
+endif
+else # ! $(OS),WNT
+ifeq ($(HAVE_GCC_BUILTIN_ATOMIC),TRUE)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-GCC-atomic.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/clucene-config.h,external/clucene/configs/clucene-config-generic.h))
+endif
+ifeq ($(OS),LINUX)
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,external/clucene/configs/_clucene-config-LINUX.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,clucene,src/shared/CLucene/_clucene-config.h,external/clucene/configs/_clucene-config-generic.h))
+endif
+endif # $(OS),WNT
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+#ifndef _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/_clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/_clucene-config-LINUX.h.
+* These are internal definitions, and this file does not need to be distributed
+*/
+
+/* CMake will look for these functions: */
+/* #undef _CL_HAVE_FUNCTION__VSNWPRINTF */
+/* #undef _CL_HAVE_FUNCTION__SNWPRINTF */
+#define _CL_HAVE_FUNCTION_WCSCASECMP
+#define _CL_HAVE_FUNCTION_WCSCAT 1
+#define _CL_HAVE_FUNCTION_WCSCHR 1
+#define _CL_HAVE_FUNCTION_WCSCMP 1
+#define _CL_HAVE_FUNCTION_WCSCPY 1
+#define _CL_HAVE_FUNCTION_WCSCSPN 1
+/* #undef _CL_HAVE_FUNCTION_WCSICMP */
+#define _CL_HAVE_FUNCTION_WCSLEN 1
+#define _CL_HAVE_FUNCTION_WCSNCMP 1
+#define _CL_HAVE_FUNCTION_WCSNCPY 1
+#define _CL_HAVE_FUNCTION_WCSSTR 1
+#define _CL_HAVE_FUNCTION_WCSTOD 1
+#define _CL_HAVE_FUNCTION_WCSDUP 1
+#define _CL_HAVE_FUNCTION_WCSTOLL 1
+/* #undef _CL_HAVE_FUNCTION_WCSUPR */
+#define _CL_HAVE_FUNCTION_GETTIMEOFDAY 1
+/* #undef _CL_HAVE_FUNCTION_MAPVIEWOFFILE */
+
+/* #undef _CL_HAVE_FUNCTION_LLTOA */
+/* #undef _CL_HAVE_FUNCTION_LLTOW */
+#define _CL_HAVE_FUNCTION_PRINTF 1
+#define _CL_HAVE_FUNCTION_SNPRINTF 1
+#define _CL_HAVE_FUNCTION_MMAP 1
+/* #undef _CL_HAVE_FUNCTION_STRLWR */
+#define _CL_HAVE_FUNCTION_STRTOLL 1
+/* #undef _CL_HAVE_FUNCTION_STRUPR */
+/* #undef _CL_HAVE_FUNCTION_GETPAGESIZE */
+#define _CL_HAVE_FUNCTION_USLEEP 1
+/* #undef _CL_HAVE_FUNCTION_SLEEP */
+
+#define CL_MAX_PATH 4096
+//this is the max filename... for now its just the same,
+//but this could change, so we use a different name
+#define CL_MAX_NAME CL_MAX_PATH
+//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
+//the above logic for CL_MAX_NAME should be correct enough to handle all file names
+#define CL_MAX_DIR CL_MAX_PATH
+
+#define _O_RANDOM 0
+#define _O_BINARY 0
+#define _S_IREAD S_IREAD
+#define _S_IWRITE S_IWRITE
+#define _timeb timeb
+
+#define _ILONG(x) x ## L
+#define _ILONGLONG(x) x ## LL
+
+#define fileStat stat64
+#define cl_stat_t stat64
+#define fileSize CL_NS(util)::Misc::filelength
+#define fileSeek lseek64
+#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR)
+#define fileHandleStat fstat64
+#define _realpath realpath
+#define _rename rename
+#define _close close
+#define _read read
+#define _cl_open open
+#define _write write
+#define _snprintf snprintf
+#define _mkdir(x) mkdir(x,0777)
+#define _unlink unlink
+#define _ftime ftime
+#define SLEEPFUNCTION usleep
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* Does not support new float byte<->float conversions */
+/* #undef _CL_HAVE_NO_FLOAT_BYTE */
+
+/* Define if recursive pthread mutexes are available */
+#define _CL_HAVE_PTHREAD_MUTEX_RECURSIVE 1
+
+/** define if you would like to force clucene to use the internal
+* character functions.
+* Tests may display unpredictable behaviour if this is not defined.
+*/
+#ifndef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
+ #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS 1
+#endif
+
+/** fix ansi for loop scope */
+#if 1==0
+ #define for if (0); else for
+#endif
+
+
+/* Compiler oddities */
+
+//not sure why, but cygwin reports _S_IREAD, but doesn't actually work...
+//TODO: make this work properly (this bit shouldn't be necessary)
+#ifdef __CYGWIN__
+ #define _S_IREAD 0333
+ #define _S_IWRITE 0333
+#endif
+
+#ifdef __BORLANDC__ //borland compiler
+ #define O_RANDOM 0
+#endif
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/_clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/_clucene-config-MSVC.h.
+* These are internal definitions, and this file does not need to be distributed
+*/
+
+/* CMake will look for these functions: */
+#define _CL_HAVE_FUNCTION__VSNWPRINTF
+#define _CL_HAVE_FUNCTION__SNWPRINTF
+/* #undef _CL_HAVE_FUNCTION_WCSCASECMP */
+#define _CL_HAVE_FUNCTION_WCSCAT 1
+#define _CL_HAVE_FUNCTION_WCSCHR 1
+#define _CL_HAVE_FUNCTION_WCSCMP 1
+#define _CL_HAVE_FUNCTION_WCSCPY 1
+#define _CL_HAVE_FUNCTION_WCSCSPN 1
+#define _CL_HAVE_FUNCTION_WCSICMP
+#define _CL_HAVE_FUNCTION_WCSLEN 1
+#define _CL_HAVE_FUNCTION_WCSNCMP 1
+#define _CL_HAVE_FUNCTION_WCSNCPY 1
+#define _CL_HAVE_FUNCTION_WCSSTR 1
+#define _CL_HAVE_FUNCTION_WCSTOD 1
+#define _CL_HAVE_FUNCTION_WCSDUP 1
+/* #undef _CL_HAVE_FUNCTION_WCSTOLL */
+#define _CL_HAVE_FUNCTION_WCSUPR 1
+/* #undef _CL_HAVE_FUNCTION_GETTIMEOFDAY */
+#define _CL_HAVE_FUNCTION_MAPVIEWOFFILE 1
+
+/* #undef _CL_HAVE_FUNCTION_LLTOA */
+/* #undef _CL_HAVE_FUNCTION_LLTOW */
+#define _CL_HAVE_FUNCTION_PRINTF 1
+/* #undef _CL_HAVE_FUNCTION_SNPRINTF */
+/* #undef _CL_HAVE_FUNCTION_MMAP */
+#define _CL_HAVE_FUNCTION_STRLWR 1
+/* #undef _CL_HAVE_FUNCTION_STRTOLL */
+#define _CL_HAVE_FUNCTION_STRUPR 1
+/* #undef _CL_HAVE_FUNCTION_GETPAGESIZE */
+/* #undef _CL_HAVE_FUNCTION_USLEEP */
+#define _CL_HAVE_FUNCTION_SLEEP 1
+
+#define CL_MAX_PATH 4096
+//this is the max filename... for now its just the same,
+//but this could change, so we use a different name
+#define CL_MAX_NAME CL_MAX_PATH
+//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
+//the above logic for CL_MAX_NAME should be correct enough to handle all file names
+#define CL_MAX_DIR CL_MAX_PATH
+
+/* undef _O_RANDOM _O_RANDOM */
+/* undef _O_BINARY _O_BINARY */
+/* undef _S_IREAD _S_IREAD */
+/* undef _S_IWRITE _S_IWRITE */
+/* #undef _timeb */
+
+#define _ILONG(x) x ## L
+#define _ILONGLONG(x) x ## LL
+
+#define fileStat _stati64
+#define cl_stat_t _stati64
+#define fileSize _filelengthi64
+#define fileSeek _lseeki64
+#define fileTell _telli64
+#define fileHandleStat _fstati64
+#define _realpath(rel,abs) ::_fullpath(abs,rel,CL_MAX_PATH)
+#define _rename rename
+/* undef _close _close */
+/* undef _read _read */
+#define _cl_open _open
+/* undef _write _write */
+/* undef _snprintf _snprintf */
+/* undef _mkdir _mkdir */
+/* undef _unlink _unlink */
+/* undef _ftime _ftime */
+#define SLEEPFUNCTION Sleep
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* Does not support new float byte<->float conversions */
+/* #undef _CL_HAVE_NO_FLOAT_BYTE */
+
+/* Define if recursive pthread mutexes are available */
+/* #undef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE */
+
+/** define if you would like to force clucene to use the internal
+* character functions.
+* Tests may display unpredictable behaviour if this is not defined.
+*/
+#ifndef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
+ #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS 1
+#endif
+
+/** fix ansi for loop scope */
+#if 1==0
+ #define for if (0); else for
+#endif
+
+
+/* Compiler oddities */
+
+//not sure why, but cygwin reports _S_IREAD, but doesn't actually work...
+//TODO: make this work properly (this bit shouldn't be necessary)
+#ifdef __CYGWIN__
+ #define _S_IREAD 0333
+ #define _S_IWRITE 0333
+#endif
+
+#ifdef __BORLANDC__ //borland compiler
+ #define O_RANDOM 0
+#endif
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_INTERNAL_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/_clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/_clucene-config-generic.h.
+* These are internal definitions, and this file does not need to be distributed
+*/
+
+/* CMake will look for these functions: */
+/* #undef _CL_HAVE_FUNCTION__VSNWPRINTF */
+/* #undef _CL_HAVE_FUNCTION__SNWPRINTF */
+#define _CL_HAVE_FUNCTION_WCSCASECMP
+#define _CL_HAVE_FUNCTION_WCSCAT 1
+#define _CL_HAVE_FUNCTION_WCSCHR 1
+#define _CL_HAVE_FUNCTION_WCSCMP 1
+#define _CL_HAVE_FUNCTION_WCSCPY 1
+#define _CL_HAVE_FUNCTION_WCSCSPN 1
+/* #undef _CL_HAVE_FUNCTION_WCSICMP */
+#define _CL_HAVE_FUNCTION_WCSLEN 1
+#define _CL_HAVE_FUNCTION_WCSNCMP 1
+#define _CL_HAVE_FUNCTION_WCSNCPY 1
+#define _CL_HAVE_FUNCTION_WCSSTR 1
+#define _CL_HAVE_FUNCTION_WCSTOD 1
+/* #undef _CL_HAVE_FUNCTION_WCSDUP 1 */
+#define _CL_HAVE_FUNCTION_WCSTOLL 1
+/* #undef _CL_HAVE_FUNCTION_WCSUPR */
+#define _CL_HAVE_FUNCTION_GETTIMEOFDAY 1
+/* #undef _CL_HAVE_FUNCTION_MAPVIEWOFFILE */
+
+/* #undef _CL_HAVE_FUNCTION_LLTOA */
+/* #undef _CL_HAVE_FUNCTION_LLTOW */
+#define _CL_HAVE_FUNCTION_PRINTF 1
+#define _CL_HAVE_FUNCTION_SNPRINTF 1
+#define _CL_HAVE_FUNCTION_MMAP 1
+/* #undef _CL_HAVE_FUNCTION_STRLWR */
+#define _CL_HAVE_FUNCTION_STRTOLL 1
+/* #undef _CL_HAVE_FUNCTION_STRUPR */
+/* #undef _CL_HAVE_FUNCTION_GETPAGESIZE */
+#define _CL_HAVE_FUNCTION_USLEEP 1
+/* #undef _CL_HAVE_FUNCTION_SLEEP */
+
+#define CL_MAX_PATH 4096
+//this is the max filename... for now its just the same,
+//but this could change, so we use a different name
+#define CL_MAX_NAME CL_MAX_PATH
+//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
+//the above logic for CL_MAX_NAME should be correct enough to handle all file names
+#define CL_MAX_DIR CL_MAX_PATH
+
+#define _O_RANDOM 0
+#define _O_BINARY 0
+#define _S_IREAD S_IREAD
+#define _S_IWRITE S_IWRITE
+#define _timeb timeb
+
+#define _ILONG(x) x ## L
+#define _ILONGLONG(x) x ## LL
+
+#define fileStat stat
+#define cl_stat_t stat
+#define fileSize CL_NS(util)::Misc::filelength
+#define fileSeek lseek
+#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR)
+#define fileHandleStat fstat
+#define _realpath realpath
+#define _rename rename
+#define _close close
+#define _read read
+#define _cl_open open
+#define _write write
+#define _snprintf snprintf
+#define _mkdir(x) mkdir(x,0777)
+#define _unlink unlink
+#define _ftime ftime
+#define SLEEPFUNCTION usleep
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* Does not support new float byte<->float conversions */
+/* #undef _CL_HAVE_NO_FLOAT_BYTE */
+
+/* Define if recursive pthread mutexes are available */
+#define _CL_HAVE_PTHREAD_MUTEX_RECURSIVE 1
+
+/** define if you would like to force clucene to use the internal
+* character functions.
+* Tests may display unpredictable behaviour if this is not defined.
+*/
+#ifndef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS
+ #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS 1
+#endif
+
+/** fix ansi for loop scope */
+#if 1==0
+ #define for if (0); else for
+#endif
+
+
+/* Compiler oddities */
+
+//not sure why, but cygwin reports _S_IREAD, but doesn't actually work...
+//TODO: make this work properly (this bit shouldn't be necessary)
+#ifdef __CYGWIN__
+ #define _S_IREAD 0333
+ #define _S_IWRITE 0333
+#endif
+
+#ifdef __BORLANDC__ //borland compiler
+ #define O_RANDOM 0
+#endif
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-GCC-atomic.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+#define _CL_HAVE_UNISTD_H 1
+/* #undef _CL_HAVE_IO_H */
+/* #undef _CL_HAVE_DIRECT_H */
+#define _CL_HAVE_DIRENT_H 1
+#define _CL_HAVE_SYS_DIR_H
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+/* #undef _CL_HAVE_WINDOWS_H */
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+#define _CL_HAVE_EXT_HASH_MAP 1
+/* #undef _CL_HAVE_EXT_HASH_SET */
+#define _CL_HAVE_TR1_UNORDERED_MAP 1
+#define _CL_HAVE_TR1_UNORDERED_SET 1
+#define _CL_HAVE_HASH_MAP
+#define _CL_HAVE_HASH_SET
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+#define _CL_HAVE_SYS_TIME_H 1
+/* #undef _CL_HAVE_TCHAR_H */
+#define _CL_HAVE_SYS_MMAN_H 1
+/* #undef _CL_HAVE_WINERROR_H */
+#define _CL_HAVE_STDINT_H 1
+
+// our needed types
+/* undef int8_t int8_t */
+/* undef uint8_t uint8_t */
+/* undef int16_t int16_t */
+/* undef uint16_t uint16_t */
+/* undef int32_t int32_t */
+/* undef uint32_t uint32_t */
+/* undef int64_t int64_t */
+/* undef uint64_t uint64_t */
+
+/* undef float_t*/
+
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+typedef wchar_t TCHAR;
+#define _T(x) L ## x
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+#define _CL_HAVE_PTHREAD 1
+
+/* Define if you have Win32 threads libraries and header files. */
+/* #undef _CL_HAVE_WIN32_THREADS */
+
+/* Define if we have gcc atomic functions */
+#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func) std::tr1::func
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP unordered_map
+#define _CL_HASH_SET unordered_set
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+//#define _CL_TIME_WITH_SYS_TIME 1
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+#define _CL_HAVE_GCCVISIBILITYPATCH 1
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-MINGW-atomic.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+/* #undef _CL_HAVE_UNISTD_H */
+#define _CL_HAVE_IO_H 1
+#define _CL_HAVE_DIRECT_H 1
+/* #undef _CL_HAVE_DIRENT_H */
+/* #undef _CL_HAVE_SYS_DIR_H */
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+#define _CL_HAVE_WINDOWS_H 1
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+/* #undef _CL_HAVE_EXT_HASH_MAP */
+/* #undef _CL_HAVE_EXT_HASH_SET */
+/* #undef _CL_HAVE_TR1_UNORDERED_MAP */
+/* #undef _CL_HAVE_TR1_UNORDERED_SET */
+/* #undef _CL_HAVE_HASH_MAP */
+/* #undef _CL_HAVE_HASH_SET */
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+/* #undef _CL_HAVE_SYS_TIME_H */
+#define _CL_HAVE_TCHAR_H 1
+/* #undef _CL_HAVE_SYS_MMAN_H */
+#define _CL_HAVE_WINERROR_H 1
+/* #undef _CL_HAVE_STDINT_H */
+
+// our needed types
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+/* undef float_t*/
+typedef unsigned long _cl_dword_t;
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+/* undef TCHAR TCHAR */
+/* #undef _T */
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef _CL_HAVE_PTHREAD */
+
+/* Define if you have Win32 threads libraries and header files. */
+#define _CL_HAVE_WIN32_THREADS 1
+
+/* Define if we have gcc atomic functions */
+#define _CL_HAVE_GCC_ATOMIC_FUNCTIONS 1
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func)
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP
+#define _CL_HASH_SET
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+/* #undef _CL_TIME_WITH_SYS_TIME */
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+/* #undef _CL_HAVE_GCCVISIBILITYPATCH */
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-MINGW.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+/* #undef _CL_HAVE_UNISTD_H */
+#define _CL_HAVE_IO_H 1
+#define _CL_HAVE_DIRECT_H 1
+/* #undef _CL_HAVE_DIRENT_H */
+/* #undef _CL_HAVE_SYS_DIR_H */
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+#define _CL_HAVE_WINDOWS_H 1
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+/* #undef _CL_HAVE_EXT_HASH_MAP */
+/* #undef _CL_HAVE_EXT_HASH_SET */
+/* #undef _CL_HAVE_TR1_UNORDERED_MAP */
+/* #undef _CL_HAVE_TR1_UNORDERED_SET */
+/* #undef _CL_HAVE_HASH_MAP */
+/* #undef _CL_HAVE_HASH_SET */
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+/* #undef _CL_HAVE_SYS_TIME_H */
+#define _CL_HAVE_TCHAR_H 1
+/* #undef _CL_HAVE_SYS_MMAN_H */
+#define _CL_HAVE_WINERROR_H 1
+/* #undef _CL_HAVE_STDINT_H */
+
+// our needed types
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+/* undef float_t*/
+typedef unsigned long _cl_dword_t;
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+/* undef TCHAR TCHAR */
+/* #undef _T */
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef _CL_HAVE_PTHREAD */
+
+/* Define if you have Win32 threads libraries and header files. */
+#define _CL_HAVE_WIN32_THREADS 1
+
+/* Define if we have gcc atomic functions */
+/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func)
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP
+#define _CL_HASH_SET
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+/* #undef _CL_TIME_WITH_SYS_TIME */
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+/* #undef _CL_HAVE_GCCVISIBILITYPATCH */
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-MSVC.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+/* #undef _CL_HAVE_UNISTD_H */
+#define _CL_HAVE_IO_H 1
+#define _CL_HAVE_DIRECT_H 1
+/* #undef _CL_HAVE_DIRENT_H */
+/* #undef _CL_HAVE_SYS_DIR_H */
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+#define _CL_HAVE_WINDOWS_H 1
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+/* #undef _CL_HAVE_EXT_HASH_MAP */
+/* #undef _CL_HAVE_EXT_HASH_SET */
+/* #undef _CL_HAVE_TR1_UNORDERED_MAP */
+/* #undef _CL_HAVE_TR1_UNORDERED_SET */
+/* #undef _CL_HAVE_HASH_MAP */
+/* #undef _CL_HAVE_HASH_SET */
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+/* #undef _CL_HAVE_SYS_TIME_H */
+#define _CL_HAVE_TCHAR_H 1
+/* #undef _CL_HAVE_SYS_MMAN_H */
+#define _CL_HAVE_WINERROR_H 1
+/* #undef _CL_HAVE_STDINT_H */
+
+// our needed types
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+typedef double float_t;
+typedef unsigned long _cl_dword_t;
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+/* undef TCHAR TCHAR */
+/* #undef _T */
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef _CL_HAVE_PTHREAD */
+
+/* Define if you have Win32 threads libraries and header files. */
+#define _CL_HAVE_WIN32_THREADS 1
+
+/* Define if we have gcc atomic functions */
+/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func)
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP
+#define _CL_HASH_SET
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+/* #undef _CL_TIME_WITH_SYS_TIME */
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+/* #undef _CL_HAVE_GCCVISIBILITYPATCH */
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
--- /dev/null
+#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
+#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
+
+/* src/shared/CLucene/clucene-config.h.
+* Normally generated automatically at end of cmake,
+* but here in LibreOffice this actually is a copy of
+* clucene/configs/clucene-config-generic.h.
+*/
+
+/* CMake will look for these headers: */
+#define _CL_HAVE_STRING_H 1
+#define _CL_HAVE_MEMORY_H 1
+#define _CL_HAVE_UNISTD_H 1
+/* #undef _CL_HAVE_IO_H */
+/* #undef _CL_HAVE_DIRECT_H */
+#define _CL_HAVE_DIRENT_H 1
+#define _CL_HAVE_SYS_DIR_H
+/* #undef _CL_HAVE_SYS_NDIR_H */
+#define _CL_HAVE_ERRNO_H 1
+#define _CL_HAVE_WCHAR_H 1
+#define _CL_HAVE_WCTYPE_H
+#define _CL_HAVE_CTYPE_H 1
+/* #undef _CL_HAVE_WINDOWS_H */
+/* #undef _CL_HAVE_WINDEF_H */
+#define _CL_HAVE_SYS_TYPES_H 1
+/* #undef _CL_HAVE_DLFCN_H */
+#define _CL_HAVE_EXT_HASH_MAP 1
+/* #undef _CL_HAVE_EXT_HASH_SET */
+#define _CL_HAVE_TR1_UNORDERED_MAP 1
+#define _CL_HAVE_TR1_UNORDERED_SET 1
+#define _CL_HAVE_HASH_MAP
+#define _CL_HAVE_HASH_SET
+/* #undef _CL_HAVE_NDIR_H */
+#define _CL_HAVE_SYS_STAT_H 1
+#define _CL_HAVE_SYS_TIMEB_H 1
+#define _CL_HAVE_SYS_TIME_H 1
+/* #undef _CL_HAVE_TCHAR_H */
+#define _CL_HAVE_SYS_MMAN_H 1
+/* #undef _CL_HAVE_WINERROR_H */
+#define _CL_HAVE_STDINT_H 1
+
+// our needed types
+/* undef int8_t int8_t */
+/* undef uint8_t uint8_t */
+/* undef int16_t int16_t */
+/* undef uint16_t uint16_t */
+/* undef int32_t int32_t */
+/* undef uint32_t uint32_t */
+/* undef int64_t int64_t */
+/* undef uint64_t uint64_t */
+
+/* undef float_t*/
+
+/* undef size_t size_t */
+
+/* tchar & _T definitions... */
+typedef wchar_t TCHAR;
+#define _T(x) L ## x
+
+/* CMake will determine these specifics. Things like bugs, etc */
+
+/* if we can't support the map/set hashing */
+/* #undef LUCENE_DISABLE_HASHING */
+
+/* Define if you have POSIX threads libraries and header files. */
+#define _CL_HAVE_PTHREAD 1
+
+/* Define if you have Win32 threads libraries and header files. */
+/* #undef _CL_HAVE_WIN32_THREADS */
+
+/* Define if we have gcc atomic functions */
+/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
+
+/* Define what eval method is required for float_t to be defined (for GCC). */
+/* #undef _FLT_EVAL_METHOD */
+
+/* If we use hashmaps, which namespace do we use: */
+#define CL_NS_HASHING(func) std::tr1::func
+/* If we use hashmaps, which classes do we use: */
+#define _CL_HASH_MAP unordered_map
+#define _CL_HASH_SET unordered_set
+
+/* define if the compiler implements namespaces */
+#define _CL_HAVE_NAMESPACES
+
+/* Defined if the snprintf overflow test fails */
+/* #undef _CL_HAVE_SNPRINTF_BUG */
+
+/* Defined if the swprintf test fails */
+/* #undef _CL_HAVE_SNWPRINTF_BUG */
+
+/* How to define a static const in a class */
+#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+//todo: not checked
+/* #undef _CL_PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+//todo: not being checked for...
+/* #undef _CL_STAT_MACROS_BROKEN */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+//not actually used for anything...
+//#define _CL_TIME_WITH_SYS_TIME 1
+
+/* Define that we will be using -fvisibility=hidden, and
+ * make public classes visible using __attribute__ ((visibility("default")))
+ */
+#define _CL_HAVE_GCCVISIBILITYPATCH 1
+
+
+/* Versions, etc */
+
+/* Name of package */
+#define _CL_PACKAGE "clucene-core"
+
+/* Version number of package */
+#define _CL_VERSION "2.3.3.4"
+
+/* So-Version number of package */
+#define _CL_SOVERSION "1"
+
+/* A comparable version number */
+#define _CL_INT_VERSION 2030304
+
+/* Configured options (from command line) */
+
+/* Forces into Ascii mode */
+/* #undef _ASCII */
+
+/* Conditional Debugging */
+/* #undef _CL__CND_DEBUG */
+
+/* debuging option */
+/* #undef _DEBUG */
+
+/* Disable multithreading */
+/* #undef _CL_DISABLE_MULTITHREADING */
+
+
+#ifdef __BORLANDC__ //borland compiler
+ //todo: bcc incorrectly detects this... fix this in cmake
+ #undef LUCENE_STATIC_CONSTANT
+ #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
+#endif
+
+
+#endif
--- /dev/null
+diff -rc clucene.orig/src/core/CLucene/store/MMapInput.cpp clucene/src/core/CLucene/store/MMapInput.cpp
+*** src/core/CLucene/store/MMapInput.cpp Wed Apr 10 10:57:37 2013
+--- src/core/CLucene/store/MMapInput.cpp Wed Apr 10 10:58:30 2013
+***************
+*** 115,121 ****
+ {
+ }
+
+! bool MMapIndexInput::open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize ) {
+
+ //Func - Constructor.
+ // Opens the file named path
+--- 115,121 ----
+ {
+ }
+
+! bool MMapIndexInput::Open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize ) {
+
+ //Func - Constructor.
+ // Opens the file named path
+diff -rc clucene.orig/src/core/CLucene/store/_MMapIndexInput.h clucene/src/core/CLucene/store/_MMapIndexInput.h
+*** src/core/CLucene/store/_MMapIndexInput.h Wed Apr 10 10:57:37 2013
+--- src/core/CLucene/store/_MMapIndexInput.h Wed Apr 10 10:58:53 2013
+***************
+*** 18,24 ****
+ MMapIndexInput(const MMapIndexInput& clone);
+ MMapIndexInput(Internal* _internal);
+ public:
+! static bool open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize);
+
+ ~MMapIndexInput();
+ IndexInput* clone() const;
+--- 18,24 ----
+ MMapIndexInput(const MMapIndexInput& clone);
+ MMapIndexInput(Internal* _internal);
+ public:
+! static bool Open(const char* path, IndexInput*& ret, CLuceneError& error, int32_t __bufferSize);
+
+ ~MMapIndexInput();
+ IndexInput* clone() const;
--- /dev/null
+--- src/core/CLucene/index/TermInfosReader.cpp
++++ src/core/CLucene/index/TermInfosReader.cpp
+@@ -111,7 +111,7 @@
+ //destroy their elements
+ #ifdef _DEBUG
+ for ( int32_t i=0; i<indexTermsLength;++i ){
+- indexTerms[i].__cl_refcount--;
++ indexTerms[i].__cl_decref();
+ }
+ #endif
+ //Delete the arrays
--- /dev/null
+--- src/shared/CLucene/config/threads.cpp 2013-06-06 16:25:23.014622397 +0200
++++ src/shared/CLucene/config/threads.cpp 2013-06-06 16:33:35.326048842 +0200
+@@ -63,14 +63,14 @@
+ }
+
+ int32_t mutex_thread::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){
+-#ifdef _M_X64
++#ifdef _WIN64
+ return _InterlockedIncrement64(theInteger);
+ #else
+ return InterlockedIncrement(theInteger);
+ #endif
+ }
+ int32_t mutex_thread::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){
+-#ifdef _M_X64
++#ifdef _WIN64
+ return _InterlockedDecrement64(theInteger);
+ #else
+ return InterlockedDecrement(theInteger);
+--- src/shared/CLucene/config/_threads.h 2013-06-06 16:25:23.013622420 +0200
++++ src/shared/CLucene/config/_threads.h 2013-06-06 16:29:39.152601408 +0200
+@@ -34,9 +34,9 @@
+
+ __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId();
+
+-#ifdef _M_X64
+- __declspec(dllimport) long long __stdcall _InterlockedIncrement64(__inout long long volatile*);
+- __declspec(dllimport) long long __stdcall _InterlockedDecrement64(__inout long long volatile*);
++#ifdef _WIN64
++ long long __stdcall _InterlockedIncrement64(long long volatile*);
++ long long __stdcall _InterlockedDecrement64(long long volatile*);
+ #else
+ __declspec(dllimport) long __stdcall InterlockedIncrement(long volatile*);
+ __declspec(dllimport) long __stdcall InterlockedDecrement(long volatile*);
+--- src/shared/CLucene/LuceneThreads.h 2013-06-06 16:25:23.014622397 +0200
++++ src/shared/CLucene/LuceneThreads.h 2013-06-06 16:37:45.490166481 +0200
+@@ -101,7 +101,7 @@
+
+ #define _LUCENE_ATOMIC_INC(theInteger) CL_NS(util)::mutex_thread::atomic_increment(theInteger)
+ #define _LUCENE_ATOMIC_DEC(theInteger) CL_NS(util)::mutex_thread::atomic_decrement(theInteger)
+-#ifdef _M_X64
++#ifdef _WIN64
+ #define _LUCENE_ATOMIC_INT long long
+ #else
+ #define _LUCENE_ATOMIC_INT long
--- /dev/null
+--- src/shared/CLucene/LuceneThreads.h
++++ src/shared/CLucene/LuceneThreads.h
+@@ -7,6 +7,7 @@
+ #ifndef _LuceneThreads_h
+ #define _LuceneThreads_h
+
++#include "CLucene/config/_threads.h"
+
+ CL_NS_DEF(util)
+ class CLuceneThreadIdCompare;
+--- src/core/CLucene/util/VoidMap.h
++++ src/core/CLucene/util/VoidMap.h
+@@ -11,8 +11,13 @@
+ #include "CLucene/LuceneThreads.h"
+
+ #if defined(_CL_HAVE_TR1_UNORDERED_MAP) && defined(_CL_HAVE_TR1_UNORDERED_SET)
++#ifdef _LIBCPP_VERSION
++ #include <unordered_map>
++ #include <unordered_set>
++#else
+ #include <tr1/unordered_map>
+ #include <tr1/unordered_set>
++#endif
+ #elif defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET)
+ //hashing is all or nothing!
+ #include <hash_map>
+--- src/shared/CLucene/config/repl_tchar.h
++++ src/shared/CLucene/config/repl_tchar.h
+@@ -36,8 +36,13 @@
+ #define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
+ #define _tcscat wcscat //copy a string onto the end of the other string
+ #define _tcsncat wcsncat
++#if defined(_LIBCPP_VERSION) && defined(__APPLE__)
++ #define _tcschr ::wcschr //find location of one character
++ #define _tcsstr ::wcsstr //find location of a string
++#else
+ #define _tcschr wcschr //find location of one character
+ #define _tcsstr wcsstr //find location of a string
++#endif
+ #define _tcslen wcslen //get length of a string
+ #define _tcscmp wcscmp //case sensitive compare two strings
+ #define _tcsncmp wcsncmp //case sensitive compare two strings
--- /dev/null
+--- src/core/CLucene/util/VoidMap.h
++++ src/core/CLucene/util/VoidMap.h
+@@ -316,6 +316,7 @@ public:
+ if ( _this::dk || _this::dv )
+ _this::remove(k);
+
++ (*this)[k] = v;
+ }
+ };
--- /dev/null
+--- src/core/CLucene/store/FSDirectory.cpp
++++ src/core/CLucene/store/FSDirectory.cpp
+@@ -219,9 +219,8 @@
+ _CLDECDELETE(handle);
+
+ //printf("handle=%d\n", handle->__cl_refcount);
+- if ( dounlock ){
+ mutex->unlock();
+- }else{
++ if ( !dounlock ){
+ delete mutex;
+ }
+ }
--- /dev/null
+--- src/core/CLucene/queryParser/QueryParser.cpp.sav 2011-03-17 01:21:07.000000000 +0100
++++ src/core/CLucene/queryParser/QueryParser.cpp 2012-03-09 18:20:58.000000000 +0100
+@@ -79,7 +79,7 @@
+ _T("<RANGEEX_GOOP>")
+ };
+
+-const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
++const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,int32_t(0x80000000),0x20000000,int32_t(0x80000000),0x10000,0x80000,0x10000,0x1f68000};
+ const int32_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
+
+ struct QueryParser::JJCalls {
+--- src/core/CLucene/queryParser/QueryParserTokenManager.cpp.sav 2011-03-17 01:21:07.000000000 +0100
++++ src/core/CLucene/queryParser/QueryParserTokenManager.cpp 2012-03-09 18:20:24.000000000 +0100
+@@ -15,9 +15,9 @@
+
+ CL_NS_DEF(queryParser)
+
+-const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
++const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))};
+ const int64_t QueryParserTokenManager::jjbitVec0[] = {
+- _ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)
++ int64_t(_ILONGLONG(0xfffffffffffffffe)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))
+ };
+ const int32_t QueryParserTokenManager::jjnextStates[]={
+ 15, 17, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27,
+--- src/core/CLucene/queryParser/legacy/Lexer.cpp.sav 2013-03-01 09:25:18.000000000 +0100
++++ src/core/CLucene/queryParser/legacy/Lexer.cpp 09:25:12.000000000 +0100
+@@ -117,7 +117,7 @@ bool Lexer::GetNextToken(QueryToken* tok
+ if( _istspace(ch)!=0 ) {
+ continue;
+ }
+- TCHAR buf[2] = {ch,'\0'};
++ TCHAR buf[2] = {TCHAR(ch),'\0'};
+ switch(ch) {
+ case '+':
+ token->set(buf, QueryToken::PLUS);
--- /dev/null
+--- src/core/CLucene/index/DocumentsWriter.cpp 2011-03-16 20:21:07.000000000 -0400
++++ src/core/CLucene/index/DocumentsWriter.cpp 2012-07-31 18:52:09.000000000 -0400
+@@ -125,7 +125,7 @@
+ if (this->postingsFreeListDW.values){
+ if (this->postingsFreeCountDW < this->postingsFreeListDW.length) {
+ memset(this->postingsFreeListDW.values + this->postingsFreeCountDW
+- , NULL
++ , 0
+ , sizeof(Posting*));
+ }
+ postingsFreeListDW.deleteUntilNULL();
+--- src/core/CLucene/util/VoidMap.h 2012-07-31 18:13:08.000000000 -0400
++++ src/core/CLucene/util/VoidMap.h 2012-07-31 18:42:54.000000000 -0400
+@@ -83,7 +83,7 @@
+ _vt get( _kt k) const {
+ const_iterator itr = base::find(k);
+ if ( itr==base::end() )
+- return (_vt)NULL;
++ return static_cast<_vt>(0);
+ else
+ return itr->second;
+ }
--- /dev/null
+--- src/core/CLucene/index/DocumentsWriterThreadState.cpp
++++ src/core/CLucene/index/DocumentsWriterThreadState.cpp
+@@ -994,7 +994,7 @@
+ const TCHAR* tokenText = token->termBuffer();
+ const int32_t tokenTextLen = token->termLength();
+
+- int32_t code = 0;
++ uint32_t code = 0;
+
+ // Compute hashcode
+ int32_t downto = tokenTextLen;
+@@ -1203,7 +1203,7 @@
+ const int32_t newMask = newSize-1;
+
+ ValueArray<Posting*> newHash(newSize);
+- int32_t hashPos, code;
++ int32_t hashPos; uint32_t code;
+ const TCHAR* pos = NULL;
+ const TCHAR* start = NULL;
+ Posting* p0;
+--- src/core/CLucene/store/IndexInput.cpp
++++ src/core/CLucene/store/IndexInput.cpp
+@@ -41,8 +41,8 @@
+ }
+
+ int64_t IndexInput::readLong() {
+- int64_t i = ((int64_t)readInt() << 32);
+- return (i | ((int64_t)readInt() & 0xFFFFFFFFL));
++ uint64_t i = ((uint64_t)readInt() << 32);
++ return (i | ((uint64_t)readInt() & 0xFFFFFFFFL));
+ }
+
+ int64_t IndexInput::readVLong() {
--- /dev/null
+--- src/core/CLucene/analysis/AnalysisHeader.h 2012-02-22 12:37:22.531637934 +0000
++++ src/core/CLucene/analysis/AnalysisHeader.h 2012-02-22 12:39:15.369916728 +0000
+@@ -7,6 +7,12 @@
+ #ifndef _lucene_analysis_AnalysisHeader_
+ #define _lucene_analysis_AnalysisHeader_
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Woverloaded-virtual"
++#endif
++
+ #include "CLucene/index/Payload.h"
+ #include "CLucene/util/VoidList.h"
+ #include "CLucene/LuceneThreads.h"
+@@ -361,4 +361,8 @@
+ };
+
+ CL_NS_END
++
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
+ #endif
+--- src/core/CLucene/search/Searchable.h 2012-02-22 12:37:22.513637729 +0000
++++ src/core/CLucene/search/Searchable.h 2012-02-22 12:38:51.073641550 +0000
+@@ -7,6 +7,12 @@
+ #ifndef _lucene_search_Searcher_
+ #define _lucene_search_Searcher_
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Woverloaded-virtual"
++#endif
++
+
+ //#include "CLucene/index/IndexReader.h"
+ CL_CLASS_DEF(index,Term)
+@@ -180,4 +180,8 @@
+ };
+
+ CL_NS_END
++
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
+ #endif
+--- src/core/CLucene/store/IndexInput.h 2012-02-22 12:37:22.508637673 +0000
++++ src/core/CLucene/store/IndexInput.h 2012-02-22 12:39:00.465747935 +0000
+@@ -7,6 +7,12 @@
+ #ifndef _lucene_store_IndexInput_
+ #define _lucene_store_IndexInput_
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Woverloaded-virtual"
++#endif
++
+ #include "CLucene/LuceneThreads.h"
+ #include "CLucene/util/Equators.h"
+
+@@ -195,4 +195,8 @@
+ virtual void seekInternal(const int64_t pos) = 0;
+ };
+ CL_NS_END
++
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
+ #endif
+--- src/core/CLucene/util/Array.h 2012-02-22 12:37:22.510637696 +0000
++++ src/core/CLucene/util/Array.h 2012-02-22 12:38:33.714444884 +0000
+@@ -7,6 +7,13 @@
+ #ifndef _lucene_util_Array_
+ #define _lucene_util_Array_
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wshadow"
++# pragma GCC diagnostic ignored "-Wunused-parameter"
++#endif
++
+ #include <stdlib.h>
+ #include <string.h>
+
+@@ -338,4 +338,8 @@
+
+
+ CL_NS_END
++
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
+ #endif
+--- src/core/CLucene/util/PriorityQueue.h 2012-02-22 12:37:22.510637696 +0000
++++ src/core/CLucene/util/PriorityQueue.h 2012-02-22 12:38:40.316519685 +0000
+@@ -7,6 +7,12 @@
+ #ifndef _lucene_util_PriorityQueue_
+ #define _lucene_util_PriorityQueue_
+
++#include <config_global.h>
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wshadow"
++#endif
++
+ #include <stdlib.h>
+
+ CL_NS_DEF(util)
+@@ -199,4 +199,8 @@
+ };
+
+ CL_NS_END
++
++#if defined(__GNUC__) && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
++# pragma GCC diagnostic pop
++#endif
+ #endif
--- /dev/null
+--- src/contribs-lib/CMakeLists.txt 2012-05-24 22:38:20.002443317 +0200
++++ src/contribs-lib/CMakeLists.txt 2012-05-24 22:38:05.218443899 +0200
+@@ -113,3 +113,20 @@
+ COMPILE_DEFINITIONS_DEBUG _DEBUG
+ )
+
++#install lib
++install(TARGETS clucene-contribs-lib
++ DESTINATION ${LIB_DESTINATION}
++ COMPONENT runtime )
++
++#install public headers.
++FOREACH(file ${HEADERS})
++ get_filename_component(apath ${file} PATH)
++ get_filename_component(aname ${file} NAME)
++ file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
++ IF ( NOT aname MATCHES "^_.*" )
++ install(FILES ${file}
++ DESTINATION include/${relpath}
++ COMPONENT development)
++ ENDIF ( NOT aname MATCHES "^_.*" )
++ENDFOREACH(file)
++
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,coinmp,coinmp))
+
+$(eval $(call gb_ExternalPackage_use_external_project,coinmp,coinmp))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/CoinMP.dll,CoinMP/MSVisualStudio/v9/$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)/CoinMP.dll))
+else ifneq ($(DISABLE_DYNLOADING),)
+# Just use the static archives from workdir. See bin/lo-all-static-libs
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbc.3.dylib,Cbc/src/.libs/libCbc.3.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbcSolver.3.dylib,Cbc/src/.libs/libCbcSolver.3.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCgl.1.dylib,Cgl/src/.libs/libCgl.1.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClp.1.dylib,Clp/src/.libs/libClp.1.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsiClp.1.dylib,Clp/src/OsiClp/.libs/libOsiClp.1.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinMP.1.dylib,CoinMP/src/.libs/libCoinMP.1.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinUtils.3.dylib,CoinUtils/src/.libs/libCoinUtils.3.dylib))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsi.1.dylib,Osi/src/Osi/.libs/libOsi.1.dylib))
+else
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbc.so.3,Cbc/src/.libs/libCbc.so.3.8.8))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCbcSolver.so.3,Cbc/src/.libs/libCbcSolver.so.3.8.8))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCgl.so.1,Cgl/src/.libs/libCgl.so.1.8.5))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libClp.so.1,Clp/src/.libs/libClp.so.1.12.6))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsiClp.so.1,Clp/src/OsiClp/.libs/libOsiClp.so.1.12.6))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinMP.so.1,CoinMP/src/.libs/libCoinMP.so.1.7.6))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libCoinUtils.so.3,CoinUtils/src/.libs/libCoinUtils.so.3.9.11))
+$(eval $(call gb_ExternalPackage_add_file,coinmp,$(LIBO_LIB_FOLDER)/libOsi.so.1,Osi/src/Osi/.libs/libOsi.so.1.11.5))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,coinmp))
+
+$(eval $(call gb_ExternalProject_register_targets,coinmp,\
+ build \
+))
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,coinmp,build) :
+ $(call gb_ExternalProject_run,build,\
+ MSBuild.exe CoinMP.sln /t:Build \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ /p:Platform=Win32 \
+ $(if $(filter 100,$(VCVER)),/p:PlatformToolset=v100 /p:VisualStudioVersion=10.0) \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) /p:VisualStudioVersion=11.0) \
+ ,CoinMP/MSVisualStudio/v9)
+
+else
+$(call gb_ExternalProject_get_state_target,coinmp,build) :
+ +$(call gb_ExternalProject_run,build,\
+ ./configure COIN_SKIP_PROJECTS="Data/Sample" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(DISABLE_DYNLOADING),--disable-shared) \
+ --enable-dependency-linking F77=unavailable \
+ && $(MAKE) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,coinmp))
+
+$(eval $(call gb_Module_add_targets,coinmp,\
+ ExternalPackage_coinmp \
+ ExternalProject_coinmp \
+ UnpackedTarball_coinmp \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+CoinMP is a C-API library that supports most of the functionality of CLP (Coin LP),
+CBC (Coin Branch-and-Cut), and CGL (Cut Generation Library) projects.
+
+Info [https://projects.coin-or.org/CoinMP].
+From [http://www.coin-or.org/download/source/CoinMP/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,coinmp))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,coinmp,$(COINMP_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,coinmp,\
+ CoinMP/MSVisualStudio/v9/CoinMP.sln \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
+ external/coinmp/android.build.patch.1 \
+ external/coinmp/no-binaries.patch.1 \
+ external/coinmp/werror-format-security.patch.0 \
+ external/coinmp/windows.build.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: Diff -*-
+# Patch to make the CoinMP configury recognize Android
+#
+--- coinmp/config.sub
++++ coinmp/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+--- coinmp/CoinUtils/config.sub
++++ coinmp/CoinUtils/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+--- coinmp/Osi/config.sub
++++ coinmp/Osi/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+--- coinmp/Clp/config.sub
++++ coinmp/Clp/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+--- coinmp/Cgl/config.sub
++++ coinmp/Cgl/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+--- coinmp/Cbc/config.sub
++++ coinmp/Cbc/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+--- coinmp/CoinMP/config.sub
++++ coinmp/CoinMP/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+# -*- Mode: Diff -*-
+# Patch to avoid building any programs for CoinMP
+#
+--- coinmp/Clp/src/Makefile.in
++++ coinmp/Clp/src/Makefile.in
+@@ -95,7 +95,7 @@
+ @COIN_HAS_AMD_FALSE@@COIN_HAS_CHOLMOD_FALSE@@COIN_HAS_GLPK_TRUE@am__append_4 = ClpCholeskyUfl.cpp ClpCholeskyUfl.hpp
+ @COIN_HAS_MUMPS_TRUE@am__append_5 = ClpCholeskyMumps.cpp ClpCholeskyMumps.hpp
+ @COIN_HAS_WSMP_TRUE@am__append_6 = ClpCholeskyWssmp.cpp ClpCholeskyWssmp.hpp ClpCholeskyWssmpKKT.cpp ClpCholeskyWssmpKKT.hpp
+-bin_PROGRAMS = clp$(EXEEXT)
++bin_PROGRAMS =
+ @COIN_HAS_CHOLMOD_TRUE@am__append_7 = -I`$(CYGPATH_W) $(CHOLMODINCDIR)`
+ @COIN_HAS_AMD_TRUE@am__append_8 = -I`$(CYGPATH_W) $(AMDINCDIR)`
+ @COIN_HAS_ABC_TRUE@am__append_9 = AbcSimplex.hpp CoinAbcCommon.hpp AbcCommon.hpp
+--- coinmp/Cbc/src/Makefile.in
++++ coinmp/Cbc/src/Makefile.in
+@@ -44,7 +44,7 @@
+ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+-bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
++bin_PROGRAMS =
+
+ ########################################################################
+ # cbc program #
--- /dev/null
+diff -ur coinmp.org/CoinUtils/src/CoinMessageHandler.cpp coinmp/CoinUtils/src/CoinMessageHandler.cpp
+--- CoinUtils/src/CoinMessageHandler.cpp 2014-05-21 23:14:01.384874167 +0200
++++ CoinUtils/src/CoinMessageHandler.cpp 2014-05-21 23:14:47.708874712 +0200
+@@ -820,7 +820,7 @@
+ sprintf(messageOut_,g_format_,doublevalue);
+ if (next != format_+2) {
+ messageOut_+=strlen(messageOut_);
+- sprintf(messageOut_,format_+2);
++ sprintf(messageOut_,"%s",format_+2);
+ }
+ }
+ messageOut_+=strlen(messageOut_);
--- /dev/null
+#define GIT_SHA1 "cb1d97788a38d2928afb4622f6a25d012f0f8a54"
+char g_GIT_SHA1[] = GIT_SHA1;
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,collada2gltf))
+
+$(eval $(call gb_Module_add_targets,collada2gltf,\
+ StaticLibrary_collada2gltf \
+ UnpackedTarball_collada2gltf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+An open-source converter produces glTF assets from COLLADA using OpenCOLLADA.
+
+From:
+[https://github.com/amd/glTF/tree/master/converter/COLLADA2GLTF].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,collada2gltf))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,collada2gltf,collada2gltf))
+
+$(eval $(call gb_StaticLibrary_use_externals,collada2gltf, \
+ opencollada_parser \
+ png \
+))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,collada2gltf))
+
+$(eval $(call gb_StaticLibrary_add_defs,collada2gltf,\
+ -DUSE_OPEN3DGC \
+))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_StaticLibrary_add_defs,collada2gltf,\
+ -D_CRT_SECURE_NO_WARNINGS \
+ -EHsc \
+))
+
+endif
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,collada2gltf,cpp))
+
+$(eval $(call gb_StaticLibrary_set_include,collada2gltf,\
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf) \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/assetModifiers \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/convert \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/dependencies/json/include/rapidjson \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/extensions/o3dgc-compression \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/GLTF \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/helpers \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/JSON \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/profiles/webgl-1.0 \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/shaders \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,collada2gltf,\
+ UnpackedTarball/collada2gltf/COLLADA2GLTFWriter \
+ UnpackedTarball/collada2gltf/GitSHA1 \
+ UnpackedTarball/collada2gltf/GLTFOpenCOLLADAUtils \
+ UnpackedTarball/collada2gltf/assetModifiers/GLTFFlipUVModifier \
+ UnpackedTarball/collada2gltf/convert/meshConverter \
+ UnpackedTarball/collada2gltf/convert/animationConverter \
+ UnpackedTarball/collada2gltf/extensions/o3dgc-compression/GLTF-Open3DGC \
+ UnpackedTarball/collada2gltf/GLTF/GLTFAccessor \
+ UnpackedTarball/collada2gltf/GLTF/GLTFAccessorCache \
+ UnpackedTarball/collada2gltf/GLTF/GLTFAsset \
+ UnpackedTarball/collada2gltf/GLTF/GLTFAnimation \
+ UnpackedTarball/collada2gltf/GLTF/GLTFBuffer \
+ UnpackedTarball/collada2gltf/GLTF/GLTFConfig \
+ UnpackedTarball/collada2gltf/GLTF/GLTFEffect \
+ UnpackedTarball/collada2gltf/GLTF/GLTFExtraDataHandler \
+ UnpackedTarball/collada2gltf/GLTF/GLTFInputStream \
+ UnpackedTarball/collada2gltf/GLTF/GLTFMesh \
+ UnpackedTarball/collada2gltf/GLTF/GLTFOutputStream \
+ UnpackedTarball/collada2gltf/GLTF/GLTFPrimitive \
+ UnpackedTarball/collada2gltf/GLTF/GLTFProfile \
+ UnpackedTarball/collada2gltf/GLTF/GLTFSkin \
+ UnpackedTarball/collada2gltf/GLTF/GLTFUtils \
+ UnpackedTarball/collada2gltf/GLTF/GLTFWriter \
+ UnpackedTarball/collada2gltf/helpers/geometryHelpers \
+ UnpackedTarball/collada2gltf/helpers/mathHelpers \
+ UnpackedTarball/collada2gltf/JSON/JSONArray \
+ UnpackedTarball/collada2gltf/JSON/JSONNumber \
+ UnpackedTarball/collada2gltf/JSON/JSONObject \
+ UnpackedTarball/collada2gltf/JSON/JSONString \
+ UnpackedTarball/collada2gltf/JSON/JSONValue \
+ UnpackedTarball/collada2gltf/profiles/webgl-1.0/GLTFWebGL_1_0_Profile \
+ UnpackedTarball/collada2gltf/shaders/commonProfileShaders \
+))
+
+# o3dgc external library compiled from collada2gltf
+$(eval $(call gb_StaticLibrary_set_include,collada2gltf,\
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/dependencies/o3dgc/src/o3dgc_common_lib/inc \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/dependencies/o3dgc/src/o3dgc_decode_lib/inc \
+ -I$(call gb_UnpackedTarball_get_dir,collada2gltf)/dependencies/o3dgc/src/o3dgc_encode_lib/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,collada2gltf,\
+ UnpackedTarball/collada2gltf/dependencies/o3dgc/src/o3dgc_common_lib/src/o3dgcArithmeticCodec \
+ UnpackedTarball/collada2gltf/dependencies/o3dgc/src/o3dgc_common_lib/src/o3dgcTools \
+ UnpackedTarball/collada2gltf/dependencies/o3dgc/src/o3dgc_common_lib/src/o3dgcTriangleFans \
+ UnpackedTarball/collada2gltf/dependencies/o3dgc/src/o3dgc_decode_lib/src/o3dgcDynamicVectorDecoder \
+ UnpackedTarball/collada2gltf/dependencies/o3dgc/src/o3dgc_encode_lib/src/o3dgcDynamicVectorEncoder \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,collada2gltf))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,collada2gltf,$(COLLADA2GLTF_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_file,collada2gltf,.,external/collada2gltf/GitSHA1.cpp))
+
+$(eval $(call gb_UnpackedTarball_add_patches,collada2gltf,\
+ external/collada2gltf/patches/wrong_uri_usage.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff -ur collada2gltf.org/GLTF/GLTFAsset.cpp collada2gltf/GLTF/GLTFAsset.cpp
+--- collada2gltf.org/GLTF/GLTFAsset.cpp 2014-05-23 19:19:39.505246750 +0200
++++ collada2gltf/GLTF/GLTFAsset.cpp 2014-05-23 19:20:05.005245669 +0200
+@@ -191,12 +191,9 @@
+ shared_ptr<GLTFOutputStream> GLTFAsset::createOutputStreamIfNeeded(const std::string& streamName) {
+
+ if (this->_nameToOutputStream.count(streamName) == 0) {
+- COLLADABU::URI inputURI(this->getInputFilePath().c_str());
+ COLLADABU::URI outputURI(this->getOutputFilePath().c_str());
+
+- std::string folder = outputURI.getPathDir();
+- std::string fileName = inputURI.getPathFileBase();
+-
++ std::string folder = COLLADABU::URI(outputURI.getPathDir()).toNativePath();
+ shared_ptr<GLTFOutputStream> outputStream = shared_ptr <GLTFOutputStream> (new GLTFOutputStream(folder, streamName, ""));
+ this->_nameToOutputStream[streamName] = outputStream;
+ }
+@@ -280,13 +277,13 @@
+ this->_bundleOutputPath = outputBundlePathURI.toNativePath();
+
+ COLLADABU::URI outputPathURI(outputBundlePathURI.getURIString() + "/" + outputBundlePathURI.getPathFileBase() + "." + "json");
+- this->_outputFilePath = outputPathURI.toNativePath();
++ this->_outputFilePath = outputPathURI.getURIString();
+ // this->log("outputBundlePath:%s\n",outputBundlePathURI.toNativePath().c_str());
+ // this->log("outputPath:%s\n",outputPathURI.toNativePath().c_str());
+ } else {
+ this->_bundleOutputPath = outputBundlePathURI.toNativePath();
+ COLLADABU::URI outputPathURI(outputBundlePathURI.getURIString() + "/" + outputBundlePathURI.getPathFileBase() + "." + "json");
+- this->_outputFilePath = outputPathURI.toNativePath();
++ this->_outputFilePath = outputPathURI.getURIString();
+ }
+ COLLADABU::Utils::createDirectoryIfNeeded(this->_bundleOutputPath.c_str());
+ }
+@@ -376,10 +373,10 @@
+ COLLADABU::URI outputImagePathURI(inputImagePath.c_str());
+
+ COLLADABU::URI outputURI(this->getOutputFilePath().c_str());
+- std::string folder = outputURI.getPathDir();
++ std::string folder = COLLADABU::URI(outputURI.getPathDir()).toNativePath();
+ std::string outputPath = folder + outputImagePathURI.getPathFile();
+-
+- std::ifstream f1(inputImagePath.c_str(), std::fstream::binary);
++
++ std::ifstream f1(COLLADABU::URI(inputImagePath).toNativePath().c_str(), std::fstream::binary);
+ std::ofstream f2(outputPath.c_str(), std::fstream::binary);
+
+ if (this->_converterConfig->boolForKeyPath("verboseLogging")) {
+@@ -397,7 +394,8 @@
+ this->_root = shared_ptr <GLTF::JSONObject> (new GLTF::JSONObject());
+ this->_root->createObjectIfNeeded(kNodes);
+
+- this->_writer.initWithPath(this->getOutputFilePath().c_str());
++ COLLADABU::URI outputURI(this->getOutputFilePath().c_str());
++ this->_writer.initWithPath(outputURI.toNativePath().c_str());
+ }
+
+ static void __eval(JSONValue* value, void *context) {
+@@ -427,7 +424,7 @@
+ void GLTFAsset::_writeJSONResource(const std::string &path, shared_ptr<JSONObject> obj) {
+ GLTF::GLTFWriter resultsWriter;
+ COLLADABU::URI outputURI(this->resourceOuputPathForPath(path));
+- std::string aPath = this->getOutputFolderPath() + outputURI.getPathFile();
++ std::string aPath = COLLADABU::URI(this->getOutputFolderPath() + outputURI.getPathFile()).toNativePath();
+ resultsWriter.initWithPath(aPath);
+ obj->write(&resultsWriter);
+
+diff -ur collada2gltf.org/shaders/commonProfileShaders.cpp collada2gltf/shaders/commonProfileShaders.cpp
+--- collada2gltf.org/shaders/commonProfileShaders.cpp 2014-05-23 19:19:39.521246749 +0200
++++ collada2gltf/shaders/commonProfileShaders.cpp 2014-05-23 19:20:09.085245497 +0200
+@@ -294,7 +294,7 @@
+ //also write the file on disk
+ if (shaderString.size() > 0) {
+ COLLADABU::URI outputURI(asset->getOutputFilePath());
+- std::string shaderPath = outputURI.getPathDir() + path;
++ std::string shaderPath = COLLADABU::URI(outputURI.getPathDir()).toNativePath() + path;
+ GLTF::GLTFUtils::writeData(shaderPath, "w",(unsigned char*)shaderString.c_str(), shaderString.size());
+ if (!CONFIG_BOOL(asset, "outputProgress") && asset->converterConfig()->boolForKeyPath("verboseLogging")) {
+ asset->log("[shader]: %s\n", shaderPath.c_str());
--- /dev/null
+--- include/cppunit/plugin/TestPlugIn.h
++++ include/cppunit/plugin/TestPlugIn.h
+@@ -111,7 +111,7 @@
+ /*! \brief Type of the function exported by a plug-in.
+ * \ingroup WritingTestPlugIn
+ */
+-typedef CppUnitTestPlugIn *(*TestPlugInSignature)();
++extern "C" { typedef CppUnitTestPlugIn *(*TestPlugInSignature)(); }
+
+
+ /*! \brief Implements the function exported by the test plug-in
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,cppunit))
+
+$(eval $(call gb_ExternalProject_register_targets,cppunit,\
+ build \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+$(call gb_ExternalProject_get_state_target,cppunit,build) :
+ $(call gb_ExternalProject_run,build,\
+ PROFILEFLAGS="$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) \
+ /p:VisualStudioVersion=11.0)" \
+ && msbuild.exe cppunit_dll.vcxproj /p:Configuration=$${PROFILEFLAGS} \
+ && cd ../DllPlugInTester \
+ && msbuild.exe DllPlugInTester.vcxproj /p:Configuration=$${PROFILEFLAGS} \
+ ,src/cppunit)
+else
+
+cppunit_CXXFLAGS=$(CXXFLAGS)
+
+ifneq (,$(filter ANDROID DRAGONFLY FREEBSD IOS LINUX NETBSD OPENBSD,$(OS)))
+ifneq (,$(gb_ENABLE_DBGUTIL))
+cppunit_CXXFLAGS+=-D_GLIBCXX_DEBUG
+endif
+endif
+
+ifeq ($(OS)-$(COM),WNT-GCC)
+cppunit_CXXFLAGS+=-mthreads
+endif
+
+ifneq (,$(debug))
+cppunit_CXXFLAGS+=-g
+endif
+
+$(call gb_ExternalProject_get_state_target,cppunit,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ --disable-dependency-tracking \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
+ --disable-doxygen \
+ --disable-html-docs \
+ --disable-latex-docs \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________NONE) \
+ $(if $(filter WNT,$(OS)),LDFLAGS="-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2") \
+ $(if $(filter SOLARIS,$(OS)),LIBS="-lm") \
+ $(if $(filter ANDROID,$(OS)),LIBS="-lgnustl_shared -lm") \
+ CXXFLAGS="$(cppunit_CXXFLAGS)" \
+ && cd src \
+ && $(MAKE) \
+ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,cppunit))
+
+$(eval $(call gb_Module_add_targets,cppunit,\
+ UnpackedTarball_cppunit \
+ ExternalProject_cppunit \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+C++ port of the JUnit framework for unit testing.
+
+From [http://sourceforge.net/projects/cppunit/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,cppunit))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,cppunit,$(CPPUNIT_TARBALL),,cppunit))
+
+$(eval $(call gb_UnpackedTarball_add_patches,cppunit,\
+ external/cppunit/coverity.patch \
+ external/cppunit/windows.patch \
+ external/cppunit/unix.patch \
+ external/cppunit/wundef.patch \
+ external/cppunit/CPPUNIT_PLUGIN_EXPORT.patch.0 \
+ external/cppunit/enable-win32-debug.patch \
+))
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,cppunit,\
+ external/cppunit/disable-dynloading.patch \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/cppunit-1.13.1/src/cppunit/Asserter.cpp
++++ misc/build/cppunit-1.13.1/src/cppunit/Asserter.cpp
+@@ -13,7 +13,7 @@
+ fail( Message( "assertion failed", message ), sourceLine );
+ }
+
+-
++// coverity[+kill]
+ void
+ Asserter::fail( const Message &message,
+ const SourceLine &sourceLine )
--- /dev/null
+--- build/cppunit-1.13.1/include/cppunit/plugin/TestPlugIn.h
++++ misc/build/cppunit-1.13.1/include/cppunit/plugin/TestPlugIn.h
+@@ -106,7 +106,9 @@
+ * CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void);
+ * \endcode
+ */
++#ifndef CPPUNIT_PLUGIN_EXPORTED_NAME
+ #define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTestPlugIn
++#endif
+
+ /*! \brief Type of the function exported by a plug-in.
+ * \ingroup WritingTestPlugIn
+@@ -143,6 +143,12 @@
+ #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
+ typedef char __CppUnitPlugInImplementMainDummyTypeDef
+
++// Actually this is for iOS and Android where we build the cppunit tests libraries
++// as plain archives and just link them statically into test fixture programs,
++// and don't want any stinking duplicate main(), but shouldn't hurt for MacOSX either.
++#elif defined(__APPLE__) || defined(__ANDROID__)
++#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
++ typedef char __CppUnitPlugInImplementMainDummyTypeDef
+ // Unix
+ #elif defined(CPPUNIT_HAVE_UNIX_DLL_LOADER) || defined(CPPUNIT_HAVE_UNIX_SHL_LOADER)
+ #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
--- /dev/null
+--- misc/cppunit-1.13.1/src/cppunit/cppunit_dll.vcxproj
++++ misc/build/cppunit-1.13.1/src/cppunit/cppunit_dll.vcxproj
+@@ -107,7 +107,6 @@
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <WarningLevel>Level3</WarningLevel>
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
+- <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CPPUNIT_BUILD_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AssemblerListingLocation>.\ReleaseDll\</AssemblerListingLocation>
+@@ -138,6 +137,7 @@
+ <Link>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <LinkDLL>true</LinkDLL>
++ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OutputFile>.\ReleaseDll\cppunit_dll.dll</OutputFile>
+ <ImportLibrary>.\ReleaseDll\cppunit_dll.lib</ImportLibrary>
--- /dev/null
+--- misc/cppunit-1.13.1/src/cppunit/UnixDynamicLibraryManager.cpp
++++ misc/build/cppunit-1.13.1/src/cppunit/UnixDynamicLibraryManager.cpp
+@@ -34,7 +34,11 @@
+ std::string
+ DynamicLibraryManager::getLastErrorDetail() const
+ {
+- return "";
++ const char *last_dlerror = ::dlerror();
++ if (last_dlerror != NULL)
++ return last_dlerror;
++ else
++ return "";
+ }
+
+
--- /dev/null
+--- misc/cppunit-1.13.1/include/cppunit/plugin/TestPlugIn.h 2010-01-11 14:42:25.084658287 +0100
++++ misc/build/cppunit-1.13.1/include/cppunit/plugin/TestPlugIn.h 2010-01-11 14:42:18.660706180 +0100
+@@ -133,9 +133,8 @@
+ /*! \def CPPUNIT_PLUGIN_IMPLEMENT_MAIN()
+ * \brief Implements the 'main' function for the plug-in.
+ *
+- * This macros implements the main() function for dynamic library.
+- * For example, WIN32 requires a DllMain function, while some Unix
+- * requires a main() function. This macros takes care of the implementation.
++ * This macro implements the main() function for dynamic library
++ * on Unix for some weird reason.
+ */
+
+ // Win32
+@@ -149,21 +149,7 @@
+
+ // Win32
+ #if defined(CPPUNIT_HAVE_WIN32_DLL_LOADER)
+-#if !defined(APIENTRY)
+-#define WIN32_LEAN_AND_MEAN
+-#define NOGDI
+-#define NOUSER
+-#define NOKERNEL
+-#define NOSOUND
+-#define NOMINMAX
+-#define BLENDFUNCTION void // for mingw & gcc
+-#include <windows.h>
+-#endif
+ #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
+- BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ) \
+- { \
+- return TRUE; \
+- } \
+ typedef char __CppUnitPlugInImplementMainDummyTypeDef
+
+ // Unix
+--- misc/cppunit-1.13.1/include/cppunit/TestAssert.h
++++ misc/build/cppunit-1.13.1/include/cppunit/TestAssert.h
+@@ -76,7 +76,7 @@
+ const int precision = 15;
+ #endif // #ifdef DBL_DIG
+ char buffer[128];
+-#ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning.
++#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning.
+ sprintf_s(buffer, sizeof(buffer), "%.*g", precision, x);
+ #else
+ sprintf(buffer, "%.*g", precision, x);
+
--- /dev/null
+--- misc/cppunit-1.13.1/include/cppunit/Portability.h 2012-09-24 19:10:36.000000000 +0200
++++ misc/build/cppunit-1.13.1/include/cppunit/Portability.h 2013-03-18 14:23:48.880718714 +0100
+@@ -68,6 +68,9 @@
+ * std::allocator. On some compilers, you may need to change this to
+ * std::allocator<T>.
+ */
++#ifndef CPPUNIT_STD_NEED_ALLOCATOR /* avoid -Wundef warning */
++#define CPPUNIT_STD_NEED_ALLOCATOR 0
++#endif
+ #if CPPUNIT_STD_NEED_ALLOCATOR
+ # if !defined(CPPUNIT_STD_ALLOCATOR)
+ # define CPPUNIT_STD_ALLOCATOR std::allocator
--- /dev/null
+diff -purN misc/description.xml misc/build/description.xml
+--- misc/description.xml 2009-02-03 00:07:30.000000000 +0100
++++ misc/build/description.xml 2010-03-05 21:38:48.000000000 +0100
+@@ -5,12 +5,4 @@
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <identifier value="nl.nouenoff.ct2n"/>
+ <version value="1.3.2"/>
+- <!-- <dependencies>
+-
+- </dependencies> -->
+- <registration>
+- <simple-license accept-by="admin" default-license-id="ID0" suppress-on-update="true" >
+- <license-text xlink:href="registration/COPYING" lang="en" license-id="ID0" />
+- </simple-license>
+- </registration>
+ </description>
--- /dev/null
+diff -purN misc/Office/UI/BaseWindowState.xcu misc/build/Office/UI/BaseWindowState.xcu
+--- misc/Office/UI/BaseWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/BaseWindowState.xcu 2010-03-05 21:36:37.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/BasicIDEWindowState.xcu misc/build/Office/UI/BasicIDEWindowState.xcu
+--- misc/Office/UI/BasicIDEWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/BasicIDEWindowState.xcu 2010-03-05 21:36:46.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/CalcWindowState.xcu misc/build/Office/UI/CalcWindowState.xcu
+--- misc/Office/UI/CalcWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/CalcWindowState.xcu 2010-03-05 21:36:32.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/DrawWindowState.xcu misc/build/Office/UI/DrawWindowState.xcu
+--- misc/Office/UI/DrawWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/DrawWindowState.xcu 2010-03-05 21:36:54.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/ImpressWindowState.xcu misc/build/Office/UI/ImpressWindowState.xcu
+--- misc/Office/UI/ImpressWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/ImpressWindowState.xcu 2010-03-05 21:36:59.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/MathWindowState.xcu misc/build/Office/UI/MathWindowState.xcu
+--- misc/Office/UI/MathWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/MathWindowState.xcu 2010-03-05 21:37:03.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/StartModuleWindowState.xcu misc/build/Office/UI/StartModuleWindowState.xcu
+--- misc/Office/UI/StartModuleWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/StartModuleWindowState.xcu 2010-03-05 21:37:09.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
+diff -purN misc/Office/UI/WriterWindowState.xcu misc/build/Office/UI/WriterWindowState.xcu
+--- misc/Office/UI/WriterWindowState.xcu 2008-02-09 23:26:50.000000000 +0100
++++ misc/build/Office/UI/WriterWindowState.xcu 2010-03-05 21:37:17.000000000 +0100
+@@ -9,6 +9,9 @@
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value>CT2N</value>
+ </prop>
++ <prop oor:name="Visible" oor:type="xs:boolean">
++ <value>false</value>
++ </prop>
+ </node>
+ </node>
+ </node>
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,ct2n,ConvertTextToNumber))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files_with_dir,ct2n,share/extensions/ConvertTextToNumber,\
+ Addons.xcu \
+ CT2N/MainCode.xba \
+ CT2N/ToClipbord.xba \
+ CT2N/Language.xba \
+ CT2N/dialog.xlb \
+ CT2N/dlgCode.xba \
+ CT2N/script.xlb \
+ CT2N/dlgCT2N.xdl \
+ CT2N/UserSettings.xba \
+ META-INF/manifest.xml \
+ Office/UI/BaseWindowState.xcu \
+ Office/UI/ImpressWindowState.xcu \
+ Office/UI/StartModuleWindowState.xcu \
+ Office/UI/BasicIDEWindowState.xcu \
+ Office/UI/CalcWindowState.xcu \
+ Office/UI/WriterWindowState.xcu \
+ Office/UI/DrawWindowState.xcu \
+ Office/UI/MathWindowState.xcu \
+ description.xml \
+ icons/image1_26.bmp \
+ icons/image1_16.bmp \
+ pkg-desc/pkg-description.txt \
+ registration/COPYING \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,ConvertTextToNumber))
+
+$(eval $(call gb_Module_add_targets,ConvertTextToNumber,\
+ ExternalPackage_ct2n \
+ UnpackedTarball_ct2n \
+))
+
+# vim:set noet sw=4 ts=4:
--- /dev/null
+From [http://extensions.libreoffice.org/extension-center/ct2n-convert-text-to-number-and-dates].
+
+ConvertTextToNumber replaces numbers and dates, formatted
+ as text, with real numbers.
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,ConvertTextToNumber))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,ConvertTextToNumber,$(CT2N_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,ConvertTextToNumber,\
+ external/ct2n/ConvertTextToNumber-1.3.2-no-license.patch \
+ external/ct2n/ConvertTextToNumber-1.3.2-no-visible-by-default.patch \
+))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,ConvertTextToNumber,\
+ description.xml \
+ Office/UI/BaseWindowState.xcu \
+ Office/UI/BasicIDEWindowState.xcu \
+ Office/UI/CalcWindowState.xcu \
+ Office/UI/DrawWindowState.xcu \
+ Office/UI/ImpressWindowState.xcu \
+ Office/UI/MathWindowState.xcu \
+ Office/UI/StartModuleWindowState.xcu \
+ Office/UI/WriterWindowState.xcu \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://extensions.libreoffice.org/extension-center/ct2n-convert-text-to-number-and-dates].
+
+ConvertTextToNumber replaces numbers and dates, formatted
+ as text, with real numbers.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,curl,curl))
+
+$(eval $(call gb_ExternalPackage_use_external_project,curl,curl))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+
+ifeq ($(OS)$(COM),WNTGCC)
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.dll,lib/.libs/libcurl.dll))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),d).dll,lib/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),d).dll))
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.4.dylib,lib/.libs/libcurl.4.dylib))
+else ifeq ($(OS),AIX)
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so,lib/.libs/libcurl.so.4))
+else
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.3.0))
+endif
+
+endif # $(DISABLE_DYNLOADING)
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,curl))
+
+$(eval $(call gb_ExternalProject_use_externals,curl,\
+ nss3 \
+ zlib \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,curl,\
+ build \
+))
+
+ifneq ($(OS),WNT)
+
+curl_CPPFLAGS :=
+curl_LDFLAGS := $(if $(filter LINUX FREEBSD,$(OS)),"-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib)
+
+ifneq ($(OS),ANDROID)
+ifneq ($(SYSBASE),)
+curl_CPPFLAGS += -I$(SYSBASE)/usr/include
+curl_LDFLAGS += -L$(SYSBASE)/usr/lib
+endif
+endif
+
+# there are 2 include paths, the other one is passed to --with-nss below
+ifeq ($(SYSTEM_NSS),)
+curl_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss
+endif
+
+# use --with-darwinssl on Mac OS X >10.5 and iOS to get a native UI for SSL certs for CMIS usage
+# use --with-nss only on platforms other than Mac OS X and iOS
+$(call gb_ExternalProject_get_state_target,curl,build):
+ $(call gb_ExternalProject_run,build,\
+ CPPFLAGS="$(curl_CPPFLAGS)" \
+ LDFLAGS=$(curl_LDFLAGS) \
+ ./configure \
+ $(if $(filter IOS MACOSX,$(OS)),,--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out")) \
+ $(if $(filter IOS,$(OS)),--with-darwinssl) \
+ $(if $(filter MACOSX,$(OS)),\
+ $(if $(filter 1050,$(MAC_OS_X_VERSION_MIN_REQUIRED)),,--with-darwinssl)) \
+ --without-ssl \
+ --without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher \
+ --disable-file --disable-ldap --disable-telnet --disable-dict --without-libssh2 \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && cd lib \
+ && $(MAKE) \
+ )
+
+else ifeq ($(OS)$(COM),WNTGCC)
+
+$(call gb_ExternalProject_get_state_target,curl,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --with-nss --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher \
+ --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 \
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug) \
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ LIBS="-lws2_32 -lwinmm $(if $(MINGW_SHARED_GXXLIB),$(MINGW_SHARED_LIBSTDCPP))" \
+ LDFLAGS="$(patsubst ;, -L,$(ILIB))" \
+ CPPFLAGS="$(INCLUDE)" OBJDUMP="objdump" \
+ && cd lib \
+ && $(MAKE) \
+ )
+
+else ifeq ($(COM),MSC)
+
+$(call gb_ExternalProject_get_state_target,curl,build):
+ $(call gb_ExternalProject_run,build,\
+ MAKEFLAGS= LIB="$(ILIB)" nmake -f Makefile.vc10 \
+ cfg=$(if $(MSVC_USE_DEBUG_RUNTIME),debug-dll,release-dll) \
+ EXCFLAGS="/EHa /Zc:wchar_t- /D_CRT_SECURE_NO_DEPRECATE /DUSE_WINDOWS_SSPI $(SOLARINC)" $(if $(filter X86_64,$(CPUNAME)),MACHINE=X64) \
+ ,lib)
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,curl))
+
+$(eval $(call gb_Module_add_targets,curl,\
+ UnpackedTarball_curl \
+ ExternalPackage_curl \
+ ExternalProject_curl \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+A URL manipulation engine from [http://curl.haxx.se/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,curl))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,curl,$(CURL_TARBALL),,curl))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,curl,1))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,curl,\
+ lib/Makefile.vc10 \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,curl,\
+ external/curl/curl-freebsd.patch.1 \
+ external/curl/curl-msvc.patch.1 \
+ external/curl/curl-msvc-schannel.patch.1 \
+ external/curl/curl-7.26.0_mingw.patch \
+ external/curl/curl-7.26.0_win-proxy.patch \
+))
+
+ifeq ($(OS),ANDROID)
+$(eval $(call gb_UnpackedTarball_add_patches,curl,\
+ external/curl/curl-android.patch \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- a/lib/curl_setup.h 2009-10-29 05:21:58.000000000 +0900
++++ b/lib/curl_setup.h 2010-03-02 06:03:10.009500000 +0900
+@@ -40,6 +40,21 @@
+
+ #include "curl_config.h"
+
++#ifdef __MINGW32__
++#undef HAVE_DLFCN_H
++#define HAVE_GETHOSTBYADDR 1
++#define HAVE_GETHOSTBYNAME 1
++#undef HAVE_LIBZ
++#undef HAVE_NETDB_H
++#undef HAVE_POLL_H
++#undef HAVE_SYS_IOCTL_H
++#undef HAVE_SYS_POLL_H
++#undef HAVE_SYS_UIO_H
++#undef HAVE_TERMIOS_H
++#undef HAVE_TERMIO_H
++#undef HAVE_ZLIB_H
++#endif
++
+ #else /* HAVE_CONFIG_H */
+
+ #ifdef _WIN32_WCE
--- /dev/null
+--- curl-7.26.0/lib/Makefile.vc10
++++ misc/build/curl-7.26.0/lib/Makefile.vc10
+@@ -116,7 +116,7 @@ LFLAGS = /nologo /machine:$(MACHINE)
+ SSLLIBS = libeay32.lib ssleay32.lib
+ ZLIBLIBSDLL = zdll.lib
+ ZLIBLIBS = zlib.lib
+-WINLIBS = ws2_32.lib wldap32.lib advapi32.lib
++WINLIBS = ws2_32.lib wldap32.lib advapi32.lib winhttp.lib
+ CFLAGS = $(CFLAGS) $(EXCFLAGS)
+
+ CFGSET = FALSE
+--- curl-7.26.0/lib/url.c
++++ misc/build/curl-7.26.0/lib/url.c
+@@ -80,6 +80,10 @@ void idn_free (void *ptr);
+ int curl_win32_idn_to_ascii(const char *in, char **out);
+ #endif /* USE_LIBIDN */
+
++#ifdef WIN32
++#include <WinHttp.h>
++#endif
++
+ #include "urldata.h"
+ #include "netrc.h"
+
+@@ -4111,6 +4115,21 @@ static bool check_noproxy(const char* name, const char* no_proxy)
+ return FALSE;
+ }
+
++#ifdef WIN32
++static char* wstrToCstr( LPWSTR wStr )
++{
++ int bufSize;
++ char* out = NULL;
++ if(wStr != NULL) {
++ bufSize = WideCharToMultiByte(
++ CP_ACP, 0, wStr, -1, NULL, 0, NULL, NULL );
++ out = ( char* )malloc( bufSize * sizeof(char));
++ WideCharToMultiByte( CP_ACP, 0, wStr, -1, out, bufSize, NULL, NULL );
++ }
++ return out;
++}
++#endif
++
+ /****************************************************************
+ * Detect what (if any) proxy to use. Remember that this selects a host
+ * name and is not limited to HTTP proxies only.
+@@ -4119,6 +4138,7 @@ static bool check_noproxy(const char* name, const char* no_proxy)
+ static char *detect_proxy(struct connectdata *conn)
+ {
+ char *proxy = NULL;
++ char *no_proxy=NULL;
+
+ #ifndef CURL_DISABLE_HTTP
+ /* If proxy was not specified, we check for default proxy environment
+@@ -4138,7 +4158,63 @@ static char *detect_proxy(struct connectdata *conn)
+ * For compatibility, the all-uppercase versions of these variables are
+ * checked if the lowercase versions don't exist.
+ */
+- char *no_proxy=NULL;
++#ifdef WIN32
++ WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *ieProxyConfig;
++ ieProxyConfig = (WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*)
++ malloc(sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG));
++ if(WinHttpGetIEProxyConfigForCurrentUser(ieProxyConfig)) {
++ if(!ieProxyConfig->fAutoDetect) {
++ char *ieProxy;
++ char *ieNoProxy;
++ char* pos;
++
++ ieProxy = wstrToCstr(ieProxyConfig->lpszProxy);
++ ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass);
++
++ /* Convert the ieNoProxy into a proper no_proxy value */
++ if(NULL != ieNoProxy) {
++ no_proxy = strdup(ieNoProxy);
++ pos = strpbrk(no_proxy, "; ");
++ while(NULL != pos) {
++ no_proxy[pos-no_proxy] = ',';
++ pos = strpbrk(no_proxy, "; ");
++ }
++ }
++
++ if(!check_noproxy(conn->host.name, no_proxy)) {
++ /* Look for the http proxy setting */
++ char* tok;
++
++ if(NULL != ieProxy) {
++ tok = strtok(ieProxy, ";");
++ if(strchr(tok, '=') == NULL) {
++ proxy = strdup(ieProxy);
++ }
++ else {
++ do {
++ if(strncmp(tok, "http=", 5) == 0) {
++ /* We found HTTP proxy value, then use it */
++ proxy = strdup( tok + 5 );
++ }
++ tok = strtok(NULL, ";");
++ }
++ while(NULL != tok);
++ }
++ }
++ }
++
++ free(ieProxy);
++ free(ieNoProxy);
++ }
++ else {
++ /* TODO Handle the Proxy config Auto Detection case */
++ }
++
++ GlobalFree( ieProxyConfig->lpszAutoConfigUrl );
++ GlobalFree( ieProxyConfig->lpszProxy );
++ GlobalFree( ieProxyConfig->lpszProxyBypass );
++ }
++#else /* !WIN32 */
+ char proxy_env[128];
+
+ no_proxy=curl_getenv("no_proxy");
+@@ -4189,9 +4265,9 @@ static char *detect_proxy(struct connectdata *conn)
+ }
+ } /* if(!check_noproxy(conn->host.name, no_proxy)) - it wasn't specified
+ non-proxy */
++#endif /* WIN32 */
+ if(no_proxy)
+ free(no_proxy);
+-
+ #else /* !CURL_DISABLE_HTTP */
+
+ (void)conn;
--- /dev/null
+diff -ur curl-7.26.0/ltmain.sh misc/build/curl-7.26.0/ltmain.sh
+--- curl-7.26.0/ltmain.sh 2012-07-02 14:05:04.256112279 +0200
++++ misc/build/curl-7.26.0/ltmain.sh 2012-07-02 14:07:23.775119842 +0200
+@@ -7307,6 +7307,12 @@
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
++ # Force no versioning suffix for Android thanks to silly
++ # apkbuilder which doesn't add extra native libs unless their
++ # name ends with .so
++
++ version_type=none
++
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
--- /dev/null
+Usual patch to produce Linux-like .so files on FreeBSD
+
+diff -ur curl-7.26.0/ltmain.sh misc/build/curl-7.26.0/ltmain.sh
+--- a/ltmain.sh 2012-07-02 13:28:51.298994493 +0200
++++ b/ltmain.sh 2012-07-02 13:42:46.511039769 +0200
+@@ -7334,13 +7334,13 @@
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+- darwin|linux|osf|windows|none)
++ darwin|linux|osf|windows|freebsd-aout|freebsd-elf|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+- freebsd-aout|freebsd-elf|qnx|sunos)
++ qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+@@ -7420,8 +7420,8 @@
+ ;;
+
+ freebsd-elf)
+- major=".$current"
+- versuffix=".$current"
++ major=.`expr $current - $age`
++ versuffix="$major"
+ ;;
+
+ irix | nonstopux)
--- /dev/null
+MSVC: use WNT native Schannel SSL/TLS implementation
+
+--- curl/lib/Makefile.vc10.old 2013-11-19 00:00:29.044499752 +0100
++++ curl/lib/Makefile.vc10 2013-11-19 00:01:29.135499684 +0100
+@@ -260,7 +260,7 @@
+ TARGET = $(LIBCURL_DYN_LIB_REL)
+ DIROBJ = $(CFG)
+ LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_REL)
+-CC = $(CCNODBG) $(RTLIB)
++CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL)
+ CFGSET = TRUE
+ RESOURCE = $(DIROBJ)\libcurl.res
+ !ENDIF
+@@ -411,7 +411,7 @@
+ TARGET = $(LIBCURL_DYN_LIB_DBG)
+ DIROBJ = $(CFG)
+ LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(LIBCURL_IMP_LIB_DBG) /PDB:$(DIROBJ)\$(LIBCURL_DYN_LIB_PDB)
+-CC = $(CCDEBUG) $(RTLIBD)
++CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSWINSSL)
+ CFGSET = TRUE
+ RESOURCE = $(DIROBJ)\libcurl.res
+ !ENDIF
--- /dev/null
+MSVC: using SOLARINC and EXCFLAGS
+
+--- curl/lib/Makefile.vc10 2012-05-24 12:07:02.000000000 -0400
++++ curl/lib/Makefile.vc10 2012-10-29 11:53:44.658809300 -0400
+@@ -117,7 +117,7 @@
+ ZLIBLIBSDLL = zdll.lib
+ ZLIBLIBS = zlib.lib
+ WINLIBS = ws2_32.lib wldap32.lib advapi32.lib
+-CFLAGS = $(CFLAGS)
++CFLAGS = $(CFLAGS) $(EXCFLAGS)
+
+ CFGSET = FALSE
+
+@@ -620,11 +620,11 @@
+ debug-dll-ssl-dll\libcurl.res \
+ debug-dll-zlib-dll\libcurl.res \
+ debug-dll-ssl-dll-zlib-dll\libcurl.res: libcurl.rc
+- rc /dDEBUGBUILD=1 /Fo $@ libcurl.rc
++ rc $(SOLARINC) /dDEBUGBUILD=1 /Fo $@ libcurl.rc
+
+ release-dll\libcurl.res \
+ release-dll-ssl-dll\libcurl.res \
+ release-dll-zlib-dll\libcurl.res \
+ release-dll-ssl-dll-zlib-dll\libcurl.res: libcurl.rc
+- rc /dDEBUGBUILD=0 /Fo $@ libcurl.rc
++ rc $(SOLARINC) /dDEBUGBUILD=0 /Fo $@ libcurl.rc
+ !ENDIF # End of case where a config was provided.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,epm))
+
+$(eval $(call gb_ExternalProject_register_targets,epm,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,epm,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-fltk \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________NONE) \
+ && $(MAKE) \
+ && touch $@ \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,epm))
+
+ifeq ($(CROSS_COMPILING),)
+
+$(eval $(call gb_Module_add_targets,epm,\
+ ExternalProject_epm \
+ UnpackedTarball_epm \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Enhanced Package Manager, From [http://freshmeat.net/projects/epm]
+
+Nasty hack for packaging, not useful, but default build uses, every linux packager disables this.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,epm))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,epm,$(EPM_TARBALL),,epm))
+
+$(eval $(call gb_UnpackedTarball_add_patches,epm,\
+ external/epm/epm-3.7.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff -urN epm-3.7-old//bsd.c epm-3.7/bsd.c
+--- misc/epm-3.7/bsd.c 2003-01-14 17:05:01.000000000 +0000
++++ misc/build/epm-3.7/bsd.c 2010-04-19 22:52:32.000000000 +0000
+@@ -26,6 +26,13 @@
+
+ #include "epm.h"
+
++void cr2semicolon(char *command)
++{
++ int len, i;
++ len=strlen(command);
++ for (i=0;i<len;i++)
++ if(*(command+i)=='\n') *(command+i)=';';
++}
+
+ /*
+ * 'make_bsd()' - Make a FreeBSD software distribution package.
+@@ -149,8 +156,17 @@
+
+ for (i = dist->num_depends, d = dist->depends; i > 0; i --, d ++)
+ {
++#ifdef __FreeBSD__
++ if (d->type == DEPEND_REQUIRES) {
++ if (dist->relnumber)
++ fprintf(fp, "@pkgdep %s-%s-%d-%s", d->product, dist->version, dist->relnumber, platname);
++ else
++ fprintf(fp, "@pkgdep %s-%s-%s", d->product, dist->version, platname);
++ }
++#else
+ if (d->type == DEPEND_REQUIRES)
+ fprintf(fp, "@pkgdep %s", d->product);
++#endif
+ else
+ #ifdef __FreeBSD__
+ /*
+@@ -179,9 +195,11 @@
+ " by the BSD packager.\n", stderr);
+ break;
+ case COMMAND_POST_INSTALL :
++ cr2semicolon(c->command);
+ fprintf(fp, "@exec %s\n", c->command);
+ break;
+ case COMMAND_PRE_REMOVE :
++ cr2semicolon(c->command);
+ fprintf(fp, "@unexec %s\n", c->command);
+ break;
+ case COMMAND_POST_REMOVE :
+@@ -199,7 +217,7 @@
+ */
+
+ fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst);
+- fprintf(fp, "@exec /bin/chown %s:%s %s\n", file->user, file->group,
++ fprintf(fp, "@exec /usr/sbin/chown %s:%s %s\n", file->user, file->group,
+ file->dst);
+ fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst);
+ }
+@@ -326,12 +344,13 @@
+ if (Verbosity)
+ puts("Building FreeBSD pkg binary distribution...");
+
+- if (run_command(NULL, "pkg_create -p / -s %s -c %s -d %s -f %s %s",
++ if (run_command(NULL, "/usr/sbin/pkg_create -p / -s %s -c %s -d %s -f %s %s",
+ current, commentname, descrname, plistname, name))
+ return (1);
+
+- if (run_command(NULL, "mv %s.tgz %s", name, directory))
+- return (1);
++ if (run_command(NULL, "mv %s.tbz %s", name, directory))
++ if (run_command(NULL, "mv %s.tgz %s", name, directory))
++ return (1);
+
+ /*
+ * Remove temporary files...
+diff -urN epm-3.7-old//configure epm-3.7/configure
+--- misc/epm-3.7/configure 2003-07-24 01:20:54.000000000 +0000
++++ misc/build/epm-3.7/configure 2010-04-19 22:52:32.000000000 +0000
+@@ -1238,6 +1238,11 @@
+ fi
+ fi;
+
++# Check whether --enable-fltk or --disable-fltk was given.
++if test "${enable_fltk+set}" = set; then
++ enableval="$enable_fltk"
++fi;
++
+
+ # Check whether --with-docdir or --without-docdir was given.
+ if test "${with_docdir+set}" = set; then
+@@ -4904,36 +4909,38 @@
+ fi
+
+
+-# Extract the first word of "fltk-config", so it can be a program name with args.
+-set dummy fltk-config; ac_word=$2
+-echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+-if test "${ac_cv_path_FLTKCONFIG+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- case $FLTKCONFIG in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
++if eval "test x$enable_fltk = xyes"; then
++ # Extract the first word of "fltk-config", so it can be a program name with args.
++ set dummy fltk-config; ac_word=$2
++ echo "$as_me:$LINENO: checking for $ac_word" >&5
++ echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++ if test "${ac_cv_path_FLTKCONFIG+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++ else
++ case $FLTKCONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ for as_dir in $PATH
++ do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++ done
++ done
++
++ ;;
++ esac
+ fi
+-done
+-done
+-
+- ;;
+-esac
++ FLTKCONFIG=$ac_cv_path_FLTKCONFIG
+ fi
+-FLTKCONFIG=$ac_cv_path_FLTKCONFIG
+
+ if test -n "$FLTKCONFIG"; then
+ echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5
+@@ -4950,8 +4957,10 @@
+ INSTALL_GUIS=""
+ INSTALL_OSX=""
+
++if eval "test x$enable_fltk = xyes"; then
+ { echo "$as_me:$LINENO: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&5
+ echo "$as_me: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&2;}
++fi
+ else
+ CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}"
+ GUIS="setup uninst"
+diff -urN epm-3.7-old//deb.c epm-3.7/deb.c
+--- misc/epm-3.7/deb.c 2003-01-15 14:29:24.000000000 +0000
++++ misc/build/epm-3.7/deb.c 2010-04-19 22:53:34.000000000 +0000
+@@ -26,6 +26,28 @@
+
+ #include "epm.h"
+
++/*
++ * 'add_size()' - Append Installed-Size tag to DEBIAN/control file
++ */
++
++int /* O - 0 = success, 1 = fail */
++add_size(FILE *fpControl, /* Control file stream */
++ const char *directory) /* Directory containing all files to package */
++{
++ FILE *fp;
++ char command[1024];
++
++ snprintf(command, sizeof(command), "du -k -s %s", directory);
++ fp = popen(command, "r");
++ if( NULL != fp )
++ {
++ char size[1024];
++ fscanf(fp, "%s .", size);
++ fprintf(fpControl, "Installed-Size: %s\n", size);
++ return pclose(fp);
++ }
++ return 1;
++}
+
+ /*
+ * 'make_deb()' - Make a Debian software distribution package.
+@@ -61,18 +83,37 @@
+ if (Verbosity)
+ puts("Creating Debian distribution...");
+
++ /*
++ * Use debian default naming scheme
++ */
++
++ if (!strcmp(platform->machine, "intel"))
++#ifdef __FreeBSD_kernel__
++ platname = "kfreebsd-i386";
++#else
++ platname = "i386";
++#endif
++ else if (!strcmp(platform->machine, "x86_64"))
++#ifdef __FreeBSD_kernel__
++ platname = "kfreebsd-amd64";
++#else
++ platname = "amd64";
++#endif
++ else if (!strcmp(platform->machine, "ppc"))
++ platname = "powerpc";
++
+ if (dist->relnumber)
+ {
+ if (platname[0])
+- snprintf(name, sizeof(name), "%s-%s-%d-%s", prodname, dist->version, dist->relnumber,
++ snprintf(name, sizeof(name), "%s_%s-%d_%s", prodname, dist->version, dist->relnumber,
+ platname);
+ else
+- snprintf(name, sizeof(name), "%s-%s-%d", prodname, dist->version, dist->relnumber);
++ snprintf(name, sizeof(name), "%s_%s-%d", prodname, dist->version, dist->relnumber);
+ }
+ else if (platname[0])
+- snprintf(name, sizeof(name), "%s-%s-%s", prodname, dist->version, platname);
++ snprintf(name, sizeof(name), "%s_%s_%s", prodname, dist->version, platname);
+ else
+- snprintf(name, sizeof(name), "%s-%s", prodname, dist->version);
++ snprintf(name, sizeof(name), "%s_%s", prodname, dist->version);
+
+ /*
+ * Write the control file for DPKG...
+@@ -108,8 +141,20 @@
+ * (which we change in get_platform to a common name)
+ */
+
+- if (strcmp(platform->machine, "intel") == 0)
++ if (!strcmp(platform->machine, "intel"))
++#ifdef __FreeBSD_kernel__
++ fputs("Architecture: kfreebsd-i386\n", fp);
++#else
+ fputs("Architecture: i386\n", fp);
++#endif
++ else if (!strcmp(platform->machine, "x86_64"))
++#ifdef __FreeBSD_kernel__
++ fputs("Architecture: kfreebsd-amd64\n", fp);
++#else
++ fputs("Architecture: amd64\n", fp);
++#endif
++ else if (!strcmp(platform->machine, "ppc"))
++ fputs("Architecture: powerpc\n", fp);
+ else
+ fprintf(fp, "Architecture: %s\n", platform->machine);
+
+@@ -139,7 +192,7 @@
+ else
+ {
+ if (d->vernumber[1] < INT_MAX)
+- fprintf(fp, " (>= %s, <= %s)", d->version[0], d->version[1]);
++ fprintf(fp, " (>= %s), %s (<= %s)", d->version[0], d->product, d->version[1]);
+ else
+ fprintf(fp, " (>= %s)", d->version[0]);
+ }
+@@ -148,9 +193,9 @@
+ putc('\n', fp);
+ }
+ }
+-
++
+ fclose(fp);
+-
++
+ /*
+ * Write the preinst file for DPKG...
+ */
+@@ -417,6 +462,27 @@
+ }
+ }
+
++
++ /*
++ * Calculate and append Installed-Size to DEBIAN/control
++ */
++
++ if (Verbosity)
++ puts("Calculating Installed-Size...");
++
++ snprintf(filename, sizeof(filename), "%s/%s/DEBIAN/control", directory, name);
++ if ((fp = fopen(filename, "a")) == NULL)
++ {
++ fprintf(stderr, "epm: Unable to Installed-Size to file \"%s\" - %s\n", filename,
++ strerror(errno));
++ return (1);
++ }
++
++ snprintf(filename, sizeof(filename), "%s/%s", directory, name);
++ add_size(fp, filename);
++ fclose(fp);
++
++
+ /*
+ * Build the distribution from the spec file...
+ */
+diff -urN epm-3.7-old//dist.c epm-3.7/dist.c
+--- misc/epm-3.7/dist.c 2003-08-07 14:14:40.000000000 +0000
++++ misc/build/epm-3.7/dist.c 2010-04-19 22:52:32.000000000 +0000
+@@ -394,8 +394,13 @@
+ strcpy(platform->machine, "mips");
+ #elif defined(__hpux)
+ strcpy(platform->machine, "hppa");
+-#elif defined(_AIX) || defined(__APPLE__)
++#elif defined(_AIX)
+ strcpy(platform->machine, "powerpc");
++#elif defined(__APPLE__)
++ if (strstr(platform->machine, "86") != NULL)
++ strcpy(platform->machine, "intel");
++ else
++ strcpy(platform->machine, "powerpc");
+ #else
+ for (temp = platform->machine; *temp != '\0'; temp ++)
+ if (*temp == '-' || *temp == '_')
+@@ -407,7 +412,12 @@
+ *temp = tolower(*temp);
+
+ if (strstr(platform->machine, "86") != NULL)
+- strcpy(platform->machine, "intel");
++ {
++ if (strstr(platform->machine, "64") != NULL)
++ strcpy(platform->machine, "x86_64");
++ else
++ strcpy(platform->machine, "intel");
++ }
+ else if (strncmp(platform->machine, "sun", 3) == 0)
+ strcpy(platform->machine, "sparc");
+ #endif /* __sgi */
+diff -urN epm-3.7-old//epm.c epm-3.7/epm.c
+--- misc/epm-3.7/epm.c 2003-10-28 14:48:30.000000000 +0000
++++ misc/build/epm-3.7/epm.c 2010-04-19 22:52:32.000000000 +0000
+@@ -547,6 +547,7 @@
+ {
+ puts(EPM_VERSION);
+ puts("Copyright 1999-2003 by Easy Software Products.");
++ puts("Patched for OpenOffice.org");
+ puts("");
+ puts("EPM is free software and comes with ABSOLUTELY NO WARRANTY; for details");
+ puts("see the GNU General Public License in the file COPYING or at");
+diff -urN epm-3.7-old//file.c epm-3.7/file.c
+--- misc/epm-3.7/file.c 2003-07-23 21:41:08.000000000 +0000
++++ misc/build/epm-3.7/file.c 2010-04-19 22:52:32.000000000 +0000
+@@ -108,7 +108,6 @@
+ fclose(dstfile);
+
+ chmod(dst, mode);
+- chown(dst, owner, group);
+
+ return (0);
+ }
+@@ -138,7 +137,6 @@
+ {
+ mkdir(buffer, 0777);
+ chmod(buffer, mode | 0700);
+- chown(buffer, owner, group);
+ }
+ }
+
+@@ -151,7 +149,6 @@
+ {
+ mkdir(buffer, 0777);
+ chmod(buffer, mode | 0700);
+- chown(buffer, owner, group);
+ }
+
+ return (0);
+diff -urN epm-3.7-old//osx.c epm-3.7/osx.c
+--- misc/epm-3.7/osx.c 2003-07-23 21:41:08.000000000 +0000
++++ misc/build/epm-3.7/osx.c 2010-04-19 22:52:32.000000000 +0000
+@@ -373,7 +373,7 @@
+ else
+ snprintf(filename, sizeof(filename), "%s/%s", current, directory);
+
+- run_command(NULL, "/Developer/Applications/PackageMaker.app/"
++ run_command(NULL, "/Developer/Applications/Utilities/PackageMaker.app/"
+ "Contents/MacOS/PackageMaker -build "
+ "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist",
+ filename, prodname, filename, filename, filename, prodname, filename, prodname);
+diff -urN epm-3.7-old//pkg.c epm-3.7/pkg.c
+--- misc/epm-3.7/pkg.c 2002-12-17 18:57:56.000000000 +0000
++++ misc/build/epm-3.7/pkg.c 2010-04-19 22:52:32.000000000 +0000
+@@ -429,75 +429,6 @@
+
+ fclose(fp);
+
+- /*
+- * Build the distribution from the prototype file...
+- */
+-
+- if (Verbosity)
+- puts("Building PKG binary distribution...");
+-
+- if (run_command(NULL, "pkgmk -o -f %s/%s.prototype -d %s/%s",
+- directory, prodname, current, directory))
+- return (1);
+-
+- /*
+- * Tar and compress the distribution...
+- */
+-
+- if (Verbosity)
+- puts("Creating tar.gz file for distribution...");
+-
+- snprintf(filename, sizeof(filename), "%s/%s.tar.gz", directory, name);
+-
+- if ((tarfile = tar_open(filename, 1)) == NULL)
+- return (1);
+-
+- snprintf(filename, sizeof(filename), "%s/%s", directory, prodname);
+-
+- if (tar_directory(tarfile, filename, prodname))
+- {
+- tar_close(tarfile);
+- return (1);
+- }
+-
+- tar_close(tarfile);
+-
+- /*
+- * Make a package stream file...
+- */
+-
+- if (Verbosity)
+- puts("Copying into package stream file...");
+-
+- if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s",
+- current, directory, name, prodname))
+- return (1);
+-
+- /*
+- * Remove temporary files...
+- */
+-
+- if (!KeepFiles)
+- {
+- if (Verbosity)
+- puts("Removing temporary distribution files...");
+-
+- snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname);
+- unlink(filename);
+- snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname);
+- unlink(filename);
+- snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname);
+- unlink(filename);
+- if (preinstall[0])
+- unlink(preinstall);
+- if (postinstall[0])
+- unlink(postinstall);
+- if (preremove[0])
+- unlink(preremove);
+- if (postremove[0])
+- unlink(postremove);
+- }
+-
+ return (0);
+ }
+
+diff -urN epm-3.7-old//qprintf.c epm-3.7/qprintf.c
+--- misc/epm-3.7-old/qprintf.c 2003-01-27 21:48:03.000000000 +0000
++++ misc/build/epm-3.7/qprintf.c 2010-04-19 22:52:32.000000000 +0000
+@@ -181,12 +181,19 @@
+
+ for (i = slen; i > 0; i --, s ++, bytes ++)
+ {
++#if defined(__FreeBSD__)
++ if (strchr("`~!#%^&*()[{]}\\|;\'\"<>? ", *s))
++ {
++ putc('\\', fp);
++ bytes ++;
++ }
++#else
+ if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s))
+ {
+ putc('\\', fp);
+ bytes ++;
+ }
+-
++#endif
+ putc(*s, fp);
+ }
+
+diff -urN epm-3.7-old//rpm.c epm-3.7/rpm.c
+--- misc/epm-3.7/rpm.c 2003-10-01 19:27:15.000000000 +0000
++++ misc/build/epm-3.7/rpm.c 2010-04-19 22:52:32.000000000 +0000
+@@ -38,7 +38,7 @@
+ dist_t *dist, /* I - Distribution information */
+ struct utsname *platform) /* I - Platform information */
+ {
+- int i; /* Looping var */
++ int i,n; /* Looping vars */
+ FILE *fp; /* Spec file */
+ char name[1024]; /* Full product name */
+ char specname[1024]; /* Spec filename */
+@@ -160,6 +160,8 @@
+ fprintf(fp, "Requires: %s", dname);
+ else if (d->type == DEPEND_PROVIDES)
+ fprintf(fp, "Provides: %s", dname);
++ else if (d->type == DEPEND_REPLACES)
++ fprintf(fp, "Obsoletes: %s", dname);
+ else
+ fprintf(fp, "Conflicts: %s", dname);
+
+@@ -186,15 +188,33 @@
+ for (i = 0; i < dist->num_descriptions; i ++)
+ fprintf(fp, "%s\n", dist->descriptions[i]);
+
+- fputs("%pre\n", fp);
++ /*
++ * %pre
++ */
++ n = 0;
+ for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
++ {
+ if (c->type == COMMAND_PRE_INSTALL)
++ {
++ if (1 == ++n) /* Only write %pre if there is at least one command */
++ fputs("%pre\n", fp);
+ fprintf(fp, "%s\n", c->command);
++ }
++ }
+
+- fputs("%post\n", fp);
++ /*
++ * %post
++ */
++ n = 0;
+ for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
++ {
+ if (c->type == COMMAND_POST_INSTALL)
++ {
++ if (1 == ++n) /* Only write %post if there is at least one command */
++ fputs("%post\n", fp);
+ fprintf(fp, "%s\n", c->command);
++ }
++ }
+
+ for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
+ if (tolower(file->type) == 'i')
+@@ -202,6 +222,8 @@
+
+ if (i)
+ {
++ if (1 == ++n) /* If not previously done so, write %post here */
++ fputs("%post\n", fp);
+ fputs("if test \"x$1\" = x1; then\n", fp);
+ fputs(" echo Setting up init scripts...\n", fp);
+
+@@ -259,13 +281,17 @@
+ fputs("fi\n", fp);
+ }
+
+- fputs("%preun\n", fp);
++ /*
++ * %preun
++ */
++ n = 0;
+ for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
+ if (tolower(file->type) == 'i')
+ break;
+
+ if (i)
+ {
++ fputs("%preun\n", fp); ++n; /* Need to write %preun here */
+ fputs("if test \"x$1\" = x0; then\n", fp);
+ fputs(" echo Cleaning up init scripts...\n", fp);
+
+@@ -315,13 +341,29 @@
+ }
+
+ for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
++ {
+ if (c->type == COMMAND_PRE_REMOVE)
++ {
++ if (1 == ++n) /* Only write %preun if not previously done so */
++ fputs("%preun\n", fp);
++
+ fprintf(fp, "%s\n", c->command);
++ }
++ }
+
+- fputs("%postun\n", fp);
++ /*
++ * %post
++ */
++ n = 0;
+ for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++)
++ {
+ if (c->type == COMMAND_POST_REMOVE)
++ {
++ if (1 == ++n) /* Only write %post if there is at least one command */
++ fputs("%postun\n", fp);
+ fprintf(fp, "%s\n", c->command);
++ }
++ }
+
+ fputs("%files\n", fp);
+ for (i = dist->num_files, file = dist->files; i > 0; i --, file ++)
+@@ -415,53 +457,6 @@
+ }
+ }
+
+- /*
+- * Build the distribution from the spec file...
+- */
+-
+- if (Verbosity)
+- puts("Building RPM binary distribution...");
+-
+- if (strcmp(platform->machine, "intel") == 0)
+- {
+- if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "i386 %s",
+- Verbosity == 0 ? "--quiet" : "", specname))
+- return (1);
+- }
+- else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s",
+- Verbosity == 0 ? "--quiet" : "", platform->machine,
+- specname))
+- return (1);
+-
+- /*
+- * Move the RPM to the local directory and rename the RPM using the
+- * product name specified by the user...
+- */
+-
+- if (strcmp(platform->machine, "intel") == 0)
+- run_command(NULL, "/bin/mv %s/RPMS/i386/%s-%s-%d.i386.rpm %s/%s.rpm",
+- rpmdir, prodname, dist->version, dist->relnumber,
+- directory, name);
+- else
+- run_command(NULL, "/bin/mv %s/RPMS/%s/%s-%s-%d.%s.rpm %s/%s.rpm",
+- rpmdir, platform->machine, prodname, dist->version,
+- dist->relnumber, platform->machine, directory, name);
+-
+- /*
+- * Remove temporary files...
+- */
+-
+- if (!KeepFiles)
+- {
+- if (Verbosity)
+- puts("Removing temporary distribution files...");
+-
+- run_command(NULL, "/bin/rm -rf %s/RPMS", directory);
+- run_command(NULL, "/bin/rm -rf %s/buildroot", directory);
+-
+- unlink(specname);
+- }
+-
+ return (0);
+ }
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,expat))
+
+$(eval $(call gb_ExternalProject_register_targets,expat,\
+ configure \
+))
+
+$(call gb_ExternalProject_get_state_target,expat,configure) :
+ $(call gb_ExternalProject_run,configure,\
+ ./configure \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ ,,expat_configure.log)
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,expat))
+
+$(eval $(call gb_Module_add_targets,expat,\
+ UnpackedTarball_expat \
+ StaticLibrary_expat \
+))
+
+# Actually it wasn't that clear if we should
+# run configure step on mingw or not:
+# CONFIGURATION_ACTION wasn't set, but
+# CROSS_COMPILE case was handled in original makefile
+
+# tested it on mingw and it doesn't hurt ;-)
+#ifneq ($(OS),WNT)
+ifneq ($(OS)$(COM),WNTMSC)
+$(eval $(call gb_Module_add_targets,expat,\
+ ExternalProject_expat \
+))
+endif
+
+# ---------------- X64 stuff special ---------------------
+ifeq ($(BUILD_X64),TRUE)
+$(eval $(call gb_Module_add_targets,expat,\
+ StaticLibrary_expat_x64 \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Simple SAX parser library with added UTF-16 support.
+
+From:
+[http://expat.sourceforge.net/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,expat))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,expat))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,expat,expat))
+
+# no configure step on windows, no dependency
+ifneq ($(OS)$(COM),WNTMSC)
+$(eval $(call gb_StaticLibrary_use_external_project,expat,expat))
+endif
+
+$(eval $(call gb_StaticLibrary_set_include,expat,\
+ -I$(call gb_UnpackedTarball_get_dir,expat) \
+ $$(INCLUDE) \
+))
+
+ifeq ($(OS),MACOSX)
+ifneq ($(strip $(SYSBASE)),)
+$(eval $(call gb_StaticLibrary_add_defs,expat,\
+ -DHAVE_MEMMOVE \
+ -DHAVE_BCOPY \
+))
+endif
+endif
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_defs,expat,\
+ -DCOMPILED_FROM_DSP \
+))
+else
+$(eval $(call gb_StaticLibrary_add_defs,expat,\
+ -DHAVE_EXPAT_CONFIG_H \
+))
+endif
+
+# suppress warning spam
+$(eval $(call gb_StaticLibrary_add_cflags,expat,\
+ -w \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,expat,\
+ UnpackedTarball/expat/lib/xmlparse \
+ UnpackedTarball/expat/lib/xmlrole \
+ UnpackedTarball/expat/lib/xmltok \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,expat_x64))
+
+$(eval $(call gb_StaticLibrary_set_x64,expat_x64,YES))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,expat_x64))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,expat_x64,expat))
+
+$(eval $(call gb_StaticLibrary_set_include,expat_x64,\
+ -I$(call gb_UnpackedTarball_get_dir,expat) \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_defs,expat_x64,\
+ -DCOMPILED_FROM_DSP \
+))
+
+$(eval $(call gb_StaticLibrary_add_x64_generated_cobjects,expat_x64,\
+ UnpackedTarball/expat/lib/xmlparse_x64 \
+ UnpackedTarball/expat/lib/xmltok_x64 \
+ UnpackedTarball/expat/lib/xmlrole_x64 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,expat))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,expat,$(EXPAT_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,expat,\
+ external/expat/expat-2.1.0.patch \
+))
+
+# This is a bit hackish.
+
+# When building for Windows (as 32-bit) we need to build it twice: as
+# 32- and 64-bit code, to be able to produce a 64-bit Explorer
+# ("shell") extension that is used when the 32-bit LibreOffice is
+# installed on a 64-bit OS.
+
+$(eval $(call gb_UnpackedTarball_set_post_action,expat,\
+ $(if $(filter $(BUILD_X64),TRUE), \
+ cp lib/xmlparse.c lib/xmlparse_x64.c && \
+ cp lib/xmltok.c lib/xmltok_x64.c && \
+ cp lib/xmlrole.c lib/xmlrole_x64.c) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:17.375000000 +0000
++++ misc/build/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:34.703125000 +0000
+@@ -7,10 +7,6 @@
+
+ /* External API definitions */
+
+-#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
+-#define XML_USE_MSC_EXTENSIONS 1
+-#endif
+-
+ /* Expat tries very hard to make the API boundary very specifically
+ defined. There are two macros defined to control this boundary;
+ each of these can be defined before including this header to
--- /dev/null
+--- misc/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:17.375000000 +0000
++++ misc/build/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:34.703125000 +0000
+@@ -7,10 +7,6 @@
+
+ /* External API definitions */
+
+-#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
+-#define XML_USE_MSC_EXTENSIONS 1
+-#endif
+-
+ /* Expat tries very hard to make the API boundary very specifically
+ defined. There are two macros defined to control this boundary;
+ each of these can be defined before including this header to
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,firebird,firebird))
+
+$(eval $(call gb_ExternalPackage_use_external_project,firebird,firebird))
+
+ifeq ($(OS)-$(COM),WNT-MSC)
+$(eval $(call gb_ExternalPackage_add_file,firebird,$(LIBO_LIB_FOLDER)/ifbembed.dll,gen/firebird/bin/ifbembed.dll))
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,firebird,$(LIBO_LIB_FOLDER)/libfbembed.dylib,gen/firebird/lib/libfbembed.dylib.2.5.2))
+else
+$(eval $(call gb_ExternalPackage_add_file,firebird,$(LIBO_LIB_FOLDER)/libfbembed.so.2.5,gen/firebird/lib/libfbembed.so.2.5.2))
+endif
+
+$(eval $(call gb_ExternalPackage_add_file,firebird,$(LIBO_SHARE_FOLDER)/firebird/firebird.msg,gen/firebird/firebird.msg))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,firebird))
+
+$(eval $(call gb_ExternalProject_use_autoconf,firebird,build))
+
+$(eval $(call gb_ExternalProject_use_externals,firebird,\
+ boost_headers \
+ icu \
+ libatomic_ops \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,firebird,\
+ build \
+))
+
+# note: this can intentionally only build against internal atomic_op
+# note: this can intentionally only build against internal tommath
+
+# do not set LDFLAGS - it is mysteriously not used by firebird on MacOSX
+$(call gb_ExternalProject_get_state_target,firebird,build):
+ $(call gb_ExternalProject_run,build,\
+ unset MAKEFLAGS \
+ && export PKG_CONFIG="" \
+ && export CPPFLAGS=" \
+ $(if $(SYSTEM_LIBATOMIC_OPS),$(LIBATOMIC_OPS_CFLAGS), \
+ -I$(call gb_UnpackedTarball_get_dir,libatomic_ops)/src \
+ ) \
+ " \
+ && export CXXFLAGS=" \
+ $(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS), \
+ -I$(call gb_UnpackedTarball_get_dir,boost) \
+ -L$(call gb_UnpackedTarball_get_dir,boost)/source/lib \
+ ) \
+ $(if $(SYSTEM_ICU),$(ICU_CPPFLAGS), \
+ -I$(call gb_UnpackedTarball_get_dir,icu)/source \
+ -I$(call gb_UnpackedTarball_get_dir,icu)/source/i18n \
+ -I$(call gb_UnpackedTarball_get_dir,icu)/source/common \
+ -L$(call gb_UnpackedTarball_get_dir,icu)/source/lib \
+ ) \
+ " \
+ && ./configure \
+ --without-editline \
+ --disable-superserver \
+ --with-system-icu --without-fbsample --without-fbsample-db \
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter IOS ANDROID,$(OS)),--disable-shared,--disable-static) \
+ && $(if $(filter WNT,$(OS)),\
+ PATH="$(shell cygpath -u $(call gb_UnpackedTarball_get_dir,icu)/source/lib):$$PATH",\
+ $(gb_Helper_set_ld_path)) \
+ $(MAKE) firebird_embedded \
+ $(if $(filter MACOSX,$(OS)),&& $(PERL) \
+ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(gb_Package_SOURCEDIR_firebird)/gen/firebird/lib/libfbembed.dylib.2.5.2) \
+ )
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,firebird))
+
+$(eval $(call gb_Module_add_targets,firebird,\
+ ExternalPackage_firebird \
+ ExternalProject_firebird \
+ UnpackedTarball_firebird \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,firebird))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,firebird,$(FIREBIRD_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,firebird,\
+ external/firebird/firebird-icu.patch.1 \
+ external/firebird/firebird-rpath.patch.0 \
+ external/firebird/firebird-c++11.patch.1 \
+ external/firebird/firebird-c++11replfn.patch.0 \
+))
+
+ifeq ($(OS)-$(COM),WNT-MSC)
+$(eval $(call gb_UnpackedTarball_add_patches,firebird,\
+ external/firebird/firebird-cygwin-msvc.patch.1 \
+))
+endif
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_UnpackedTarball_add_patches,firebird,\
+ external/firebird/firebird-macosx.patch.1 \
+))
+endif
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: Diff -*-
+--- firebird/src/gpre/c_cxx.cpp
++++ firebird/src/gpre/c_cxx.cpp
+@@ -876,7 +876,7 @@
+ if (based_on->bas_flags & BAS_segment)
+ {
+ if (*variable != '*')
+- fprintf(gpreGlob.out_file, "[%"SLONGFORMAT"]", length);
++ fprintf(gpreGlob.out_file, "[%" SLONGFORMAT "]", length);
+ }
+ else if (field->fld_array_info)
+ {
+@@ -885,7 +885,7 @@
+ for (const dim* dimension = field->fld_array_info->ary_dimension;
+ dimension; dimension = dimension->dim_next)
+ {
+- fprintf(gpreGlob.out_file, " [%"SLONGFORMAT"]", dimension->dim_upper - dimension->dim_lower + 1);
++ fprintf(gpreGlob.out_file, " [%" SLONGFORMAT "]", dimension->dim_upper - dimension->dim_lower + 1);
+ }
+
+ if (field->fld_array_info->ary_dtype <= dtype_varying && field->fld_length > 1)
+@@ -1577,7 +1577,7 @@
+ const gpre_dbb* db = (gpre_dbb*) action->act_object;
+ align(column);
+
+- fprintf(gpreGlob.out_file, "isc_drop_database (%s, %"SIZEFORMAT", \"%s\", rdb$k_db_type_gds);",
++ fprintf(gpreGlob.out_file, "isc_drop_database (%s, %" SIZEFORMAT ", \"%s\", rdb$k_db_type_gds);",
+ status_vector(action),
+ strlen(db->dbb_filename), db->dbb_filename);
+ set_sqlcode(action, column);
+@@ -3471,7 +3471,7 @@
+
+ static void gen_type( const act* action, int column)
+ {
+- printa(column, "%"SLONGFORMAT, (SLONG)(IPTR)action->act_object);
++ printa(column, "%" SLONGFORMAT, (SLONG)(IPTR)action->act_object);
+ }
+
+
+@@ -3623,7 +3623,7 @@
+ for (const dim* dimension = field->fld_array_info->ary_dimension; dimension;
+ dimension = dimension->dim_next)
+ {
+- fprintf(gpreGlob.out_file, " [%"SLONGFORMAT"]", dimension->dim_upper - dimension->dim_lower + 1);
++ fprintf(gpreGlob.out_file, " [%" SLONGFORMAT "]", dimension->dim_upper - dimension->dim_lower + 1);
+ }
+
+ if (field->fld_array_info->ary_dtype <= dtype_varying)
+--- firebird/src/gpre/exp.cpp
++++ firebird/src/gpre/exp.cpp
+@@ -398,7 +398,7 @@
+ if (gpreGlob.token_global.tok_type != tok_number)
+ CPR_s_error("<number>");
+
+- const char format[8] = "%"SQUADFORMAT;
++ const char format[8] = "%" SQUADFORMAT;
+ SINT64 n;
+ sscanf(gpreGlob.token_global.tok_string, format, &n);
+
+@@ -428,7 +428,7 @@
+
+ const SLONG n = atoi(gpreGlob.token_global.tok_string);
+ char buffer[32];
+- sprintf(buffer, "%"SLONGFORMAT, n);
++ sprintf(buffer, "%" SLONGFORMAT, n);
+ if (strcmp(buffer, gpreGlob.token_global.tok_string) != 0)
+ PAR_error("Numeric value out of range");
+
+@@ -478,7 +478,7 @@
+
+ const ULONG n = atoi(gpreGlob.token_global.tok_string);
+ char buffer[32];
+- sprintf(buffer, "%"ULONGFORMAT, n);
++ sprintf(buffer, "%" ULONGFORMAT, n);
+ if (strcmp(buffer, gpreGlob.token_global.tok_string) != 0)
+ PAR_error("Numeric value out of range");
+
+--- firebird/src/gpre/gpre.cpp
++++ firebird/src/gpre/gpre.cpp
+@@ -2525,9 +2525,9 @@
+ if (line_pending)
+ {
+ if (line == 1)
+- fprintf(gpreGlob.out_file, "#line %"SLONGFORMAT" \"%s\"\n", line, backlash_fixed_file_name);
++ fprintf(gpreGlob.out_file, "#line %" SLONGFORMAT " \"%s\"\n", line, backlash_fixed_file_name);
+ else
+- fprintf(gpreGlob.out_file, "\n#line %"SLONGFORMAT" \"%s\"", line, backlash_fixed_file_name);
++ fprintf(gpreGlob.out_file, "\n#line %" SLONGFORMAT " \"%s\"", line, backlash_fixed_file_name);
+
+ line_pending = false;
+ }
+@@ -2668,7 +2668,7 @@
+ {
+ if (c == '\n' && line_pending)
+ {
+- fprintf(gpreGlob.out_file, "\n#line %"SLONGFORMAT" \"%s\"", line + 1, backlash_fixed_file_name);
++ fprintf(gpreGlob.out_file, "\n#line %" SLONGFORMAT " \"%s\"", line + 1, backlash_fixed_file_name);
+ line_pending = false;
+ }
+ if (c == EOF)
+--- firebird/src/gpre/int_cxx.cpp
++++ firebird/src/gpre/int_cxx.cpp
+@@ -290,7 +290,7 @@
+ fprintf(gpreGlob.out_file, "if (!%s)", request->req_handle);
+ align(column);
+ fprintf(gpreGlob.out_file,
+- "%s = CMP_compile2 (tdbb, (UCHAR*) jrd_%"ULONGFORMAT", sizeof(jrd_%"ULONGFORMAT"), true);",
++ "%s = CMP_compile2 (tdbb, (UCHAR*) jrd_%" ULONGFORMAT ", sizeof(jrd_%" ULONGFORMAT "), true);",
+ request->req_handle, request->req_ident, request->req_ident);
+ }
+
+@@ -478,7 +478,7 @@
+ {
+
+ fprintf(gpreGlob.out_file,
+- "EXE_receive (tdbb, %s, %d, %d, (UCHAR*) &jrd_%"ULONGFORMAT");",
++ "EXE_receive (tdbb, %s, %d, %d, (UCHAR*) &jrd_%" ULONGFORMAT ");",
+ request->req_handle, port->por_msg_number, port->por_length,
+ port->por_ident);
+ }
+@@ -495,7 +495,7 @@
+ if (!(request->req_flags & REQ_exp_hand))
+ fprintf(gpreGlob.out_file, "static void\t*%s;\t// request handle \n", request->req_handle);
+
+- fprintf(gpreGlob.out_file, "static const UCHAR\tjrd_%"ULONGFORMAT" [%d] =",
++ fprintf(gpreGlob.out_file, "static const UCHAR\tjrd_%" ULONGFORMAT " [%d] =",
+ request->req_ident, request->req_length);
+ align(INDENT);
+ fprintf(gpreGlob.out_file, "{\t// blr string \n");
+@@ -588,7 +588,7 @@
+ }
+ align(column);
+
+- fprintf(gpreGlob.out_file, "EXE_send (tdbb, %s, %d, %d, (UCHAR*) &jrd_%"ULONGFORMAT");",
++ fprintf(gpreGlob.out_file, "EXE_send (tdbb, %s, %d, %d, (UCHAR*) &jrd_%" ULONGFORMAT ");",
+ request->req_handle, port->por_msg_number, port->por_length, port->por_ident);
+ }
+
+@@ -716,7 +716,7 @@
+ fprintf(gpreGlob.out_file, fmtstr, reference->ref_ident, name);
+ }
+ align(column);
+- fprintf(gpreGlob.out_file, "} jrd_%"ULONGFORMAT";", port->por_ident);
++ fprintf(gpreGlob.out_file, "} jrd_%" ULONGFORMAT ";", port->por_ident);
+ }
+
+
+--- firebird/src/gpre/pat.cpp
++++ firebird/src/gpre/pat.cpp
+@@ -417,7 +417,7 @@
+ }
+ }
+ else if (long_flag) {
+- sprintf(p, "%"SLONGFORMAT, long_value);
++ sprintf(p, "%" SLONGFORMAT , long_value);
+ }
+ else {
+ sprintf(p, "%d", value);
+--- firebird/src/common/classes/alloc.cpp
++++ firebird/src/common/classes/alloc.cpp
+@@ -1100,7 +1100,7 @@
+ if (blk->mbk_flags & MBK_LAST)
+ break;
+ }
+- fprintf(file, "Blocks %"SIZEFORMAT" min %"SIZEFORMAT" max %"SIZEFORMAT" size %"SIZEFORMAT" \n\n",
++ fprintf(file, "Blocks %" SIZEFORMAT " min %" SIZEFORMAT " max %" SIZEFORMAT " size %" SIZEFORMAT " \n\n",
+ cnt, min, max, sum);
+ }
+
+@@ -1303,7 +1303,7 @@
+ FreeMemoryBlock* freeBlock = blockToPtr<FreeMemoryBlock*>(blk);
+ freeBlock->fbk_next_fragment = NULL;
+
+- BlockInfo temp = {blockLength, freeBlock};
++ BlockInfo temp = {static_cast<size_t>(blockLength), freeBlock};
+ pool->freeBlocks.add(temp);
+ if (!pool->parent_redirect)
+ {
+--- firebird/src/common/cvt.cpp
++++ firebird/src/common/cvt.cpp
+@@ -144,7 +144,7 @@
+
+ #ifndef NATIVE_QUAD
+ #ifndef WORDS_BIGENDIAN
+-static const SQUAD quad_min_int = { 0, SLONG_MIN };
++static const SQUAD quad_min_int = { 0, static_cast<ULONG>(SLONG_MIN) };
+ static const SQUAD quad_max_int = { -1, SLONG_MAX };
+ #else
+ static const SQUAD quad_min_int = { SLONG_MIN, 0 };
+--- firebird/src/jrd/perf.cpp
++++ firebird/src/jrd/perf.cpp
+@@ -164,20 +164,20 @@
+ case 'b':
+ case 'c':
+ case 'x':
+- sprintf(p, "%"SQUADFORMAT, delta);
++ sprintf(p, "%" SQUADFORMAT , delta);
+ while (*p)
+ p++;
+ break;
+
+ case 'u':
+ case 's':
+- sprintf(p, "%"SQUADFORMAT".%.2"SQUADFORMAT, delta / TICK, (delta % TICK) * 100 / TICK);
++ sprintf(p, "%" SQUADFORMAT ".%.2" SQUADFORMAT , delta / TICK, (delta % TICK) * 100 / TICK);
+ while (*p)
+ p++;
+ break;
+
+ case 'e':
+- sprintf(p, "%"SQUADFORMAT".%.2"SQUADFORMAT, delta / 100, delta % 100);
++ sprintf(p, "%" SQUADFORMAT ".%.2" SQUADFORMAT , delta / 100, delta % 100);
+ while (*p)
+ p++;
+ break;
--- /dev/null
+--- src/common/classes/alloc.h
++++ src/common/classes/alloc.h
+@@ -489,23 +489,11 @@
+ inline static MemoryPool* getDefaultMemoryPool() { return Firebird::MemoryPool::processMemoryPool; }
+
+ // Global versions of operators new and delete
+-inline void* operator new(size_t s) THROW_BAD_ALLOC
+-{
+- return Firebird::MemoryPool::globalAlloc(s);
+-}
+-inline void* operator new[](size_t s) THROW_BAD_ALLOC
+-{
+- return Firebird::MemoryPool::globalAlloc(s);
+-}
++void* operator new(size_t s) THROW_BAD_ALLOC;
++void* operator new[](size_t s) THROW_BAD_ALLOC;
+
+-inline void operator delete(void* mem) throw()
+-{
+- Firebird::MemoryPool::globalFree(mem);
+-}
+-inline void operator delete[](void* mem) throw()
+-{
+- Firebird::MemoryPool::globalFree(mem);
+-}
++void operator delete(void* mem) throw();
++void operator delete[](void* mem) throw();
+
+ #ifdef DEBUG_GDS_ALLOC
+ inline void* operator new(size_t s, Firebird::MemoryPool& pool, const char* file, int line)
+--- src/common/classes/alloc.cpp
++++ src/common/classes/alloc.cpp
+@@ -2080,3 +2080,21 @@
+ #endif
+
+ } // namespace Firebird
++
++void* operator new(size_t s) THROW_BAD_ALLOC
++{
++ return Firebird::MemoryPool::globalAlloc(s);
++}
++void* operator new[](size_t s) THROW_BAD_ALLOC
++{
++ return Firebird::MemoryPool::globalAlloc(s);
++}
++
++void operator delete(void* mem) throw()
++{
++ Firebird::MemoryPool::globalFree(mem);
++}
++void operator delete[](void* mem) throw()
++{
++ Firebird::MemoryPool::globalFree(mem);
++}
--- /dev/null
+diff -u firebird/builds/posix/make.defaults firebird/builds/posix/make.defaults
+--- firebird/builds/posix/make.defaults 2013-07-03 16:23:44.804062000 +0100
++++ firebird/builds/posix/make.defaults 2013-07-05 12:30:01.607151400 +0100
+@@ -49,7 +49,11 @@
+
+ FIREBIRD=$(GEN_ROOT)/firebird
+ INTERBASE=$(FIREBIRD)
++ifeq (@PLATFORM@,win32)
++FIREBIRD_LOCK=$(shell cygpath -w $(shell cd $(FIREBIRD); pwd) )
++else
+ FIREBIRD_LOCK=$(shell cd $(FIREBIRD); pwd)
++endif
+
+ export INTERBASE
+ export FIREBIRD
+@@ -135,7 +139,11 @@
+ CD= cd
+ CAT= cat
+ AR= ar @AR_OPTIONS@ crsu
++ifeq (@PLATFORM@,win32)
++LN= cp
++else
+ LN= @LN_S@
++endif
+ RANLIB= @RANLIB@
+ BTYACC=$(ROOT)/extern/btyacc/btyacc
+
+@@ -152,16 +160,32 @@
+ STATICEXE_LINK:= @CXX@ $(GLOB_OPTIONS) $(CXXFLAGS)
+
+ LINK_LIBS = @LIBS@
++ifeq ($(PLATFORM),win32)
++ifeq ($(MSVC_USE_DEBUG_RUNTIME),TRUE)
++ICU_LIBS = -licuucd -licudtd -licuind
++else
++ICU_LIBS = -licuuc -licudt -licuin
++endif
++else
+ ICU_LIBS = -licuuc -licudata -licui18n
++endif
+ STATICLINK_LIBS = @LIBS@
+ SO_LINK_LIBS = @LIBS@
+
+ # Default extensions
+
++ifeq (@PLATFORM@,win32)
++ARCH_EXT= .lib
++else
+ ARCH_EXT= .a
++endif
+ EXEC_EXT= @EXEEXT@
+ SHRLIB_EXT=@SHRLIB_EXT@
++ifeq (@PLATFORM@,win32)
++LIB_PREFIX=
++else
+ LIB_PREFIX= lib
++endif
+ SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
+
+ #_____________________________________________________________________________
+@@ -179,6 +199,7 @@
+ vpath %.so $(LIB)
+ vpath %.a $(LIB)
+ vpath %.dll $(LIB)
++vpath %.lib $(LIB)
+
+ #_____________________________________________________________________________
+
+@@ -193,9 +214,9 @@
+ # Scold me, but I don't want library names to be in configure.in
+ #
+
+-SharedLibraryName=libfbembed.${SHRLIB_EXT}.${FirebirdVersion}
+-SharedLibrarySoName=libfbembed.${SHRLIB_EXT}.${MajorVer}.${MinorVer}
+-SharedLibraryBaseName=libfbembed.${SHRLIB_EXT}
++SharedLibraryName=ifbembed.${SHRLIB_EXT}
++SharedLibrarySoName=ifbembed.${SHRLIB_EXT}
++SharedLibraryBaseName=ifbembed.${SHRLIB_EXT}
+
+ LIBFBEMBED_SO = $(LIB)/$(SharedLibraryName)
+ LIBFBEMBED_SOBASENAME = $(LIB)/$(SharedLibrarySoName)
+@@ -219,7 +240,11 @@
+
+ LIBFBINTL_SO = $(FIREBIRD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
+
++ifeq ($(PLATFORM),win32)
++LIBFBSTATIC_A = $(LIB)/fbstatic.lib
++else
+ LIBFBSTATIC_A = $(LIB)/libfbstatic.a
++endif
+
+ ifeq ($(EDITLINE_FLG),Y)
+ ifeq ($(STD_EDITLINE), true)
+unchanged:
+--- firebird.org/builds/posix/make.shared.variables 2013-06-26 10:05:19.351343000 +0100
++++ firebird/builds/posix/make.shared.variables 2013-07-04 08:12:24.432879700 +0100
+@@ -291,7 +291,8 @@
+ OS_SPECIFIC_Sources += $(ROOT)/extern/binreloc/binreloc.c
+ endif
+ OS_SPECIFIC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(OS_SPECIFIC_Sources))))
+-
++#FBCOMMON_ClientFiles+=$(OS_SPECIFIC_Files)
++#FBCOMMON_Objects+=$(OS_SPECIFIC_Objects)
+
+ #________________________________________________________________________
+ #
+unchanged:
+--- firebird/builds/posix/Makefile.in.examples 2013-07-04 14:22:42.262676600 +0100
++++ firebird/builds/posix/Makefile.in.examples 2013-07-05 10:14:02.897675100 +0100
+@@ -64,10 +64,13 @@
+ EXAMPLES_DEST= $(GEN_ROOT)/examples
+ EXAMPLES_SRC= $(ROOT)/examples
+
+-
++ifeq ($(PLATFORM),win32)
++EMPBLD_Objects= $(EXAMPLES_DEST)/empbuild.obj
++INTLBLD_Objects= $(EXAMPLES_DEST)/intlbld.obj
++else
+ EMPBLD_Objects= $(EXAMPLES_DEST)/empbuild.o
+-
+ INTLBLD_Objects= $(EXAMPLES_DEST)/intlbld.o
++endif
+
+ INPUT_Files = empddl.sql empdml.sql indexoff.sql indexon.sql \
+ job.inp lang.inp proj.inp qtr.inp
+@@ -168,0 +180,3 @@
++
++$(EXAMPLES_DEST)/%.obj: $(EXAMPLES_DEST)/%.c
++ $(CC) -c $(firstword $<) -Fo$@ $(WCFLAGS)
+\ No newline at end of file
+unchanged:
+--- firebird.org/builds/posix/Makefile.in.extlib 2013-06-26 10:05:19.366787100 +0100
++++ firebird/builds/posix/Makefile.in.extlib 2013-07-04 12:31:37.591067100 +0100
+@@ -76,14 +76,20 @@
+ lib_ib_udf: $(LIBIBUTIL_SO) $(UDF)/ib_udf.$(SHRLIB_EXT)
+
+ $(UDF)/ib_udf.$(SHRLIB_EXT): $(UDF_Objects)
+- $(call LINK_UDF,ib_udf) -o $@ $^ $(LINK_UDF_LIBS)
++ @CXX@ $^ -o $@ -LD -L$(LIB) $(GLOB_OPTIONS) $(CXXFLAGS) -lib_util \
++ $(LINK_UDF_LIBS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,ib_udf.$(SHRLIB_EXT))\
++ $(call LIB_LINK_RPATH,lib) \
++ /link /dll
+
+ # ib_util
+
+ lib_ib_util: $(LIBIBUTIL_SO)
+
+ $(LIBIBUTIL_SO): $(UTIL_Objects)
+- $(LINK_IB_UTIL) -o $@ $^ $(LINK_IB_UTIL_LIBS)
++ @CXX@ $^ -o $@ -LD \
++ $(call LIB_LINK_RPATH,lib) $(GLOB_OPTIONS) $(CXXFLAGS) $(LINK_IBUTIL_SYMBOLS) \
++ $(LIB_LINK_OPTIONS) $(LINK_IB_UTIL_LIBS) $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) \
++ /link /dll
+
+ include $(ROOT)/gen/make.shared.targets
+
+unchanged:
+--- firebird.org/builds/posix/Makefile.in.firebird 2013-06-26 10:05:19.382231200 +0100
++++ firebird/builds/posix/Makefile.in.firebird 2013-07-04 18:36:17.079544900 +0100
+@@ -145,7 +145,8 @@
+
+ firebird : firebird_@FIREBIRD_ARCH_TYPE@ $(PLATFORM_POSTBUILD_TARGET)
+
+-firebird_classic firebird_embedded: firebird_basic classic_targets fbtrace
++firebird_classic firebird_embedded: firebird_basic classic_targets
++#fbtrace
+ firebird_super firebird_server: firebird_basic super_targets fbtrace
+
+
+@@ -301,7 +301,7 @@
+ .PHONY: ref_databases msgs msgs_intl generated_headers intl extlib includes
+
+ basic_targets: ref_databases msgs msgs_intl generated_headers \
+- intl extlib includes examples_cp
++ intl extlib includes
+
+ # hack to make code regeneration work
+ generated_headers :
+@@ -331,8 +336,9 @@
+ .PHONY: libfbembed inet_server fb_smp_server embed_gfix embed_gbak embed_isql
+ .PHONY: embed_gpre embed_util
+
+-classic_targets: $(PLAT_CLASSIC_PRE_TARGET) libfbembed inet_server fb_smp_server embed_gfix embed_gbak embed_isql \
+- embed_gpre libfbclient embed_util embed_gdef embed_qli embed_fbudf $(PLAT_CLASSIC_POST_TARGET)
++classic_targets: $(PLAT_CLASSIC_PRE_TARGET) libfbembed
++#inet_server fb_smp_server embed_gfix embed_gbak embed_isql \
++# embed_gpre libfbclient embed_util embed_gdef embed_qli embed_fbudf $(PLAT_CLASSIC_POST_TARGET)
+
+ libfbembed:
+ $(MAKE) $(CPU_OPTION) -f $(GEN_ROOT)/Makefile.libfbembed $@
+@@ -446,7 +452,7 @@
+ MAKE_HEADER_Bin = ./makeHeader
+
+ $(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
+- $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
++ $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin)$(EXEC_EXT) $(MAKE_HEADER_Src)
+ $(CP) $^ .
+ $(MAKE_HEADER_Bin) <ibase.h >$@
+ $(RM) -f ibase.h
+--- firebird.org/builds/posix/Makefile.in.intl 2013-06-26 10:05:19.382231200 +0100
++++ firebird/builds/posix/Makefile.in.intl 2013-07-04 12:26:09.029586700 +0100
+@@ -81,8 +81,13 @@
+ libfbintl : $(LIBFBINTL_SO)
+
+ $(LIBFBINTL_SO): $(INTL_Objects) $(FBCOMMON_ClientObjects) $(FBCLASSES_ClientObjects)
++ifeq (@PLATFORM@,win32)
++ @CXX@ $^ -o $@ -LD $(GLOB_OPTIONS) $(CXXFLAGS) $(LINK_INTL_LIBS)\
++ $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) -lfbstatic $(call LIB_LINK_SONAME,libintl.$(SHRLIB_EXT).1)\
++ $(call LIB_LINK_RPATH,lib) /link /dll
++else
+ $(LINK_INTL) -o $@ $^ $(LINK_INTL_LIBS)
+-
++endif
+
+ include $(ROOT)/gen/make.shared.targets
+
+diff -u firebird/builds/posix/Makefile.in.libfbembed firebird/builds/posix/Makefile.in.libfbembed
+--- firebird/builds/posix/Makefile.in.libfbembed 2013-07-04 17:51:37.197367500 +0100
++++ firebird/builds/posix/Makefile.in.libfbembed 2013-07-05 12:55:58.287451400 +0100
+@@ -62,13 +62,19 @@
+ libfbembed : $(LIBIBUTIL_SO) $(LIBFBEMBED_SONAME)
+
+ $(LIBFBEMBED_SO): $(LIBFBEMBED_Objects) $(SERVER_Objects) $(COMMON_Objects)
++ifeq ($(PLATFORM),win32)
++ @CXX@ $^ -o $@ $(LINK_EMBED_LIBS) $(GLOB_OPTIONS) $(CXXFLAGS)\
++ $(LINK_FIREBIRD_EMBED_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_EMBED_LINK_OPTIONS)\
++ $(call LIB_LINK_SONAME,$(SharedLibrarySoName)) $(call LIB_LINK_RPATH,lib)
++else
+ $(LINK_EMBED) -o $@ $^ $(LINK_EMBED_LIBS)
++endif
+
+ $(LIBFBEMBED_SOBASENAME): $(LIBFBEMBED_SO)
+- (cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) )
++# (cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) )
+
+ $(LIBFBEMBED_SONAME): $(LIBFBEMBED_SOBASENAME)
+- (cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) )
++# (cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) )
+
+ include $(ROOT)/gen/make.shared.targets
+
+unchanged:
+--- firebird.org/builds/posix/Makefile.in.libfbstatic 2013-06-26 10:05:19.382231200 +0100
++++ firebird/builds/posix/Makefile.in.libfbstatic 2013-07-03 16:23:14.103208000 +0100
+@@ -57,9 +57,9 @@
+ # will not be different from the above fbmem_boot.a library
+ # compile time macros being the main (if there) difference
+
+-libfbstatic: $(PARSE_Sources) $(LIB)/libfbstatic.a
++libfbstatic: $(PARSE_Sources) $(LIB)/$(LIB_PREFIX)fbstatic$(ARCH_EXT)
+
+-$(LIB)/libfbstatic.a: $(LIBFBSTATIC_Objects)
++$(LIB)/$(LIB_PREFIX)fbstatic$(ARCH_EXT): $(LIBFBSTATIC_Objects)
+ -$(RM) $@
+ $(AR) $@ $^
+ -$(RANLIB) $@
+unchanged:
+--- firebird.org/builds/posix/prefix.mingw 2013-06-26 10:05:19.413119400 +0100
++++ firebird/builds/posix/prefix.mingw 2013-07-04 18:13:52.948234400 +0100
+@@ -20,8 +20,8 @@
+ #
+
+ # -Wno-unused-variable is used due to unused gpre generated variables
+-PROD_FLAGS=-O2 -march=i586 -DMINGW -mno-cygwin -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
+-DEV_FLAGS=-ggdb -march=i586 -DMINGW -mno-cygwin -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
++PROD_FLAGS=-O2 -march=i586 -DMINGW -mno-cygwin -Wall -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
++DEV_FLAGS=-ggdb -march=i586 -DMINGW -mno-cygwin -Wall -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
+
+ PLATFORM_PATH=os/win32
+
+@@ -33,13 +33,15 @@
+ LIB_LINK=$(LD)
+
+ LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup
++LIB_PLATFORM_RPATH=
+
+ # Strip symbols from release versions to decrease size
+ ifeq ($(IsProdTypeBuild),Y)
+ LINK_OPTS+=-Wl,-s
+ LIB_LINK_OPTIONS+=-Wl,-s
+ endif
+-
++LIB_LINK_OPTIONS=
++LINK_OPTS=
+ # Generation of fbclient_ms.lib
+ LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib
+ LIB_GUI:= -mwindows -lcomctl32 -lgdi32
+@@ -65,7 +67,7 @@
+ ClientLibrarySoName := $(ClientLibraryName)
+
+ # Looks like MinGW 3 does not support version scripts but support def-files
+-LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def
++LINK_FIREBIRD_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/fbclient_s.def /def:$(BLD_ROOT)/win32/defs/fbclient.def
+
+ # This is required for newly built executable to find newly built shared
+ # libraries because on Win32 there is no such thing as LD_LIBRARY_PATH
+unchanged:
+--- firebird.org/configure 2013-06-26 10:05:19.675669100 +0100
++++ firebird/configure 2013-06-26 10:14:11.490867900 +0100
+@@ -2796,7 +2796,7 @@
+ SHRLIB_EXT=so
+ ;;
+
+- *-*-mingw*)
++ *-*-mingw* | *-*-cygwin*)
+ MAKEFILE_PREFIX=mingw
+ PLATFORM=win32
+
+@@ -8934,6 +8934,9 @@
+ mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
++cygwin*)
++ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++ ;;
+ esac
+
+ # If we're using GNU nm, then use its standard symbol codes.
+@@ -9882,7 +9885,7 @@
+ esac
+ ;;
+
+- mingw* | pw32* | os2*)
++ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+@@ -14675,7 +14678,7 @@
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+- mingw* | os2* | pw32*)
++ mingw* | cygwin* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+@@ -16452,7 +16455,7 @@
+ # PIC is the default for these OSes.
+ ;;
+
+- mingw* | pw32* | os2*)
++ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+@@ -16522,7 +16525,7 @@
+ esac
+ ;;
+
+- mingw* | pw32* | os2*)
++ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+@@ -19067,7 +19070,7 @@
+ # PIC is the default for these OSes.
+ ;;
+
+- mingw* | pw32* | os2*)
++ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+@@ -19137,7 +19140,7 @@
+ esac
+ ;;
+
+- mingw* | pw32* | os2*)
++ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+unchanged:
+--- firebird.org/configure.in 2013-06-26 10:05:19.675669100 +0100
++++ firebird/configure.in 2013-06-26 14:16:35.816845700 +0100
+@@ -1,30 +1,4 @@
+-dnl ############################# INITIALISATION ###############################
+-
+-AC_PREREQ(2.56)
+-AC_INIT(src)
+-
+-AC_CONFIG_AUX_DIR(builds/make.new/config)
+-AC_CACHE_VAL(ac_cv_prog_make_set, [AC_PROG_MAKE_SET])
+-AC_PREFIX_DEFAULT(/usr/local/firebird)
+-
+-m4_ifdef([AC_CONFIG_MACRO_DIR],
+- [],
+- [m4_define([AC_CONFIG_MACRO_DIR], [])])
+-AC_CONFIG_MACRO_DIR(m4)
+-
+-AC_CONFIG_HEADER(src/include/gen/autoconfig.h:builds/make.new/config/config.h.in)
+-
+-dnl XE_APPEND(value, varname)
+-define([XE_APPEND],[[$2]="$[$2] [$1]"])
+-
+-dnl XE_PREPEND(value, varname)
+-define([XE_PREPEND],[[$2]="[$1] $[$2]"])
+-
+-dnl XE_CONF_DIR(param, help, variable, default)
+-define([XE_CONF_DIR],[
+-AC_ARG_WITH([$1],
+- [AC_HELP_STRING([--with-$1], [$2])],
+- [[$3]="$withval"
++NO
+ AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
+ [[$3]="[`if test ""x$prefix"" = ""xNONE"" ; then echo ""$ac_default_prefix""; else echo ""$prefix""; fi`][$4]"
+ AC_DEFINE_UNQUOTED([$3], [""], [$2])]
+@@ -37,8 +11,8 @@
+
+ dnl ############################# ADD TESTS BELOW ##############################
+
+-AC_CANONICAL_SYSTEM
+-CPU_TYPE=$target_cpu
++AC_CANONICAL_HOST
++CPU_TYPE=$host_cpu
+ AC_SUBST(CPU_TYPE)
+
+
+@@ -61,7 +35,7 @@
+ dnl Test for special ar options?
+ AR_OPT_CHECK=false
+
+-case "$target" in
++case "$host" in
+ i*86-*-darwin*)
+ dnl MAKEFILE_PREFIX=darwin_i386
+ MAKEFILE_PREFIX=darwin_x86_64
+@@ -112,7 +86,7 @@
+
+ amd64-*-freebsd* | x86_64*-*-freebsd* | x86_64*-*-k*bsd*-gnu)
+ MAKEFILE_PREFIX=freebsd_amd64
+- case "$target" in
++ case "$host" in
+ x86_64*-*-k*bsd-gnu) # Debian/kFreeBSD
+ PLATFORM=GENTOOFREEBSD
+ INSTALL_PREFIX=linux
+@@ -138,7 +112,7 @@
+
+ *-*-freebsd* | *-*-k*bsd*-gnu)
+ MAKEFILE_PREFIX=freebsd
+- case "$target" in
++ case "$host" in
+ *-*-k*bsd-gnu) # Debian/kFreeBSD
+ PLATFORM=GENTOOFREEBSD
+ INSTALL_PREFIX=linux
+@@ -394,7 +368,7 @@
+ SHRLIB_EXT=so
+ ;;
+
+- *-*-mingw*)
++ *-*-mingw* | *-*-cygwin*)
+ MAKEFILE_PREFIX=mingw
+ PLATFORM=win32
+ AC_DEFINE(WIN_NT, 1, [Define this if OS is Windows NT])
+@@ -756,7 +730,25 @@
+ AC_CHECK_FUNCS(swab _swab)
+ AC_FUNC_MMAP
+ AC_FUNC_FORK
+-AC_FUNC_SETPGRP
++
++dnl AC_FUNC_SETPGRP does not work if cross compiling
++dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
++if test "$cross_compiling" = no; then
++ AC_FUNC_SETPGRP
++else
++ AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
++ [AC_TRY_COMPILE([
++#include <unistd.h>
++], [
++ if (setpgrp(1,1) == -1)
++ exit (0);
++ else
++ exit (1);
++], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
++if test $ac_cv_func_setpgrp_void = yes; then
++ AC_DEFINE(SETPGRP_VOID, 1)
++fi
++fi
+ AC_CHECK_FUNCS(setpgid)
+ AC_FUNC_GETPGRP
+ AC_CHECK_FUNCS(flock)
+@@ -822,7 +814,9 @@
+ [AC_DEFINE(WORKING_SEM_INIT,1,[Define this if sem_init() works on the platform])
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+-AC_SEARCH_LIBS(sem_open, rt)])
++AC_SEARCH_LIBS(sem_open, rt)],
++[AC_DEFINE(WORKING_SEM_INIT,1,[Define this if sem_init() works on the platform])
++AC_MSG_RESULT(cross-compiling, assuming yes)])
+ fi
+ fi
+
+@@ -885,27 +879,13 @@
+
+ dnl EKU: try to determine the alignment of long and double
+ dnl replaces FB_ALIGNMENT and FB_DOUBLE_ALIGN in src/jrd/common.h
+-AC_MSG_CHECKING(alignment of long)
+-AC_TRY_RUN([main () {
+- struct s {
+- char a;
+- long long b;
+- };
+- exit((int)&((struct s*)0)->b);
+-}], ac_cv_c_alignment=$ac_status, ac_cv_c_alignment=$ac_status)
+-AC_MSG_RESULT($ac_cv_c_alignment)
+-AC_DEFINE_UNQUOTED(FB_ALIGNMENT, $ac_cv_c_alignment, [Alignment of long])
+-
+-AC_MSG_CHECKING(alignment of double)
+-AC_TRY_RUN([main () {
+- struct s {
+- char a;
+- double b;
+- };
+- exit((int)&((struct s*)0)->b);
+-}], ac_cv_c_double_align=$ac_status, ac_cv_c_double_align=$ac_status)
+-AC_MSG_RESULT($ac_cv_c_double_align)
+-AC_DEFINE_UNQUOTED(FB_DOUBLE_ALIGN, $ac_cv_c_double_align, [Alignment of double])
++AC_CHECK_ALIGNOF(long long)
++AC_MSG_RESULT($ac_cv_alignof_long_long)
++AC_DEFINE_UNQUOTED(FB_ALIGNMENT, $ac_cv_alignof_long_long, [Alignment of long])
++
++AC_CHECK_ALIGNOF(double)
++AC_MSG_RESULT($ac_cv_alignof_double)
++AC_DEFINE_UNQUOTED(FB_DOUBLE_ALIGN, $ac_cv_alignof_double, [Alignment of double])
+
+ dnl EKU: don't know how to convert this into an autoconf test:
+ dnl #define FB_ALIGN(n,b) ...
+@@ -980,7 +960,7 @@
+ #define FB_PIPE_NAME "interbas"])
+ AC_DEFINE_UNQUOTED(FB_PIPE_NAME,"$FB_PIPE_NAME")
+ AC_SUBST(FB_PIPE_NAME)
+- XE_PREPEND( -mno-cygwin -mthreads -lmpr -lversion -lws2_32 -lole32,LIBS)
++ XE_PREPEND( -mthreads -lmpr -lversion -lws2_32 -lole32,LIBS)
+ ;;
+
+ *)
+unchanged:
+--- firebird.org/extern/btyacc/main.c 2013-06-26 10:05:19.907330600 +0100
++++ firebird/extern/btyacc/main.c 2013-06-26 10:25:20.065917200 +0100
+@@ -2,7 +2,7 @@
+ #include <signal.h>
+ #include <stdio.h>
+
+-#if defined(WIN32)
++#if defined(WIN32) || defined(_WIN32)
+ #include <io.h>
+ #else
+ #include <unistd.h>
+unchanged:
+--- firebird.org/src/burp/mvol.cpp 2013-06-26 10:05:24.089577700 +0100
++++ firebird/src/burp/mvol.cpp 2013-07-03 15:29:42.818271200 +0100
+@@ -47,7 +47,7 @@
+ #include <fcntl.h>
+ #include <sys/types.h>
+
+-#ifdef HAVE_IO_H
++#if defined(HAVE_IO_H) || defined(WIN_NT)
+ #include <io.h> // isatty
+ #endif
+
+unchanged:
+--- firebird.org/src/burp/restore.epp 2013-06-26 10:05:24.089577700 +0100
++++ firebird/src/burp/restore.epp 2013-07-03 15:25:34.792722000 +0100
+@@ -54,6 +54,10 @@
+ #include "../common/classes/SafeArg.h"
+ #include "memory_routines.h"
+
++#ifdef WIN_NT
++#define snprintf _snprintf
++#endif
++
+ using MsgFormat::SafeArg;
+
+
+unchanged:
+--- firebird.org/src/common/classes/BaseStream.cpp 2013-06-26 10:05:24.106566100 +0100
++++ firebird/src/common/classes/BaseStream.cpp 2013-06-27 19:12:19.694346700 +0100
+@@ -28,6 +28,10 @@
+ #include "BaseStream.h"
+ #include <string.h>
+
++#if defined(WIN_NT)
++#include <io.h>
++#endif
++
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+unchanged:
+--- firebird.org/src/common/classes/fb_string.cpp 2013-06-26 10:05:24.123554500 +0100
++++ firebird/src/common/classes/fb_string.cpp 2013-07-03 18:12:28.168333200 +0100
+@@ -32,6 +32,10 @@
+ #include <ctype.h>
+ #include <stdarg.h>
+
++#ifdef WIN_NT
++#pragma comment(lib, "User32.lib")
++#endif
++
+ #ifdef HAVE_STRCASECMP
+ #define STRNCASECMP strncasecmp
+ #else
+unchanged:
+--- firebird.org/src/common/classes/FpeControl.h 2013-06-26 10:05:24.123554500 +0100
++++ firebird/src/common/classes/FpeControl.h 2013-06-28 13:19:21.411841900 +0100
+@@ -204,7 +204,7 @@
+ #ifdef WIN_NT
+ inline bool isinf(double x)
+ {
+- return (!_finite (x) && !isnan(x));
++ return (!_finite (x) && !_isnan(x));
+ }
+ #else
+ #ifndef isinf
+unchanged:
+--- firebird.org/src/isql/isql.epp 2013-06-26 10:05:24.718148500 +0100
++++ firebird/src/isql/isql.epp 2013-07-03 15:39:19.475181200 +0100
+@@ -98,6 +98,7 @@
+ #include "../jrd/common.h"
+ #if defined(WIN_NT)
+ #include <windows.h>
++#define isnan _isnan
+ #endif
+ #include "../jrd/ibase.h"
+ #include "../isql/isql.h"
+unchanged:
+--- firebird.org/src/jrd/divorce.cpp 2013-06-26 10:05:24.786102100 +0100
++++ firebird/src/jrd/divorce.cpp 2013-06-29 11:37:36.553854700 +0100
+@@ -54,7 +54,7 @@
+ #include "../jrd/divorce.h"
+ #include "../common/classes/semaphore.h"
+
+-#ifdef HAVE_IO_H
++#if defined(HAVE_IO_H) || defined(WIN_NT)
+ #include <io.h>
+ #endif
+
+unchanged:
+--- firebird.org/src/jrd/fun.epp 2013-06-26 10:05:24.888032500 +0100
++++ firebird/src/jrd/fun.epp 2013-06-29 11:19:52.564078500 +0100
+@@ -733,7 +733,7 @@
+ status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
+ Arg::Gds(isc_udf_fp_overflow) << Arg::Str(function->fun_name));
+ }
+- else if (isnan(value->vlu_misc.vlu_double))
++ else if (_isnan(value->vlu_misc.vlu_double))
+ {
+ status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
+ Arg::Gds(isc_udf_fp_nan) << Arg::Str(function->fun_name));
+unchanged:
+--- firebird.org/src/jrd/gds.cpp 2013-06-26 10:05:24.888032500 +0100
++++ firebird/src/jrd/gds.cpp 2013-06-29 10:38:05.140333200 +0100
+@@ -71,6 +71,8 @@
+ #include <stdarg.h>
+
+ #if defined(WIN_NT)
++#pragma comment(lib, "advapi32")
++#pragma comment(lib, "Shell32")
+ #include <io.h> // umask, close, lseek, read, open, _sopen
+ #include <process.h>
+ #include <sys/types.h>
+@@ -121,7 +123,7 @@
+
+ #ifdef WIN_NT
+ #include <shlobj.h>
+-#include <shfolder.h>
++//#include <shfolder.h>
+ #define _WINSOCKAPI_
+ #include <share.h>
+ #include "err_proto.h"
+unchanged:
+--- firebird.org/src/jrd/isc.cpp 2013-06-26 10:05:24.922009300 +0100
++++ firebird/src/jrd/isc.cpp 2013-06-29 10:38:56.698423800 +0100
+@@ -58,7 +58,7 @@
+ /* Win32 specific stuff */
+
+ #ifdef WIN_NT
+-
++#pragma comment(lib, "User32")
+ #include <windows.h>
+ #include <aclapi.h>
+ #include <lmcons.h>
+unchanged:
+--- firebird.org/src/jrd/isc_sync.cpp 2013-06-26 10:05:24.938997700 +0100
++++ firebird/src/jrd/isc_sync.cpp 2013-06-30 18:45:43.811961300 +0100
+@@ -127,10 +127,10 @@
+ #include <sys/param.h>
+ #endif
+
+-#ifndef HAVE_GETPAGESIZE
++#if !defined(HAVE_GETPAGESIZE) && !defined(WIN_NT)
+ static size_t getpagesize()
+ {
+- return PAGESIZE;
++ return _PAGESIZE;
+ }
+ #endif
+
+@@ -4320,7 +4320,13 @@
+ *
+ **************************************/
+ char hostname[64];
+- const int rc = snprintf(buffer, bufsize, object_name, ISC_get_host(hostname, sizeof(hostname)));
++ const int rc =
++ #ifdef WIN_NT
++ _snprintf(
++ #else
++ snprintf(
++ #endif
++ buffer, bufsize, object_name, ISC_get_host(hostname, sizeof(hostname)));
+ if (size_t(rc) == bufsize || rc <= 0)
+ {
+ SetLastError(ERROR_FILENAME_EXCED_RANGE);
+unchanged:
+--- firebird.org/src/jrd/os/win32/mod_loader.cpp 2013-06-26 10:05:25.006951300 +0100
++++ firebird/src/jrd/os/win32/mod_loader.cpp 2013-06-27 18:30:42.642374700 +0100
+@@ -93,6 +93,10 @@
+ "msvcr80.dll",
+ #elif _MSC_VER == 1500
+ "msvcr90.dll",
++#elif _MSC_VER == 1600
++ "mscvr100.dll",
++#elif _MSC_VER == 1700
++ "mscvr110.dll",
+ #else
+ #error Specify CRT DLL name here !
+ #endif
+unchanged:
+--- firebird.org/src/jrd/trace/TraceConfigStorage.cpp 2013-06-26 10:05:25.754440900 +0100
++++ firebird/src/jrd/trace/TraceConfigStorage.cpp 2013-07-02 12:32:31.799779900 +0100
+@@ -42,9 +42,10 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+-#ifdef HAVE_IO_H
++#if defined(HAVE_IO_H) || defined(WIN_NT)
+ #include <io.h>
+ #endif
++
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+unchanged:
+--- firebird.org/src/jrd/trace/TraceLog.cpp 2013-06-26 10:05:25.958301700 +0100
++++ firebird/src/jrd/trace/TraceLog.cpp 2013-07-02 12:32:49.747208200 +0100
+@@ -29,7 +29,7 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+-#ifdef HAVE_IO_H
++#if defined(HAVE_IO_H) || defined(WIN_NT)
+ #include <io.h>
+ #endif
+ #include <fcntl.h>
+unchanged:
+--- firebird.org/src/misc/makeHeader.cpp 2013-06-26 10:05:26.230116100 +0100
++++ firebird/src/misc/makeHeader.cpp 2013-07-04 12:43:53.149081800 +0100
+@@ -1,9 +1,9 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
+-//#ifdef HAVE_UNISTD_H
++#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+-//#endif
++#endif
+
+
+
+unchanged:
+--- firebird.org/extern/btyacc/Makefile 2013-07-05 07:58:12.591917200 +0100
++++ firebird/extern/btyacc/Makefile 2013-07-05 09:31:07.589691500 +0100
+@@ -42,7 +42,10 @@
+ all: $(PROGRAM)
+
+ $(PROGRAM): $(OBJS) $(LIBS)
+- $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
++ $(CC) -o $(PROGRAM).exe $(OBJS) $(LIBS) $(LDFLAGS)
++
++%.o: %.c
++ $(CC) -c $< -Fo$@ $(CCFLAGS)
+
+ clean:; rm -f $(OBJS)
+
+unchanged:
+--- firebird.orig/builds/posix/make.rules 2013-08-04 19:06:02.208552600 +0900
++++ firebird/builds/posix/make.rules 2013-08-04 19:13:59.981368500 +0900
+@@ -116,4 +116,4 @@
+ # Rules for making resource files
+
+ $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc
+- windres --output-format=coff --include-dir=$(<D) $< $@
++ windres --output-format=coff --include-dir=$(<D) --target=pe-i386 $< $@
+only in patch2:
--- /dev/null
+diff -ur firebird.org/builds/posix/Makefile.in.examples firebird/builds/posix/Makefile.in.examples
+--- firebird.org/builds/posix/Makefile.in.examples 2013-06-21 20:47:17.047657633 +0100
++++ firebird/builds/posix/Makefile.in.examples 2013-06-21 21:01:45.297638456 +0100
+@@ -53,10 +53,10 @@
+ export PATH
+
+ ifeq ($(PLATFORM),DARWIN)
+-DYLD_LIBRARY_PATH := $(GEN_ROOT)/firebird/lib
++DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(GEN_ROOT)/firebird/lib
+ export DYLD_LIBRARY_PATH
+ else
+-LD_LIBRARY_PATH := $(GEN_ROOT)/firebird/lib
++LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(GEN_ROOT)/firebird/lib
+ export LD_LIBRARY_PATH
+ endif
+ GPRE_FLAGS= -r -m -z -n
+diff -ur firebird.org/builds/posix/Makefile.in.firebird firebird/builds/posix/Makefile.in.firebird
+--- firebird.org/builds/posix/Makefile.in.firebird 2013-06-21 20:47:17.060657632 +0100
++++ firebird/builds/posix/Makefile.in.firebird 2013-06-21 21:12:00.559624868 +0100
+@@ -44,7 +44,7 @@
+ TEST_PATH = @FIREBIRD_BUILD_DIR@
+ # Firebird libs path set at link time (-R) so do not override local requirements - nmcc 28/12/2002
+ #LD_LIBRARY_PATH=$(RealFirebirdPath)/lib
+-LD_LIBRARY_PATH=$(LIB)
++LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(LIB)
+
+ #export ISC_USER
+ #export ISC_PASSWORD
--- /dev/null
+# -*- Mode: Diff -*-
+--- firebird.org/builds/posix/darwin.defaults
++++ firebird/builds/posix/darwin.defaults
+@@ -32,17 +32,17 @@
+ LINK_EMPTY_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/empty.darwin.vers
+ LINK_FIREBIRD_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/firebird.darwin.vers
+
+-LIB_LINK_RPATH:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Libraries/
+-LIB_EMBED_LINK_OPTIONS:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Firebird
+-LIB_CLIENT_LINK_OPTIONS:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Firebird
+-FBEMBED_LINK:=-F../gen/firebird -framework Firebird -L$(LIB) -lfbembed $(ICU_LIBS)
++LIB_LINK_RPATH:=
++LIB_EMBED_LINK_OPTIONS:=-install_name @__________________________________________________OOO/libfbembed.dylib
++LIB_CLIENT_LINK_OPTIONS:=
++FBEMBED_LINK:=-L$(LIB) -lfbembed $(ICU_LIBS)
+ PLATFORM_FALLBACK=os/posix
+
+-PLAT_CLASSIC_PRE_TARGET=darwin_setup_framework
+-PLAT_CLASSIC_POST_TARGET=darwin_finish_cs_framework
++PLAT_CLASSIC_PRE_TARGET=
++PLAT_CLASSIC_POST_TARGET=
+
+-PLAT_SUPER_PRE_TARGET=darwin_setup_framework
+-PLAT_SUPER_POST_TRAGET=darwin_finish_ss_framework
++PLAT_SUPER_PRE_TARGET=
++PLAT_SUPER_POST_TRAGET=
+
+ PLATFORM_POSTBUILD_TARGET=darwin_postbuild_target
+
+diff -ur firebird.org/builds/posix/postfix.darwin firebird/builds/posix/postfix.darwin
+--- firebird.org/builds/posix/postfix.darwin 2013-07-12 20:55:46.000000000 +0200
++++ firebird/builds/posix/postfix.darwin 2013-07-15 12:07:36.000000000 +0200
+@@ -54,9 +54,9 @@
+ cp -r ../gen/firebird/include $(FB_FW)/Versions/A/Headers
+ cp ../gen/firebird/lib/libfbembed.dylib $(FB_FW)/Versions/A/Firebird
+ cp ../gen/firebird/lib/libfbclient.dylib $(FB_FW)/Versions/A/Libraries/libfbclient.dylib
+- cp ../gen/firebird/lib/libicudata.dylib $(FB_FW)/Versions/A/Libraries/libicudata.dylib
+- cp ../gen/firebird/lib/libicui18n.dylib $(FB_FW)/Versions/A/Libraries/libicui18n.dylib
+- cp ../gen/firebird/lib/libicuuc.dylib $(FB_FW)/Versions/A/Libraries/libicuuc.dylib
++ #cp ../gen/firebird/lib/libicudata.dylib $(FB_FW)/Versions/A/Libraries/libicudata.dylib
++ #cp ../gen/firebird/lib/libicui18n.dylib $(FB_FW)/Versions/A/Libraries/libicui18n.dylib
++ #cp ../gen/firebird/lib/libicuuc.dylib $(FB_FW)/Versions/A/Libraries/libicuuc.dylib
+ cp ../gen/firebird/lib/libib_util.dylib $(FB_FW)/Versions/A/Libraries/libib_util.dylib
+ cp ../gen/firebird/firebird.msg \
+ $(FB_FW)/Resources/English.lproj/var/firebird.msg
+@@ -68,8 +68,8 @@
+ $(FB_FW)/Resources/English.lproj/var/intl/fbintl.conf
+ chmod a+rx $(FB_FW)/Resources/English.lproj/var/intl/fbintl
+ mkdir -p $(FB_FW)/Resources/English.lproj/var/plugins
+- cp ../gen/firebird/plugins/libfbtrace.dylib \
+- $(FB_FW)/Resources/English.lproj/var/plugins/libfbtrace.dylib
++# cp ../gen/firebird/plugins/libfbtrace.dylib \
++# $(FB_FW)/Resources/English.lproj/var/plugins/libfbtrace.dylib
+ cp -r ../gen/firebird/help $(FB_FW)/Resources/English.lproj/var/help
+ cp ../gen/firebird/security2.fdb $(FB_FW)/Resources/English.lproj/var
+ mkdir -p $(FB_FW)/Resources/doc
+--- firebird.org/builds/posix/prefix.darwin_i386
++++ firebird/builds/posix/prefix.darwin_i386
+@@ -19,7 +19,7 @@
+ # 4. for CFLAGS, CXXFLAGS, LDFLAGS export '-m32 -arch i386'
+ # 5. export MACOSX_DEPLOYMENT_TARGET=10.6
+
+-DYLD_LIBRARY_PATH=$(FIREBIRD)/lib
++DYLD_LIBRARY_PATH:=$(FIREBIRD)/lib:$(DYLD_LIBRARY_PATH)
+ export DYLD_LIBRARY_PATH
+
+ MACOSX_DEPLOYMENT_TARGET=10.6
+@@ -32,8 +32,8 @@
+
+ OS_ServerFiles=inet_server.cpp
+
+-PROD_FLAGS=-O1 -DDARWIN -pipe -p -MMD -fPIC -fno-common -arch i386 -mmacosx-version-min=10.6
+-DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall -arch i386 -mmacosx-version-min=10.6
++PROD_FLAGS=-O1 -DDARWIN -pipe -p -MMD -fPIC -fno-common
++DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall
+ CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden -fno-weak
+ EMBED_UTIL_TARGETS=gstat gds_relay gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
+ CLIENT_UTIL_TARGETS=gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr \
+--- firebird.org/builds/posix/prefix.darwin_x86_64
++++ firebird/builds/posix/prefix.darwin_x86_64
+@@ -19,7 +19,7 @@
+ #
+ # Default build from 10.6
+
+-DYLD_LIBRARY_PATH=$(FIREBIRD)/lib
++DYLD_LIBRARY_PATH:=$(FIREBIRD)/lib:$(DYLD_LIBRARY_PATH)
+ export DYLD_LIBRARY_PATH
+
+ MACOSX_DEPLOYMENT_TARGET=10.6
+@@ -27,9 +27,9 @@
+
+ OS_ServerFiles=inet_server.cpp
+
+-PROD_FLAGS=-O1 -DDARWIN -pipe -p -MMD -fPIC -fno-common -mmacosx-version-min=10.6
+-DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall -mmacosx-version-min=10.6
+-CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden -fno-weak
++PROD_FLAGS=-O1 -DDARWIN -pipe -p -MMD -fPIC -fno-common
++DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall
++CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden
+ EMBED_UTIL_TARGETS=gstat gds_relay gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
+ CLIENT_UTIL_TARGETS=gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr \
+ fbtracemgr
--- /dev/null
+--- builds/posix/make.defaults
++++ builds/posix/make.defaults
+@@ -255,7 +255,7 @@
+
+ LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
+ ifeq ($(strip @BINRELOC_CFLAGS@),)
+-LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@))
++LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$ORIGIN')
+ else
+ LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$$$ORIGIN/../$(1)')
+ endif
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,fontconfig))
+
+$(eval $(call gb_ExternalProject_use_externals,fontconfig,\
+ expat \
+ freetype \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,fontconfig,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,fontconfig,build) :
+ $(call gb_ExternalProject_run,build,\
+ CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
+ ./configure \
+ --disable-shared \
+ --with-arch=arm \
+ --with-expat-includes=$(call gb_UnpackedTarball_get_dir,expat)/lib \
+ --with-expat-lib=$(gb_StaticLibrary_WORKDIR) \
+ --with-freetype-config=$(call gb_UnpackedTarball_get_dir,freetype)/instdir/bin/freetype-config \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,fontconfig))
+
+ifeq ($(OS),ANDROID)
+
+$(eval $(call gb_Module_add_targets,fontconfig,\
+ ExternalProject_fontconfig \
+ UnpackedTarball_fontconfig \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+This "bundled" fontconfig is built only in an Android build
+
+Fontconfig is a font configuration and customization library. It is designed to locate fonts
+within the system and select them according to requirements specified by applications.
+
+From [ http://packages.debian.org/squeeze/fontconfig ]
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,fontconfig))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,fontconfig,$(FONTCONFIG_TARBALL),,fontconfig))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,fontconfig,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,fontconfig,\
+ external/fontconfig/fontconfig-2.8.0.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/fontconfig-2.8.0/config.sub
++++ misc/build/fontconfig-2.8.0/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-android* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1272,7 +1272,7 @@
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -udi* | -android* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+--- misc/build/fontconfig-2.8.0/configure
++++ misc/build/fontconfig-2.8.0/configure
+@@ -8718,7 +8718,7 @@
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+--- misc/build/fontconfig-2.8.0/fontconfig/fontconfig.h
++++ misc/build/fontconfig-2.8.0/fontconfig/fontconfig.h
+@@ -113,9 +113,9 @@
+ #define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */
+ #define FC_LCD_FILTER "lcdfilter" /* Int */
+
+-#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION
+-#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION
+-#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION
++#define FC_CACHE_SUFFIX ".cache-" FC_CACHE_VERSION
++#define FC_DIR_CACHE_FILE "fonts.cache-" FC_CACHE_VERSION
++#define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION
+
+ /* Adjust outline rasterizer */
+ #define FC_CHAR_WIDTH "charwidth" /* Int */
+--- misc/build/fontconfig-2.8.0/src/fcxml.c
++++ misc/build/fontconfig-2.8.0/src/fcxml.c
+@@ -1123,6 +1123,7 @@
+ * Have to swap the decimal point to match the current locale
+ * if that locale doesn't use 0x2e
+ */
++#ifndef __ANDROID__
+ if ((dot = strchr (s, 0x2e)) &&
+ (locale_data = localeconv ()) &&
+ (locale_data->decimal_point[0] != 0x2e ||
+@@ -1158,6 +1158,7 @@
+ }
+ }
+ else
++#endif
+ v = strtod (s, end);
+ return v;
+ }
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,freetype))
+
+$(eval $(call gb_ExternalProject_register_targets,freetype,\
+ build \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+$(call gb_ExternalProject_get_state_target,freetype,build) :
+ $(call gb_ExternalProject_run,build,\
+ cd ../builds/win32/vc2010/ && \
+ msbuild.exe freetype.vcxproj /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) /p:VisualStudioVersion=11.0) \
+ ,objs)
+else
+$(call gb_ExternalProject_get_state_target,freetype,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ --disable-shared \
+ --without-zlib \
+ --without-bzip2 \
+ --prefix=$(call gb_UnpackedTarball_get_dir,freetype/instdir) \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ CFLAGS="$(if $(debug),-g) $(gb_VISIBILITY_FLAGS)" \
+ && chmod +x builds/unix/freetype-config \
+ && $(MAKE) install \
+ && touch $@ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,freetype))
+
+ifneq (,$(or $(findstring ANDROID,$(OS)),$(ENABLE_GLTF)))
+
+$(eval $(call gb_Module_add_targets,freetype,\
+ ExternalProject_freetype \
+ UnpackedTarball_freetype \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+FreeType 2 is a software font engine that is designed to be small, efficient, highly customizable,
+and portable while capable of producing high-quality output (glyph images). It can be
+used in graphics libraries, display servers, font conversion tools, text image generation
+tools, and many other products as well.
+
+From [http://freetype.sourceforge.net/freetype2/index.html]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,freetype))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,freetype,$(FREETYPE_TARBALL),,freetype))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,freetype,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,freetype,\
+ external/freetype/freetype-2.4.8.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/freetype-2.4.8/builds/unix/configure
++++ misc/build/freetype-2.4.8/builds/unix/configure
+@@ -3619,7 +3619,7 @@
+
+ if test "x$GCC" = xyes; then
+ XX_CFLAGS="-Wall"
+- XX_ANSIFLAGS="-pedantic -ansi"
++ XX_ANSIFLAGS=
+ else
+ case "$host" in
+ *-dec-osf*)
+@@ -10039,7 +10039,7 @@
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
--- /dev/null
+From 820df42a87322eef69a8d02451caa705d53b7dda Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl@redhat.com>
+Date: Thu, 30 Jan 2014 12:12:00 +0100
+Subject: [PATCH] stop linking to unneeded Xmu, Xi, Xext libraries
+
+Apparently Xmu and Xi were needed when glewinfo was using glut, but that
+dependency was removed 11 years ago in
+031afdf03be1d123b7a442f64cfa28c6066c1490.
+---
+ auto/doc/build.html | 2 +-
+ config/Makefile.cygwin | 2 +-
+ config/Makefile.darwin | 2 +-
+ config/Makefile.darwin-ppc | 2 +-
+ config/Makefile.darwin-x86_64 | 2 +-
+ config/Makefile.freebsd | 2 +-
+ config/Makefile.gnu | 2 +-
+ config/Makefile.kfreebsd | 2 +-
+ config/Makefile.linux | 2 +-
+ config/Makefile.netbsd | 2 +-
+ config/Makefile.openbsd | 2 +-
+ config/Makefile.solaris | 2 +-
+ config/Makefile.solaris-gcc | 2 +-
+ doc/build.html | 2 +-
+ 14 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/config/Makefile.cygwin b/config/Makefile.cygwin
+index b044273..8600fd0 100644
+--- a/config/Makefile.cygwin
++++ b/config/Makefile.cygwin
+@@ -6,7 +6,7 @@ LD := cc
+ LN :=
+ LDFLAGS.EXTRA =
+ LIBDIR = $(GLEW_DEST)/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ WARN = -Wall -W
+diff --git a/config/Makefile.darwin b/config/Makefile.darwin
+index 0c05ed1..bf34a0e 100644
+--- a/config/Makefile.darwin
++++ b/config/Makefile.darwin
+@@ -6,7 +6,7 @@ CFLAGS.EXTRA = -dynamic -fno-common
+ LDFLAGS.EXTRA =
+ ifneq (undefined, $(origin GLEW_APPLE_GLX))
+ CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
+-LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
+ else
+ LDFLAGS.GL = -framework AGL -framework OpenGL
+ endif
+diff --git a/config/Makefile.darwin-ppc b/config/Makefile.darwin-ppc
+index 2aaf66a..46c8b73 100644
+--- a/config/Makefile.darwin-ppc
++++ b/config/Makefile.darwin-ppc
+@@ -6,7 +6,7 @@ CFLAGS.EXTRA = -arch ppc -dynamic -fno-common
+ LDFLAGS.EXTRA = -arch ppc
+ ifneq (undefined, $(origin GLEW_APPLE_GLX))
+ CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
+-LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
+ else
+ LDFLAGS.GL = -framework AGL -framework OpenGL
+ endif
+diff --git a/config/Makefile.darwin-x86_64 b/config/Makefile.darwin-x86_64
+index 83e5c47..e6eb050 100644
+--- a/config/Makefile.darwin-x86_64
++++ b/config/Makefile.darwin-x86_64
+@@ -6,7 +6,7 @@ CFLAGS.EXTRA = -arch x86_64 -dynamic -fno-common
+ LDFLAGS.EXTRA = -arch x86_64
+ ifneq (undefined, $(origin GLEW_APPLE_GLX))
+ CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
+-LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
+ else
+ LDFLAGS.GL = -framework AGL -framework OpenGL
+ endif
+diff --git a/config/Makefile.freebsd b/config/Makefile.freebsd
+index ab9d9d9..bb66fcc 100644
+--- a/config/Makefile.freebsd
++++ b/config/Makefile.freebsd
+@@ -2,7 +2,7 @@ NAME = $(GLEW_NAME)
+ CC = cc
+ LD = ld
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ CFLAGS.EXTRA += -I/usr/X11R6/include
+diff --git a/config/Makefile.gnu b/config/Makefile.gnu
+index 2398ab0..b7c58be 100644
+--- a/config/Makefile.gnu
++++ b/config/Makefile.gnu
+@@ -2,7 +2,7 @@ NAME = $(GLEW_NAME)
+ CC = cc
+ LD = cc
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ NAME = GLEW
+diff --git a/config/Makefile.kfreebsd b/config/Makefile.kfreebsd
+index 9501091..faf1046 100644
+--- a/config/Makefile.kfreebsd
++++ b/config/Makefile.kfreebsd
+@@ -2,7 +2,7 @@ NAME = $(GLEW_NAME)
+ CC = cc
+ LD = cc
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ NAME = GLEW
+diff --git a/config/Makefile.linux b/config/Makefile.linux
+index 234adc6..b460b4b 100644
+--- a/config/Makefile.linux
++++ b/config/Makefile.linux
+@@ -16,7 +16,7 @@ else
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib
+ LIBDIR = $(GLEW_DEST)/lib
+ endif
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ NAME = GLEW
+diff --git a/config/Makefile.netbsd b/config/Makefile.netbsd
+index 5f69cd6..6da47b1 100644
+--- a/config/Makefile.netbsd
++++ b/config/Makefile.netbsd
+@@ -2,7 +2,7 @@ NAME = $(GLEW_NAME)
+ CC = cc
+ LD = ld
+ LDFLAGS.EXTRA = -L/usr/X11R7/lib -R /usr/X11R7/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ CFLAGS.EXTRA += -I/usr/X11R7/include -fPIC
+diff --git a/config/Makefile.openbsd b/config/Makefile.openbsd
+index 365ea9e..ade993e 100644
+--- a/config/Makefile.openbsd
++++ b/config/Makefile.openbsd
+@@ -2,7 +2,7 @@ NAME = $(GLEW_NAME)
+ CC = cc
+ LD = ld
+ LDFLAGS.EXTRA = -L/usr/X11R6/lib
+-LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 -lm
++LDFLAGS.GL = -lGLU -lGL -lX11 -lm
+ LDFLAGS.STATIC = -Wl,-Bstatic
+ LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+ CFLAGS.EXTRA += -I/usr/X11R6/include
+diff --git a/config/Makefile.solaris b/config/Makefile.solaris
+index befba5a..fe78ca1 100644
+--- a/config/Makefile.solaris
++++ b/config/Makefile.solaris
+@@ -4,7 +4,7 @@ LD = ld
+ CFLAGS.EXTRA = -I/usr/openwin/include
+ LDFLAGS.SO = -G
+ LDFLAGS.EXTRA = -L/usr/openwin/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ NAME = GLEW
+ BIN.SUFFIX =
+ POPT = -xO2
+diff --git a/config/Makefile.solaris-gcc b/config/Makefile.solaris-gcc
+index c0373f4..e00a95b 100644
+--- a/config/Makefile.solaris-gcc
++++ b/config/Makefile.solaris-gcc
+@@ -4,7 +4,7 @@ LD = ld
+ CFLAGS.EXTRA = -I/usr/openwin/include
+ LDFLAGS.SO = -G
+ LDFLAGS.EXTRA = -L/usr/openwin/lib
+-LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11
++LDFLAGS.GL = -lGL -lX11
+ NAME = GLEW
+ BIN.SUFFIX =
+ POPT = -O2
+--
+1.8.3.1
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,glew,glew))
+
+$(eval $(call gb_ExternalPackage_use_external_project,glew,glew))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,glew,$(LIBO_LIB_FOLDER)/libGLEW.1.10.0.dylib,lib/libGLEW.1.10.0.dylib))
+else ifeq ($(OS)-$(COM),WNT-GCC)
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_files,glew,$(LIBO_LIB_FOLDER), \
+ bin/$(if $(MSVC_USE_DEBUG_RUNTIME),Debug/Win32/glew32d.dll,Release/Win32/glew32.dll) \
+))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,glew,$(LIBO_LIB_FOLDER)/libGLEW.so.1.10,lib/libGLEW.so.1.10.0))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,glew))
+
+$(eval $(call gb_ExternalProject_register_targets,glew,\
+ build \
+))
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,glew,build) :
+ $(call gb_ExternalProject_run,build,\
+ msbuild.exe glew_shared.vcxproj /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) /p:VisualStudioVersion=11.0) \
+ ,build/vc10)
+
+else
+
+$(call gb_ExternalProject_get_state_target,glew,build) :
+ $(call gb_ExternalProject_run,glew,\
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),STRIP=) LD="$(CC)" \
+ $(MAKE) STRIP= glew.lib $(if $(filter DESKTOP,$(BUILD_TYPE)),$(if $(filter TRUE,$(ENABLE_DEBUG)),debug)) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,glew))
+
+$(eval $(call gb_Module_add_targets,glew,\
+ ExternalProject_glew \
+ UnpackedTarball_glew \
+ ExternalPackage_glew \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,glew))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,glew,$(GLEW_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,glew,0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,glew,\
+ Makefile \
+ include/GL/glew.h \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+$(eval $(call gb_UnpackedTarball_set_patchflags,glew,--binary))
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-fix-rc-error.patch.1 \
+))
+else
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew_use_CC_variable.patch.1 \
+ external/glew/0001-stop-linking-to-unneeded-Xmu-Xi-Xext-libraries.patch.1 \
+))
+endif
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-macosx-install-name.patch.1 \
+))
+endif
+
+ifeq ($(OS),IOS)
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-ios.patch.1 \
+))
+endif
+
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-static-only.patch.1 \
+))
+endif
+
+$(eval $(call gb_UnpackedTarball_add_patches,glew,\
+ external/glew/glew-debug.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+-*- Mode: Diff -*-
+--- glew/Makefile
++++ glew/Makefile
+@@ -65,7 +65,7 @@
+ RM ?= rm -f
+ LN ?= ln -sf
+
+-ifeq ($(MAKECMDGOALS), debug)
++ifneq (,$(filter debug,$(MAKECMDGOALS)))
+ OPT = -g
+ else
+ OPT = $(POPT)
--- /dev/null
+diff -ur glew.org/build/glew.rc glew/build/glew.rc
+--- glew.org/build/glew.rc 2014-01-28 06:54:52.910765800 +0100
++++ glew/build/glew.rc 2014-01-28 06:56:46.719717700 +0100
+@@ -56,7 +56,7 @@
+ BEGIN\r
+ BLOCK "040904b0"\r
+ BEGIN\r
+- VALUE "Comments", "The OpenGL Extension Wrangler Library\r\nCopyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\r\nCopyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\r\nCopyright (C) 2002, Lev Povalahev\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without \r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, \r\n this list of conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, \r\n this list of conditions and the following disclaimer in the documentation \r\n and/or other materials provided with the distribution.\r\n* The name of the author may be used to endorse or promote products \r\n derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\nTHE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n\r\nMesa 3-D graphics library\r\n\r\nVersion: 7.0\r\n\r\nCopyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a\r\ncopy of this software and associated documentation files (the ''Software''),\r\nto deal in the Software without restriction, including without limitation\r\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\r\nand/or sell copies of the Software, and to permit persons to whom the\r\nSoftware is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included\r\nin all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\nBRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n\r\nCopyright (c) 2007 The Khronos Group Inc.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a\r\ncopy of this software and/or associated documentation files (the\r\n''Materials''), to deal in the Materials without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Materials, and to\r\npermit persons to whom the Materials are furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included\r\nin all copies or substantial portions of the Materials.\r\n\r\nTHE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nMATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0"\r
++ VALUE "Comments", "The OpenGL Extension Wrangler Library\0"\r
+ VALUE "CompanyName", "\0"\r
+ VALUE "FileDescription", "The OpenGL Extension Wrangler Library\0"\r
+ VALUE "FileVersion", "1,10,0,0\0"\r
--- /dev/null
+-*- Mode:Diff -*-
+--- glew/include/GL/glew.h
++++ glew/include/GL/glew.h
+@@ -1180,6 +1180,15 @@
+
+ /* ---------------------------------- GLU ---------------------------------- */
+
++#ifndef GLEW_NO_GLU
++# ifdef __APPLE__
++# include <Availability.h>
++# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
++# define GLEW_NO_GLU
++# endif
++# endif
++#endif
++
+ #ifndef GLEW_NO_GLU
+ /* this is where we can safely include GLU */
+ # if defined(__APPLE__) && defined(__MACH__)
--- /dev/null
+-*- Mode:Diff -*-
+diff -ur glew.org/build/glew.rc glew/build/glew.rc
+--- glew/config/Makefile.darwin
++++ glew/config/Makefile.darwin
+@@ -20,7 +20,7 @@
+ LIB.DEVLNK = lib$(NAME).dylib
+ LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib
+ LIB.STATIC = lib$(NAME).a
+-LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
++LDFLAGS.SO = -dynamiclib -install_name @__________________________________________________OOO/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
+ LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
+ LIB.DEVLNK.MX = lib$(NAME)mx.dylib
+ LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
--- /dev/null
+-*- Mode:Diff -*-
+--- glew/Makefile
++++ glew/Makefile
+@@ -93,7 +93,7 @@
+ LIB.SOBJS.MX := $(addprefix tmp/$(SYSTEM)/mx/shared/,$(LIB.SRCS.NAMES))
+ LIB.SOBJS.MX := $(LIB.SOBJS.MX:.c=.o)
+
+-glew.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC) glew.pc
++glew.lib: lib lib/$(LIB.STATIC)
+
+ lib:
+ mkdir lib
--- /dev/null
+Use CC variable from environment, don't hardcode "cc".
+
+--- glew/config/Makefile.linux.orig 2014-01-29 15:39:43.364972925 +0100
++++ glew/config/Makefile.linux 2014-01-29 15:44:45.621000941 +0100
+@@ -1,6 +1,6 @@
+ NAME = $(GLEW_NAME)
+-CC = cc
+-LD = cc
++CC ?= cc
++LD ?= $(CC)
+ M_ARCH ?= $(shell uname -m)
+ ARCH64 = false
+ ifeq (x86_64,${M_ARCH})
+--- glew/config/Makefile.darwin.orig 2014-01-29 15:44:39.541000377 +0100
++++ glew/config/Makefile.darwin 2014-01-29 15:44:47.548001120 +0100
+@@ -1,6 +1,6 @@
+ NAME = $(GLEW_NAME)
+-CC = cc
+-LD = cc
++CC ?= cc
++LD ?= $(CC)
+ CFLAGS.EXTRA = -dynamic -fno-common
+ #CFLAGS.EXTRA += -no-cpp-precomp
+ LDFLAGS.EXTRA =
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,glm))
+
+ifeq ($(SYSTEM_GLM),)
+
+$(eval $(call gb_Module_add_targets,glm,\
+ UnpackedTarball_glm \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Glm provides a header only library for OpenGL mathematics.
+
+It is available from http://glm.g-truc.net/0.9.4/index.html
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,glm))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,glm,$(GLM_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchflags,glm,--binary))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,glm,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,glm, \
+ external/glm/Wshadow-patch-fix.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- a/glm/core/type_vec4.hpp
++++ b/glm/core/type_vec4.hpp
+@@ -185,7 +185,7 @@
+ template <int E0, int E1>\r
+ GLM_FUNC_DECL tvec4(T const & x_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & w_)\r
+ {\r
+- *this = tvec4<T>(x_, v(), w);\r
++ *this = tvec4<T>(x_, v(), w_);\r
+ }\r
+ \r
+ template <int E0, int E1>\r
--- /dev/null
+diff -ur glm.org/glm/core/_detail.hpp glm/glm/core/_detail.hpp
+--- glm.org/glm/core/_detail.hpp 2013-12-09 02:05:30.115442079 +0100
++++ glm/glm/core/_detail.hpp 2013-12-09 02:06:33.749941584 +0100
+@@ -136,12 +136,12 @@
+ i(0)\r
+ {}\r
+ \r
+- GLM_FUNC_QUALIFIER uif32(float f) :\r
+- f(f)\r
++ GLM_FUNC_QUALIFIER uif32(float f_) :\r
++ f(f_)\r
+ {}\r
+ \r
+- GLM_FUNC_QUALIFIER uif32(unsigned int i) :\r
+- i(i)\r
++ GLM_FUNC_QUALIFIER uif32(unsigned int i_) :\r
++ i(i_)\r
+ {}\r
+ \r
+ float f;\r
+@@ -154,12 +154,12 @@
+ i(0)\r
+ {}\r
+ \r
+- GLM_FUNC_QUALIFIER uif64(double f) :\r
+- f(f)\r
++ GLM_FUNC_QUALIFIER uif64(double f_) :\r
++ f(f_)\r
+ {}\r
+ \r
+- GLM_FUNC_QUALIFIER uif64(uint64 i) :\r
+- i(i)\r
++ GLM_FUNC_QUALIFIER uif64(uint64 i_) :\r
++ i(i_)\r
+ {}\r
+ \r
+ double f;\r
+diff -ur glm.org/glm/core/type_vec1.hpp glm/glm/core/type_vec1.hpp
+--- glm.org/glm/core/type_vec1.hpp 2013-12-08 17:04:59.706365245 +0100
++++ glm/glm/core/type_vec1.hpp 2013-12-08 17:07:20.079840510 +0100
+@@ -86,19 +86,19 @@
+ GLM_FUNC_DECL explicit tvec1(\r
+ ctor);\r
+ GLM_FUNC_DECL explicit tvec1(\r
+- value_type const & s);\r
++ value_type const & s_);\r
+ \r
+ //////////////////////////////////////\r
+ // Swizzle constructors\r
+ \r
+- GLM_FUNC_DECL tvec1(tref1<T> const & r);\r
++ GLM_FUNC_DECL tvec1(tref1<T> const & r_);\r
+ \r
+ //////////////////////////////////////\r
+ // Convertion scalar constructors\r
+ \r
+ //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+ template <typename U> \r
+- GLM_FUNC_DECL explicit tvec1(U const & s);\r
++ GLM_FUNC_DECL explicit tvec1(U const & s_);\r
+ \r
+ //////////////////////////////////////\r
+ // Convertion vector constructors\r
+@@ -121,19 +121,19 @@
+ GLM_FUNC_DECL tvec1<T> & operator= (tvec1<U> const & v);\r
+ \r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator+=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator+=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator+=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator-=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator-=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator-=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator*=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator*=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator*=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator/=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator/=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator/=(tvec1<U> const & v);\r
+ GLM_FUNC_DECL tvec1<T> & operator++();\r
+@@ -143,27 +143,27 @@
+ // Unary bit operators\r
+ \r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator%=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator%=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator%=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator&=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator&=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator&=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator|=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator|=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator|=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator^=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator^=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator^=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator<<=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator<<=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator<<=(tvec1<U> const & v);\r
+ template <typename U> \r
+- GLM_FUNC_DECL tvec1<T> & operator>>=(U const & s);\r
++ GLM_FUNC_DECL tvec1<T> & operator>>=(U const & s_);\r
+ template <typename U> \r
+ GLM_FUNC_DECL tvec1<T> & operator>>=(tvec1<U> const & v);\r
+ \r
+diff -ur glm.org/glm/core/type_vec1.inl glm/glm/core/type_vec1.inl
+--- glm.org/glm/core/type_vec1.inl 2013-12-08 17:04:59.707365220 +0100
++++ glm/glm/core/type_vec1.inl 2013-12-08 17:07:20.081840460 +0100
+@@ -87,9 +87,9 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T>::tvec1\r
+ (\r
+- value_type const & s\r
++ value_type const & s_\r
+ ) :\r
+- x(s)\r
++ x(s_)\r
+ {}\r
+ \r
+ //////////////////////////////////////\r
+@@ -98,9 +98,9 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T>::tvec1\r
+ (\r
+- tref1<T> const & r\r
++ tref1<T> const & r_\r
+ ) :\r
+- x(r.x)\r
++ x(r_.x)\r
+ {}\r
+ \r
+ //////////////////////////////////////\r
+@@ -110,9 +110,9 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T>::tvec1\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ ) :\r
+- x(value_type(s))\r
++ x(value_type(s_))\r
+ {}\r
+ \r
+ //////////////////////////////////////\r
+@@ -173,10 +173,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator+=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x += T(s);\r
++ this->x += T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -195,10 +195,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator-=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x -= T(s);\r
++ this->x -= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -217,10 +217,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator*=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x *= T(s);\r
++ this->x *= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -239,10 +239,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator/=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x /= T(s);\r
++ this->x /= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -301,10 +301,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator%=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x %= T(s);\r
++ this->x %= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -323,10 +323,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator&=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x &= T(s);\r
++ this->x &= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -345,10 +345,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator|=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x |= T(s);\r
++ this->x |= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -367,10 +367,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator^=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x ^= T(s);\r
++ this->x ^= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -389,10 +389,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator<<=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x <<= T(s);\r
++ this->x <<= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -411,10 +411,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator>>=\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ )\r
+ {\r
+- this->x >>= T(s);\r
++ this->x >>= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -434,21 +434,21 @@
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER T \r
+- tvec1<T>::swizzle(comp x) const\r
++ tvec1<T>::swizzle(comp x_) const\r
+ {\r
+- return (*this)[x];\r
++ return (*this)[x_];\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec2<T> \r
+ tvec1<T>::swizzle\r
+ (\r
+- comp x, \r
++ comp x_, \r
+ comp y\r
+ ) const\r
+ {\r
+ return tvec2<T>(\r
+- (*this)[x],\r
++ (*this)[x_],\r
+ (*this)[y]);\r
+ }\r
+ \r
+@@ -456,13 +456,13 @@
+ GLM_FUNC_QUALIFIER tvec3<T> \r
+ tvec1<T>::swizzle\r
+ (\r
+- comp x, \r
++ comp x_, \r
+ comp y, \r
+ comp z\r
+ ) const\r
+ {\r
+ return tvec3<T>(\r
+- (*this)[x],\r
++ (*this)[x_],\r
+ (*this)[y],\r
+ (*this)[z]);\r
+ }\r
+@@ -471,14 +471,14 @@
+ GLM_FUNC_QUALIFIER tvec4<T> \r
+ tvec1<T>::swizzle\r
+ (\r
+- comp x, \r
++ comp x_, \r
+ comp y, \r
+ comp z, \r
+ comp w\r
+ ) const\r
+ {\r
+ return tvec4<T>(\r
+- (*this)[x],\r
++ (*this)[x_],\r
+ (*this)[y],\r
+ (*this)[z],\r
+ (*this)[w]);\r
+@@ -488,11 +488,11 @@
+ GLM_FUNC_QUALIFIER tref1<T> \r
+ tvec1<T>::swizzle\r
+ (\r
+- comp x\r
++ comp x_\r
+ )\r
+ {\r
+ return tref1<T>(\r
+- (*this)[x]);\r
++ (*this)[x_]);\r
+ }\r
+ \r
+ //////////////////////////////////////\r
+@@ -502,22 +502,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator+ \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x + s);\r
++ v.x + s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec1<T> operator+ \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_, \r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s + v.x);\r
++ s_ + v.x);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -536,22 +536,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator- \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x - s);\r
++ v.x - s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec1<T> operator- \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s - v.x);\r
++ s_ - v.x);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -570,22 +570,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator* \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x * s);\r
++ v.x * s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec1<T> operator* \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s * v.x);\r
++ s_ * v.x);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -604,22 +604,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator/ \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x / s);\r
++ v.x / s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec1<T> operator/ \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s / v.x);\r
++ s_ / v.x);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -673,22 +673,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator% \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x % s);\r
++ v.x % s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T> operator% \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s % v.x);\r
++ s_ % v.x);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -706,22 +706,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator& \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x & s);\r
++ v.x & s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T> operator& \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s & v.x);\r
++ s_ & v.x);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -739,22 +739,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator| \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x | s);\r
++ v.x | s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T> operator| \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s | v.x);\r
++ s_ | v.x);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -772,22 +772,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator^ \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x ^ s);\r
++ v.x ^ s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T> operator^ \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s ^ v.x);\r
++ s_ ^ v.x);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -805,22 +805,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator<< \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x << s);\r
++ v.x << s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T> operator<< \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s << v.x);\r
++ s_ << v.x);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -838,22 +838,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator>> \r
+ (\r
+ tvec1<T> const & v, \r
+- typename tvec1<T>::value_type const & s\r
++ typename tvec1<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- v.x >> s);\r
++ v.x >> s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec1<T> operator>> \r
+ (\r
+- typename tvec1<T>::value_type const & s, \r
++ typename tvec1<T>::value_type const & s_,\r
+ tvec1<T> const & v\r
+ )\r
+ {\r
+ return tvec1<T>(\r
+- s >> v.x);\r
++ s_ >> v.x);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -883,9 +883,9 @@
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tref1<T>::tref1\r
+ (\r
+- T & x\r
++ T & x_\r
+ ) :\r
+- x(x)\r
++ x(x_)\r
+ {}\r
+ \r
+ template <typename T> \r
+diff -ur glm.org/glm/core/type_vec2.inl glm/glm/core/type_vec2.inl
+--- glm.org/glm/core/type_vec2.inl 2013-12-08 17:04:59.705365270 +0100
++++ glm/glm/core/type_vec2.inl 2013-12-08 17:07:20.078840535 +0100
+@@ -91,10 +91,10 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec2<T>::tvec2\r
+ (\r
+- value_type const & s\r
++ value_type const & s_\r
+ ) :\r
+- x(s),\r
+- y(s)\r
++ x(s_),\r
++ y(s_)\r
+ {}\r
+ \r
+ template <typename T>\r
+@@ -113,10 +113,10 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec2<T>::tvec2\r
+ (\r
+- tref2<T> const & r\r
++ tref2<T> const & r_\r
+ ) :\r
+- x(r.x),\r
+- y(r.y)\r
++ x(r_.x),\r
++ y(r_.y)\r
+ {}\r
+ \r
+ //////////////////////////////////////\r
+@@ -126,10 +126,10 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec2<T>::tvec2\r
+ (\r
+- U const & x\r
++ U const & x_\r
+ ) :\r
+- x(value_type(x)),\r
+- y(value_type(x))\r
++ x(value_type(x_)),\r
++ y(value_type(x_))\r
+ {}\r
+ \r
+ template <typename T>\r
+@@ -204,10 +204,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=(U s_)\r
+ {\r
+- this->x += T(s);\r
+- this->y += T(s);\r
++ this->x += T(s_);\r
++ this->y += T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -225,10 +225,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=(U s_)\r
+ {\r
+- this->x -= T(s);\r
+- this->y -= T(s);\r
++ this->x -= T(s_);\r
++ this->y -= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -246,10 +246,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=(U s_)\r
+ {\r
+- this->x *= T(s);\r
+- this->y *= T(s);\r
++ this->x *= T(s_);\r
++ this->y *= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -267,10 +267,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=(U s_)\r
+ {\r
+- this->x /= T(s);\r
+- this->y /= T(s);\r
++ this->x /= T(s_);\r
++ this->y /= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -330,10 +330,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=(U s_)\r
+ {\r
+- this->x %= T(s);\r
+- this->y %= T(s);\r
++ this->x %= T(s_);\r
++ this->y %= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -351,10 +351,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=(U s_)\r
+ {\r
+- this->x &= T(s);\r
+- this->y &= T(s);\r
++ this->x &= T(s_);\r
++ this->y &= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -372,10 +372,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=(U s_)\r
+ {\r
+- this->x |= T(s);\r
+- this->y |= T(s);\r
++ this->x |= T(s_);\r
++ this->y |= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -393,10 +393,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=(U s_)\r
+ {\r
+- this->x ^= T(s);\r
+- this->y ^= T(s);\r
++ this->x ^= T(s_);\r
++ this->y ^= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -414,10 +414,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=(U s_)\r
+ {\r
+- this->x <<= T(s);\r
+- this->y <<= T(s);\r
++ this->x <<= T(s_);\r
++ this->y <<= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -435,10 +435,10 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=(U s)\r
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=(U s_)\r
+ {\r
+- this->x >>= T(s);\r
+- this->y >>= T(s);\r
++ this->x >>= T(s_);\r
++ this->y >>= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -460,50 +460,50 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER typename tvec2<T>::value_type tvec2<T>::swizzle\r
+ (\r
+- comp x\r
++ comp x_\r
+ ) const\r
+ {\r
+- return (*this)[x];\r
++ return (*this)[x_];\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec2<T> tvec2<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y\r
++ comp x_, \r
++ comp y_\r
+ ) const\r
+ {\r
+ return tvec2<T>(\r
+- (*this)[x],\r
+- (*this)[y]);\r
++ (*this)[x_],\r
++ (*this)[y_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> tvec2<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
++ comp x_, \r
++ comp y_, \r
+ comp z\r
+ ) const\r
+ {\r
+ return tvec3<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
++ (*this)[x_],\r
++ (*this)[y_],\r
+ (*this)[z]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> tvec2<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
++ comp x_, \r
++ comp y_, \r
+ comp z, \r
+ comp w\r
+ ) const\r
+ {\r
+ return tvec4<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
++ (*this)[x_],\r
++ (*this)[y_],\r
+ (*this)[z],\r
+ (*this)[w]);\r
+ }\r
+@@ -511,13 +511,13 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tref2<T> tvec2<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y\r
++ comp x_, \r
++ comp y_\r
+ )\r
+ {\r
+ return tref2<T>(\r
+- (*this)[x],\r
+- (*this)[y]);\r
++ (*this)[x_],\r
++ (*this)[y_]);\r
+ }\r
+ \r
+ //////////////////////////////////////\r
+@@ -527,12 +527,12 @@
+ GLM_FUNC_QUALIFIER tvec2<T> operator+ \r
+ (\r
+ tvec2<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec2<T>(\r
+- v.x + T(s),\r
+- v.y + T(s));\r
++ v.x + T(s_),\r
++ v.y + T(s_));\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -942,11 +942,11 @@
+ template <typename T> \r
+ tref2<T>::tref2\r
+ (\r
+- T & x, \r
+- T & y\r
++ T & x_, \r
++ T & y_\r
+ ) :\r
+- x(x),\r
+- y(y)\r
++ x(x_),\r
++ y(y_)\r
+ {}\r
+ \r
+ template <typename T> \r
+diff -ur glm.org/glm/core/type_vec3.hpp glm/glm/core/type_vec3.hpp
+--- glm.org/glm/core/type_vec3.hpp 2013-12-08 17:04:59.707365220 +0100
++++ glm/glm/core/type_vec3.hpp 2013-12-08 17:07:20.081840460 +0100
+@@ -170,15 +170,15 @@
+ }\r
+ \r
+ template <int E0, int E1>\r
+- GLM_FUNC_DECL tvec3(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & s)\r
++ GLM_FUNC_DECL tvec3(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & s_)\r
+ {\r
+- *this = tvec3<T>(v(), s);\r
++ *this = tvec3<T>(v(), s_);\r
+ }\r
+ \r
+ template <int E0, int E1>\r
+- GLM_FUNC_DECL tvec3(T const & s, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)\r
++ GLM_FUNC_DECL tvec3(T const & s_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)\r
+ {\r
+- *this = tvec3<T>(s, v());\r
++ *this = tvec3<T>(s_, v());\r
+ }\r
+ \r
+ //////////////////////////////////////\r
+diff -ur glm.org/glm/core/type_vec3.inl glm/glm/core/type_vec3.inl
+--- glm.org/glm/core/type_vec3.inl 2013-12-08 17:04:59.706365245 +0100
++++ glm/glm/core/type_vec3.inl 2013-12-08 17:07:20.079840510 +0100
+@@ -93,11 +93,11 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+- value_type const & s\r
++ value_type const & s_\r
+ ) :\r
+- x(s),\r
+- y(s),\r
+- z(s)\r
++ x(s_),\r
++ y(s_),\r
++ z(s_)\r
+ {}\r
+ \r
+ template <typename T>\r
+@@ -118,11 +118,11 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+- tref3<T> const & r\r
++ tref3<T> const & r_\r
+ ) :\r
+- x(r.x),\r
+- y(r.y),\r
+- z(r.z)\r
++ x(r_.x),\r
++ y(r_.y),\r
++ z(r_.z)\r
+ {}\r
+ \r
+ template <typename T>\r
+@@ -130,21 +130,21 @@
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+ tref2<A> const & v, \r
+- B const & s\r
++ B const & s_\r
+ ) : \r
+ x(value_type(v.x)),\r
+ y(value_type(v.y)),\r
+- z(value_type(s))\r
++ z(value_type(s_))\r
+ {}\r
+ \r
+ template <typename T>\r
+ template <typename A, typename B> \r
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+- A const & s, \r
++ A const & s_, \r
+ tref2<B> const & v\r
+ ) :\r
+- x(value_type(s)),\r
++ x(value_type(s_)),\r
+ y(value_type(v.x)),\r
+ z(value_type(v.y))\r
+ {}\r
+@@ -156,24 +156,24 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+- U const & s\r
++ U const & s_\r
+ ) :\r
+- x(value_type(s)),\r
+- y(value_type(s)),\r
+- z(value_type(s))\r
++ x(value_type(s_)),\r
++ y(value_type(s_)),\r
++ z(value_type(s_))\r
+ {}\r
+ \r
+ template <typename T>\r
+ template <typename A, typename B, typename C> \r
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+- A const & x, \r
+- B const & y, \r
+- C const & z\r
++ A const & x_, \r
++ B const & y_, \r
++ C const & z_\r
+ ) :\r
+- x(value_type(x)),\r
+- y(value_type(y)),\r
+- z(value_type(z))\r
++ x(value_type(x_)),\r
++ y(value_type(y_)),\r
++ z(value_type(z_))\r
+ {}\r
+ \r
+ //////////////////////////////////////\r
+@@ -184,21 +184,21 @@
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ (\r
+ tvec2<A> const & v, \r
+- B const & s\r
++ B const & s_\r
+ ) :\r
+ x(value_type(v.x)),\r
+ y(value_type(v.y)),\r
+- z(value_type(s))\r
++ z(value_type(s_))\r
+ {}\r
+ \r
+ template <typename T>\r
+ template <typename A, typename B> \r
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3\r
+ ( \r
+- A const & s, \r
++ A const & s_, \r
+ tvec2<B> const & v\r
+ ) :\r
+- x(value_type(s)),\r
++ x(value_type(s_)),\r
+ y(value_type(v.x)),\r
+ z(value_type(v.y))\r
+ {}\r
+@@ -255,11 +255,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=(U s_)\r
+ {\r
+- this->x += T(s);\r
+- this->y += T(s);\r
+- this->z += T(s);\r
++ this->x += T(s_);\r
++ this->y += T(s_);\r
++ this->z += T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -278,11 +278,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=(U s_)\r
+ {\r
+- this->x -= T(s);\r
+- this->y -= T(s);\r
+- this->z -= T(s);\r
++ this->x -= T(s_);\r
++ this->y -= T(s_);\r
++ this->z -= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -301,11 +301,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=(U s_)\r
+ {\r
+- this->x *= T(s);\r
+- this->y *= T(s);\r
+- this->z *= T(s);\r
++ this->x *= T(s_);\r
++ this->y *= T(s_);\r
++ this->z *= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -324,11 +324,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=(U s_)\r
+ {\r
+- this->x /= T(s);\r
+- this->y /= T(s);\r
+- this->z /= T(s);\r
++ this->x /= T(s_);\r
++ this->y /= T(s_);\r
++ this->z /= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -391,11 +391,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=(U s_)\r
+ {\r
+- this->x %= s;\r
+- this->y %= s;\r
+- this->z %= s;\r
++ this->x %= s_;\r
++ this->y %= s_;\r
++ this->z %= s_;\r
+ return *this;\r
+ }\r
+ \r
+@@ -414,11 +414,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=(U s_)\r
+ {\r
+- this->x &= s;\r
+- this->y &= s;\r
+- this->z &= s;\r
++ this->x &= s_;\r
++ this->y &= s_;\r
++ this->z &= s_;\r
+ return *this;\r
+ }\r
+ \r
+@@ -437,11 +437,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=(U s_)\r
+ {\r
+- this->x |= s;\r
+- this->y |= s;\r
+- this->z |= s;\r
++ this->x |= s_;\r
++ this->y |= s_;\r
++ this->z |= s_;\r
+ return *this;\r
+ }\r
+ \r
+@@ -460,11 +460,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=(U s_)\r
+ {\r
+- this->x ^= s;\r
+- this->y ^= s;\r
+- this->z ^= s;\r
++ this->x ^= s_;\r
++ this->y ^= s_;\r
++ this->z ^= s_;\r
+ return *this;\r
+ }\r
+ \r
+@@ -483,11 +483,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=(U s_)\r
+ {\r
+- this->x <<= s;\r
+- this->y <<= s;\r
+- this->z <<= s;\r
++ this->x <<= s_;\r
++ this->y <<= s_;\r
++ this->z <<= s_;\r
+ return *this;\r
+ }\r
+ \r
+@@ -506,11 +506,11 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=(U s)\r
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=(U s_)\r
+ {\r
+- this->x >>= T(s);\r
+- this->y >>= T(s);\r
+- this->z >>= T(s);\r
++ this->x >>= T(s_);\r
++ this->y >>= T(s_);\r
++ this->z >>= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -534,78 +534,78 @@
+ GLM_FUNC_QUALIFIER typename tvec3<T>::value_type \r
+ tvec3<T>::swizzle\r
+ (\r
+- comp x\r
++ comp x_\r
+ ) const\r
+ {\r
+- return (*this)[x];\r
++ return (*this)[x_];\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec2<T> tvec3<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y\r
++ comp x_, \r
++ comp y_\r
+ ) const\r
+ {\r
+ return tvec2<T>(\r
+- (*this)[x],\r
+- (*this)[y]);\r
++ (*this)[x_],\r
++ (*this)[y_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> tvec3<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z\r
++ comp x_, \r
++ comp y_, \r
++ comp z_\r
+ ) const\r
+ {\r
+ return tvec3<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z]);\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> tvec3<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z, \r
++ comp x_, \r
++ comp y_, \r
++ comp z_, \r
+ comp w\r
+ ) const\r
+ {\r
+ return tvec4<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z],\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_],\r
+ (*this)[w]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tref2<T> tvec3<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y\r
++ comp x_, \r
++ comp y_\r
+ )\r
+ {\r
+ return tref2<T>(\r
+- (*this)[x],\r
+- (*this)[y]);\r
++ (*this)[x_],\r
++ (*this)[y_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z\r
++ comp x_, \r
++ comp y_, \r
++ comp z_\r
+ )\r
+ {\r
+ return tref3<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z]);\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_]);\r
+ }\r
+ \r
+ //////////////////////////////////////\r
+@@ -615,26 +615,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator+\r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x + T(s),\r
+- v.y + T(s),\r
+- v.z + T(s));\r
++ v.x + T(s_),\r
++ v.y + T(s_),\r
++ v.z + T(s_));\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec3<T> operator+ \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) + v.x,\r
+- T(s) + v.y,\r
+- T(s) + v.z);\r
++ T(s_) + v.x,\r
++ T(s_) + v.y,\r
++ T(s_) + v.z);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -655,26 +655,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator- \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x - T(s),\r
+- v.y - T(s),\r
+- v.z - T(s));\r
++ v.x - T(s_),\r
++ v.y - T(s_),\r
++ v.z - T(s_));\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec3<T> operator- \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) - v.x,\r
+- T(s) - v.y,\r
+- T(s) - v.z);\r
++ T(s_) - v.x,\r
++ T(s_) - v.y,\r
++ T(s_) - v.z);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -695,26 +695,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator*\r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x * T(s),\r
+- v.y * T(s),\r
+- v.z * T(s));\r
++ v.x * T(s_),\r
++ v.y * T(s_),\r
++ v.z * T(s_));\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec3<T> operator* \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) * v.x,\r
+- T(s) * v.y,\r
+- T(s) * v.z);\r
++ T(s_) * v.x,\r
++ T(s_) * v.y,\r
++ T(s_) * v.z);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -735,26 +735,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator/\r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x / T(s),\r
+- v.y / T(s),\r
+- v.z / T(s));\r
++ v.x / T(s_),\r
++ v.y / T(s_),\r
++ v.z / T(s_));\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec3<T> operator/ \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) / v.x,\r
+- T(s) / v.y,\r
+- T(s) / v.z);\r
++ T(s_) / v.x,\r
++ T(s_) / v.y,\r
++ T(s_) / v.z);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -816,26 +816,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator% \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x % T(s),\r
+- v.y % T(s),\r
+- v.z % T(s));\r
++ v.x % T(s_),\r
++ v.y % T(s_),\r
++ v.z % T(s_));\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> operator%\r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) % v.x,\r
+- T(s) % v.y,\r
+- T(s) % v.z);\r
++ T(s_) % v.x,\r
++ T(s_) % v.y,\r
++ T(s_) % v.z);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -855,26 +855,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator& \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x & T(s),\r
+- v.y & T(s),\r
+- v.z & T(s));\r
++ v.x & T(s_),\r
++ v.y & T(s_),\r
++ v.z & T(s_));\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> operator& \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) & v.x,\r
+- T(s) & v.y,\r
+- T(s) & v.z);\r
++ T(s_) & v.x,\r
++ T(s_) & v.y,\r
++ T(s_) & v.z);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -894,26 +894,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator| \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x | T(s),\r
+- v.y | T(s),\r
+- v.z | T(s));\r
++ v.x | T(s_),\r
++ v.y | T(s_),\r
++ v.z | T(s_));\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> operator| \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) | v.x,\r
+- T(s) | v.y,\r
+- T(s) | v.z);\r
++ T(s_) | v.x,\r
++ T(s_) | v.y,\r
++ T(s_) | v.z);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -933,26 +933,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator^ \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x ^ T(s),\r
+- v.y ^ T(s),\r
+- v.z ^ T(s));\r
++ v.x ^ T(s_),\r
++ v.y ^ T(s_),\r
++ v.z ^ T(s_));\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> operator^ \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) ^ v.x,\r
+- T(s) ^ v.y,\r
+- T(s) ^ v.z);\r
++ T(s_) ^ v.x,\r
++ T(s_) ^ v.y,\r
++ T(s_) ^ v.z);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -972,26 +972,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator<< \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x << T(s),\r
+- v.y << T(s),\r
+- v.z << T(s));\r
++ v.x << T(s_),\r
++ v.y << T(s_),\r
++ v.z << T(s_));\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> operator<< \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- T(s) << v.x,\r
+- T(s) << v.y,\r
+- T(s) << v.z);\r
++ T(s_) << v.x,\r
++ T(s_) << v.y,\r
++ T(s_) << v.z);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1011,26 +1011,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator>> \r
+ (\r
+ tvec3<T> const & v, \r
+- T const & s\r
++ T const & s_\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- v.x >> T(s),\r
+- v.y >> T(s),\r
+- v.z >> T(s));\r
++ v.x >> T(s_),\r
++ v.y >> T(s_),\r
++ v.z >> T(s_));\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> operator>> \r
+ (\r
+- T const & s, \r
++ T const & s_, \r
+ tvec3<T> const & v\r
+ )\r
+ {\r
+ return tvec3<T>(\r
+- s >> T(v.x),\r
+- s >> T(v.y),\r
+- s >> T(v.z));\r
++ s_ >> T(v.x),\r
++ s_ >> T(v.y),\r
++ s_ >> T(v.z));\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1062,10 +1062,10 @@
+ // tref definition\r
+ \r
+ template <typename T> \r
+- GLM_FUNC_QUALIFIER tref3<T>::tref3(T & x, T & y, T & z) :\r
+- x(x),\r
+- y(y),\r
+- z(z)\r
++ GLM_FUNC_QUALIFIER tref3<T>::tref3(T & x_, T & y_, T & z_) :\r
++ x(x_),\r
++ y(y_),\r
++ z(z_)\r
+ {}\r
+ \r
+ template <typename T> \r
+diff -ur glm.org/glm/core/type_vec4.hpp glm/glm/core/type_vec4.hpp
+--- glm.org/glm/core/type_vec4.hpp 2013-12-08 17:04:59.705365270 +0100
++++ glm/glm/core/type_vec4.hpp 2013-12-08 17:07:20.078840535 +0100
+@@ -177,33 +177,33 @@
+ }\r
+ \r
+ template <int E0, int E1>\r
+- GLM_FUNC_DECL tvec4(T const & x, T const & y, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)\r
++ GLM_FUNC_DECL tvec4(T const & x_, T const & y_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)\r
+ {\r
+- *this = tvec4<T>(x, y, v());\r
++ *this = tvec4<T>(x_, y_, v());\r
+ }\r
+ \r
+ template <int E0, int E1>\r
+- GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & w)\r
++ GLM_FUNC_DECL tvec4(T const & x_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & w_)\r
+ {\r
+- *this = tvec4<T>(x, v(), w);\r
++ *this = tvec4<T>(x_, v(), w);\r
+ }\r
+ \r
+ template <int E0, int E1>\r
+- GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & z, T const & w)\r
++ GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & z_, T const & w_)\r
+ {\r
+- *this = tvec4<T>(v(), z, w);\r
++ *this = tvec4<T>(v(), z_, w_);\r
+ }\r
+ \r
+ template <int E0, int E1, int E2>\r
+- GLM_FUNC_DECL tvec4(glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v, T const & w)\r
++ GLM_FUNC_DECL tvec4(glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v, T const & w_)\r
+ {\r
+- *this = tvec4<T>(v(), w);\r
++ *this = tvec4<T>(v(), w_);\r
+ }\r
+ \r
+ template <int E0, int E1, int E2>\r
+- GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v)\r
++ GLM_FUNC_DECL tvec4(T const & x_, glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v)\r
+ {\r
+- *this = tvec4<T>(x, v());\r
++ *this = tvec4<T>(x_, v());\r
+ }\r
+ \r
+ //////////////////////////////////////\r
+diff -ur glm.org/glm/core/type_vec4.inl glm/glm/core/type_vec4.inl
+--- glm.org/glm/core/type_vec4.inl 2013-12-08 17:04:59.706365245 +0100
++++ glm/glm/core/type_vec4.inl 2013-12-08 17:07:20.079840510 +0100
+@@ -95,12 +95,12 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+- value_type const & s\r
++ value_type const & s_\r
+ ) :\r
+- x(s),\r
+- y(s),\r
+- z(s),\r
+- w(s)\r
++ x(s_),\r
++ y(s_),\r
++ z(s_),\r
++ w(s_)\r
+ {}\r
+ \r
+ template <typename T>\r
+@@ -123,12 +123,12 @@
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+- tref4<T> const & r\r
++ tref4<T> const & r_\r
+ ) :\r
+- x(r.x),\r
+- y(r.y),\r
+- z(r.z),\r
+- w(r.w)\r
++ x(r_.x),\r
++ y(r_.y),\r
++ z(r_.z),\r
++ w(r_.w)\r
+ {}\r
+ \r
+ template <typename T>\r
+@@ -178,22 +178,22 @@
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+ tref3<A> const & v, \r
+- B const & s\r
++ B const & s_\r
+ ) :\r
+ x(value_type(v.x)),\r
+ y(value_type(v.y)),\r
+ z(value_type(v.z)),\r
+- w(value_type(s))\r
++ w(value_type(s_))\r
+ {}\r
+ \r
+ template <typename T>\r
+ template <typename A, typename B> \r
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+- A const & s, \r
++ A const & s_, \r
+ tref3<B> const & v\r
+ ) :\r
+- x(value_type(s)),\r
++ x(value_type(s_)),\r
+ y(value_type(v.x)),\r
+ z(value_type(v.y)),\r
+ w(value_type(v.z))\r
+@@ -245,27 +245,27 @@
+ template <typename U> \r
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+- U const & x\r
++ U const & x_\r
+ ) :\r
+- x(value_type(x)),\r
+- y(value_type(x)),\r
+- z(value_type(x)),\r
+- w(value_type(x))\r
++ x(value_type(x_)),\r
++ y(value_type(x_)),\r
++ z(value_type(x_)),\r
++ w(value_type(x_))\r
+ {}\r
+ \r
+ template <typename T>\r
+ template <typename A, typename B, typename C, typename D> \r
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+- A const & x, \r
+- B const & y, \r
+- C const & z, \r
+- D const & w\r
+- ) :\r
+- x(value_type(x)),\r
+- y(value_type(y)),\r
+- z(value_type(z)),\r
+- w(value_type(w))\r
++ A const & x_, \r
++ B const & y_, \r
++ C const & z_, \r
++ D const & w_\r
++ ) :\r
++ x(value_type(x_)),\r
++ y(value_type(y_)),\r
++ z(value_type(z_)),\r
++ w(value_type(w_))\r
+ {}\r
+ \r
+ //////////////////////////////////////\r
+@@ -318,22 +318,22 @@
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+ tvec3<A> const & v, \r
+- B const & s\r
++ B const & s_\r
+ ) :\r
+ x(value_type(v.x)),\r
+ y(value_type(v.y)),\r
+ z(value_type(v.z)),\r
+- w(value_type(s))\r
++ w(value_type(s_))\r
+ {}\r
+ \r
+ template <typename T>\r
+ template <typename A, typename B> \r
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4\r
+ (\r
+- A const & s, \r
++ A const & s_, \r
+ tvec3<B> const & v\r
+ ) :\r
+- x(value_type(s)),\r
++ x(value_type(s_)),\r
+ y(value_type(v.x)),\r
+ z(value_type(v.y)),\r
+ w(value_type(v.z))\r
+@@ -396,12 +396,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+= (U s_)\r
+ {\r
+- this->x += T(s);\r
+- this->y += T(s);\r
+- this->z += T(s);\r
+- this->w += T(s);\r
++ this->x += T(s_);\r
++ this->y += T(s_);\r
++ this->z += T(s_);\r
++ this->w += T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -421,12 +421,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-= (U s_)\r
+ {\r
+- this->x -= T(s);\r
+- this->y -= T(s);\r
+- this->z -= T(s);\r
+- this->w -= T(s);\r
++ this->x -= T(s_);\r
++ this->y -= T(s_);\r
++ this->z -= T(s_);\r
++ this->w -= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -446,12 +446,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*= (U s_)\r
+ {\r
+- this->x *= T(s);\r
+- this->y *= T(s);\r
+- this->z *= T(s);\r
+- this->w *= T(s);\r
++ this->x *= T(s_);\r
++ this->y *= T(s_);\r
++ this->z *= T(s_);\r
++ this->w *= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -471,12 +471,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/= (U s_)\r
+ {\r
+- this->x /= T(s);\r
+- this->y /= T(s);\r
+- this->z /= T(s);\r
+- this->w /= T(s);\r
++ this->x /= T(s_);\r
++ this->y /= T(s_);\r
++ this->z /= T(s_);\r
++ this->w /= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -519,12 +519,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%= (U s_)\r
+ {\r
+- this->x %= T(s);\r
+- this->y %= T(s);\r
+- this->z %= T(s);\r
+- this->w %= T(s);\r
++ this->x %= T(s_);\r
++ this->y %= T(s_);\r
++ this->z %= T(s_);\r
++ this->w %= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -544,12 +544,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&= (U s_)\r
+ {\r
+- this->x &= T(s);\r
+- this->y &= T(s);\r
+- this->z &= T(s);\r
+- this->w &= T(s);\r
++ this->x &= T(s_);\r
++ this->y &= T(s_);\r
++ this->z &= T(s_);\r
++ this->w &= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -569,12 +569,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|= (U s_)\r
+ {\r
+- this->x |= T(s);\r
+- this->y |= T(s);\r
+- this->z |= T(s);\r
+- this->w |= T(s);\r
++ this->x |= T(s_);\r
++ this->y |= T(s_);\r
++ this->z |= T(s_);\r
++ this->w |= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -594,12 +594,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^= (U s_)\r
+ {\r
+- this->x ^= T(s);\r
+- this->y ^= T(s);\r
+- this->z ^= T(s);\r
+- this->w ^= T(s);\r
++ this->x ^= T(s_);\r
++ this->y ^= T(s_);\r
++ this->z ^= T(s_);\r
++ this->w ^= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -619,12 +619,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<= (U s_)\r
+ {\r
+- this->x <<= T(s);\r
+- this->y <<= T(s);\r
+- this->z <<= T(s);\r
+- this->w <<= T(s);\r
++ this->x <<= T(s_);\r
++ this->y <<= T(s_);\r
++ this->z <<= T(s_);\r
++ this->w <<= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -644,12 +644,12 @@
+ \r
+ template <typename T>\r
+ template <typename U> \r
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>= (U s)\r
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>= (U s_)\r
+ {\r
+- this->x >>= T(s);\r
+- this->y >>= T(s);\r
+- this->z >>= T(s);\r
+- this->w >>= T(s);\r
++ this->x >>= T(s_);\r
++ this->y >>= T(s_);\r
++ this->z >>= T(s_);\r
++ this->w >>= T(s_);\r
+ return *this;\r
+ }\r
+ \r
+@@ -674,94 +674,94 @@
+ GLM_FUNC_QUALIFIER typename tvec4<T>::value_type \r
+ tvec4<T>::swizzle\r
+ ( \r
+- comp x\r
++ comp x_\r
+ ) const\r
+ {\r
+- return (*this)[x];\r
++ return (*this)[x_];\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec2<T> tvec4<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y\r
++ comp x_, \r
++ comp y_\r
+ ) const\r
+ {\r
+ return tvec2<T>(\r
+- (*this)[x],\r
+- (*this)[y]);\r
++ (*this)[x_],\r
++ (*this)[y_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec3<T> tvec4<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z\r
++ comp x_, \r
++ comp y_, \r
++ comp z_\r
+ ) const\r
+ {\r
+ return tvec3<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z]);\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> tvec4<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z, \r
+- comp w\r
++ comp x_, \r
++ comp y_, \r
++ comp z_, \r
++ comp w_\r
+ ) const\r
+ {\r
+ return tvec4<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z],\r
+- (*this)[w]);\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_],\r
++ (*this)[w_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tref2<T> tvec4<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y\r
++ comp x_, \r
++ comp y_\r
+ )\r
+ {\r
+ return tref2<T>(\r
+- (*this)[x],\r
+- (*this)[y]);\r
++ (*this)[x_],\r
++ (*this)[y_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tref3<T> tvec4<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z\r
++ comp x_, \r
++ comp y_, \r
++ comp z_\r
+ )\r
+ {\r
+ return tref3<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z]);\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_]);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle\r
+ (\r
+- comp x, \r
+- comp y, \r
+- comp z, \r
+- comp w\r
++ comp x_, \r
++ comp y_, \r
++ comp z_, \r
++ comp w_\r
+ )\r
+ {\r
+ return tref4<T>(\r
+- (*this)[x],\r
+- (*this)[y],\r
+- (*this)[z],\r
+- (*this)[w]);\r
++ (*this)[x_],\r
++ (*this)[y_],\r
++ (*this)[z_],\r
++ (*this)[w_]);\r
+ }\r
+ \r
+ //////////////////////////////////////\r
+@@ -771,28 +771,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator+ \r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x + s,\r
+- v.y + s,\r
+- v.z + s,\r
+- v.w + s);\r
++ v.x + s_,\r
++ v.y + s_,\r
++ v.z + s_,\r
++ v.w + s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec4<T> operator+ \r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s + v.x,\r
+- s + v.y,\r
+- s + v.z,\r
+- s + v.w);\r
++ s_ + v.x,\r
++ s_ + v.y,\r
++ s_ + v.z,\r
++ s_ + v.w);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -814,28 +814,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator- \r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x - s,\r
+- v.y - s,\r
+- v.z - s,\r
+- v.w - s);\r
++ v.x - s_,\r
++ v.y - s_,\r
++ v.z - s_,\r
++ v.w - s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec4<T> operator- \r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s - v.x,\r
+- s - v.y,\r
+- s - v.z,\r
+- s - v.w);\r
++ s_ - v.x,\r
++ s_ - v.y,\r
++ s_ - v.z,\r
++ s_ - v.w);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -857,28 +857,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator* \r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x * s,\r
+- v.y * s,\r
+- v.z * s,\r
+- v.w * s);\r
++ v.x * s_,\r
++ v.y * s_,\r
++ v.z * s_,\r
++ v.w * s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec4<T> operator* \r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s * v.x,\r
+- s * v.y,\r
+- s * v.z,\r
+- s * v.w);\r
++ s_ * v.x,\r
++ s_ * v.y,\r
++ s_ * v.z,\r
++ s_ * v.w);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -900,28 +900,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator/ \r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x / s,\r
+- v.y / s,\r
+- v.z / s,\r
+- v.w / s);\r
++ v.x / s_,\r
++ v.y / s_,\r
++ v.z / s_,\r
++ v.w / s_);\r
+ }\r
+ \r
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tvec4<T> operator/ \r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s / v.x,\r
+- s / v.y,\r
+- s / v.z,\r
+- s / v.w);\r
++ s_ / v.x,\r
++ s_ / v.y,\r
++ s_ / v.z,\r
++ s_ / v.w);\r
+ }\r
+ \r
+ template <typename T> \r
+@@ -1012,28 +1012,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator% \r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x % s,\r
+- v.y % s,\r
+- v.z % s,\r
+- v.w % s);\r
++ v.x % s_,\r
++ v.y % s_,\r
++ v.z % s_,\r
++ v.w % s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> operator% \r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s % v.x,\r
+- s % v.y,\r
+- s % v.z,\r
+- s % v.w);\r
++ s_ % v.x,\r
++ s_ % v.y,\r
++ s_ % v.z,\r
++ s_ % v.w);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1054,28 +1054,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator& \r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x & s,\r
+- v.y & s,\r
+- v.z & s,\r
+- v.w & s);\r
++ v.x & s_,\r
++ v.y & s_,\r
++ v.z & s_,\r
++ v.w & s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> operator& \r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s & v.x,\r
+- s & v.y,\r
+- s & v.z,\r
+- s & v.w);\r
++ s_ & v.x,\r
++ s_ & v.y,\r
++ s_ & v.z,\r
++ s_ & v.w);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1096,28 +1096,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator|\r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x | s,\r
+- v.y | s,\r
+- v.z | s,\r
+- v.w | s);\r
++ v.x | s_,\r
++ v.y | s_,\r
++ v.z | s_,\r
++ v.w | s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> operator|\r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s | v.x,\r
+- s | v.y,\r
+- s | v.z,\r
+- s | v.w);\r
++ s_ | v.x,\r
++ s_ | v.y,\r
++ s_ | v.z,\r
++ s_ | v.w);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1138,28 +1138,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator^\r
+ (\r
+ tvec4<T> const & v, \r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x ^ s,\r
+- v.y ^ s,\r
+- v.z ^ s,\r
+- v.w ^ s);\r
++ v.x ^ s_,\r
++ v.y ^ s_,\r
++ v.z ^ s_,\r
++ v.w ^ s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> operator^\r
+ (\r
+- typename tvec4<T>::value_type const & s, \r
++ typename tvec4<T>::value_type const & s_, \r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s ^ v.x,\r
+- s ^ v.y,\r
+- s ^ v.z,\r
+- s ^ v.w);\r
++ s_ ^ v.x,\r
++ s_ ^ v.y,\r
++ s_ ^ v.z,\r
++ s_ ^ v.w);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1180,28 +1180,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator<<\r
+ (\r
+ tvec4<T> const & v,\r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x << s,\r
+- v.y << s,\r
+- v.z << s,\r
+- v.w << s);\r
++ v.x << s_,\r
++ v.y << s_,\r
++ v.z << s_,\r
++ v.w << s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> operator<<\r
+ (\r
+- typename tvec4<T>::value_type const & s,\r
++ typename tvec4<T>::value_type const & s_,\r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s << v.x,\r
+- s << v.y,\r
+- s << v.z,\r
+- s << v.w);\r
++ s_ << v.x,\r
++ s_ << v.y,\r
++ s_ << v.z,\r
++ s_ << v.w);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1222,28 +1222,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator>>\r
+ (\r
+ tvec4<T> const & v,\r
+- typename tvec4<T>::value_type const & s\r
++ typename tvec4<T>::value_type const & s_\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- v.x >> s,\r
+- v.y >> s,\r
+- v.z >> s,\r
+- v.w >> s);\r
++ v.x >> s_,\r
++ v.y >> s_,\r
++ v.z >> s_,\r
++ v.w >> s_);\r
+ }\r
+ \r
+ template <typename T>\r
+ GLM_FUNC_QUALIFIER tvec4<T> operator>>\r
+ (\r
+- typename tvec4<T>::value_type const & s,\r
++ typename tvec4<T>::value_type const & s_,\r
+ tvec4<T> const & v\r
+ )\r
+ {\r
+ return tvec4<T>(\r
+- s >> v.x,\r
+- s >> v.y,\r
+- s >> v.z,\r
+- s >> v.w);\r
++ s_ >> v.x,\r
++ s_ >> v.y,\r
++ s_ >> v.z,\r
++ s_ >> v.w);\r
+ }\r
+ \r
+ template <typename T>\r
+@@ -1279,15 +1279,15 @@
+ template <typename T> \r
+ tref4<T>::tref4\r
+ (\r
+- T & x, \r
+- T & y, \r
+- T & z, \r
+- T & w\r
+- ) :\r
+- x(x),\r
+- y(y),\r
+- z(z),\r
+- w(w)\r
++ T & x_, \r
++ T & y_, \r
++ T & z_, \r
++ T & w_\r
++ ) :\r
++ x(x_),\r
++ y(y_),\r
++ z(z_),\r
++ w(w_)\r
+ {}\r
+ \r
+ template <typename T> \r
+diff -ur glm.org/glm/gtc/quaternion.inl glm/glm/gtc/quaternion.inl
+--- glm.org/glm/gtc/quaternion.inl 2013-12-08 17:04:59.707365220 +0100
++++ glm/glm/gtc/quaternion.inl 2013-12-08 17:07:20.081840460 +0100
+@@ -60,15 +60,15 @@
+ template <typename T> \r
+ GLM_FUNC_QUALIFIER tquat<T>::tquat\r
+ (\r
+- value_type const & w, \r
+- value_type const & x, \r
+- value_type const & y, \r
+- value_type const & z\r
++ value_type const & w_, \r
++ value_type const & x_, \r
++ value_type const & y_, \r
++ value_type const & z_\r
+ ) :\r
+- x(x),\r
+- y(y),\r
+- z(z),\r
+- w(w)\r
++ x(x_),\r
++ y(y_),\r
++ z(z_),\r
++ w(w_)\r
+ {}\r
+ \r
+ //////////////////////////////////////////////////////////////\r
--- /dev/null
+diff -ur glm.org/glm/core/_detail.hpp glm/glm/core/_detail.hpp
+--- glm.org/glm/core/_detail.hpp 2013-12-09 02:05:30.115442079 +0100
++++ glm/glm/core/_detail.hpp 2013-12-09 02:06:33.749941584 +0100
+@@ -136,12 +136,12 @@
+ i(0)
+ {}
+
+- GLM_FUNC_QUALIFIER uif32(float f) :
+- f(f)
++ GLM_FUNC_QUALIFIER uif32(float f_) :
++ f(f_)
+ {}
+
+- GLM_FUNC_QUALIFIER uif32(unsigned int i) :
+- i(i)
++ GLM_FUNC_QUALIFIER uif32(unsigned int i_) :
++ i(i_)
+ {}
+
+ float f;
+@@ -154,12 +154,12 @@
+ i(0)
+ {}
+
+- GLM_FUNC_QUALIFIER uif64(double f) :
+- f(f)
++ GLM_FUNC_QUALIFIER uif64(double f_) :
++ f(f_)
+ {}
+
+- GLM_FUNC_QUALIFIER uif64(uint64 i) :
+- i(i)
++ GLM_FUNC_QUALIFIER uif64(uint64 i_) :
++ i(i_)
+ {}
+
+ double f;
+diff -ur glm.org/glm/core/type_vec1.hpp glm/glm/core/type_vec1.hpp
+--- glm.org/glm/core/type_vec1.hpp 2013-12-08 17:04:59.706365245 +0100
++++ glm/glm/core/type_vec1.hpp 2013-12-08 17:07:20.079840510 +0100
+@@ -86,19 +86,19 @@
+ GLM_FUNC_DECL explicit tvec1(
+ ctor);
+ GLM_FUNC_DECL explicit tvec1(
+- value_type const & s);
++ value_type const & s_);
+
+ //////////////////////////////////////
+ // Swizzle constructors
+
+- GLM_FUNC_DECL tvec1(tref1<T> const & r);
++ GLM_FUNC_DECL tvec1(tref1<T> const & r_);
+
+ //////////////////////////////////////
+ // Convertion scalar constructors
+
+ //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+ template <typename U>
+- GLM_FUNC_DECL explicit tvec1(U const & s);
++ GLM_FUNC_DECL explicit tvec1(U const & s_);
+
+ //////////////////////////////////////
+ // Convertion vector constructors
+@@ -121,19 +121,19 @@
+ GLM_FUNC_DECL tvec1<T> & operator= (tvec1<U> const & v);
+
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator+=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator+=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator+=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator-=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator-=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator-=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator*=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator*=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator*=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator/=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator/=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator/=(tvec1<U> const & v);
+ GLM_FUNC_DECL tvec1<T> & operator++();
+@@ -143,27 +143,27 @@
+ // Unary bit operators
+
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator%=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator%=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator%=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator&=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator&=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator&=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator|=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator|=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator|=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator^=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator^=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator^=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator<<=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator<<=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator<<=(tvec1<U> const & v);
+ template <typename U>
+- GLM_FUNC_DECL tvec1<T> & operator>>=(U const & s);
++ GLM_FUNC_DECL tvec1<T> & operator>>=(U const & s_);
+ template <typename U>
+ GLM_FUNC_DECL tvec1<T> & operator>>=(tvec1<U> const & v);
+
+diff -ur glm.org/glm/core/type_vec1.inl glm/glm/core/type_vec1.inl
+--- glm.org/glm/core/type_vec1.inl 2013-12-08 17:04:59.707365220 +0100
++++ glm/glm/core/type_vec1.inl 2013-12-08 17:07:20.081840460 +0100
+@@ -87,9 +87,9 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+ (
+- value_type const & s
++ value_type const & s_
+ ) :
+- x(s)
++ x(s_)
+ {}
+
+ //////////////////////////////////////
+@@ -98,9 +98,9 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+ (
+- tref1<T> const & r
++ tref1<T> const & r_
+ ) :
+- x(r.x)
++ x(r_.x)
+ {}
+
+ //////////////////////////////////////
+@@ -110,9 +110,9 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+ (
+- U const & s
++ U const & s_
+ ) :
+- x(value_type(s))
++ x(value_type(s_))
+ {}
+
+ //////////////////////////////////////
+@@ -173,10 +173,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator+=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x += T(s);
++ this->x += T(s_);
+ return *this;
+ }
+
+@@ -195,10 +195,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator-=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x -= T(s);
++ this->x -= T(s_);
+ return *this;
+ }
+
+@@ -217,10 +217,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator*=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x *= T(s);
++ this->x *= T(s_);
+ return *this;
+ }
+
+@@ -239,10 +239,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator/=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x /= T(s);
++ this->x /= T(s_);
+ return *this;
+ }
+
+@@ -301,10 +301,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator%=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x %= T(s);
++ this->x %= T(s_);
+ return *this;
+ }
+
+@@ -323,10 +323,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator&=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x &= T(s);
++ this->x &= T(s_);
+ return *this;
+ }
+
+@@ -345,10 +345,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator|=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x |= T(s);
++ this->x |= T(s_);
+ return *this;
+ }
+
+@@ -367,10 +367,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator^=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x ^= T(s);
++ this->x ^= T(s_);
+ return *this;
+ }
+
+@@ -389,10 +389,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator<<=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x <<= T(s);
++ this->x <<= T(s_);
+ return *this;
+ }
+
+@@ -411,10 +411,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator>>=
+ (
+- U const & s
++ U const & s_
+ )
+ {
+- this->x >>= T(s);
++ this->x >>= T(s_);
+ return *this;
+ }
+
+@@ -434,21 +434,21 @@
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER T
+- tvec1<T>::swizzle(comp x) const
++ tvec1<T>::swizzle(comp x_) const
+ {
+- return (*this)[x];
++ return (*this)[x_];
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec2<T>
+ tvec1<T>::swizzle
+ (
+- comp x,
++ comp x_,
+ comp y
+ ) const
+ {
+ return tvec2<T>(
+- (*this)[x],
++ (*this)[x_],
+ (*this)[y]);
+ }
+
+@@ -456,13 +456,13 @@
+ GLM_FUNC_QUALIFIER tvec3<T>
+ tvec1<T>::swizzle
+ (
+- comp x,
++ comp x_,
+ comp y,
+ comp z
+ ) const
+ {
+ return tvec3<T>(
+- (*this)[x],
++ (*this)[x_],
+ (*this)[y],
+ (*this)[z]);
+ }
+@@ -471,14 +471,14 @@
+ GLM_FUNC_QUALIFIER tvec4<T>
+ tvec1<T>::swizzle
+ (
+- comp x,
++ comp x_,
+ comp y,
+ comp z,
+ comp w
+ ) const
+ {
+ return tvec4<T>(
+- (*this)[x],
++ (*this)[x_],
+ (*this)[y],
+ (*this)[z],
+ (*this)[w]);
+@@ -488,11 +488,11 @@
+ GLM_FUNC_QUALIFIER tref1<T>
+ tvec1<T>::swizzle
+ (
+- comp x
++ comp x_
+ )
+ {
+ return tref1<T>(
+- (*this)[x]);
++ (*this)[x_]);
+ }
+
+ //////////////////////////////////////
+@@ -502,22 +502,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator+
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x + s);
++ v.x + s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator+
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s + v.x);
++ s_ + v.x);
+ }
+
+ template <typename T>
+@@ -536,22 +536,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator-
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x - s);
++ v.x - s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator-
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s - v.x);
++ s_ - v.x);
+ }
+
+ template <typename T>
+@@ -570,22 +570,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator*
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x * s);
++ v.x * s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator*
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s * v.x);
++ s_ * v.x);
+ }
+
+ template <typename T>
+@@ -604,22 +604,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator/
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x / s);
++ v.x / s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator/
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s / v.x);
++ s_ / v.x);
+ }
+
+ template <typename T>
+@@ -673,22 +673,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator%
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x % s);
++ v.x % s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator%
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s % v.x);
++ s_ % v.x);
+ }
+
+ template <typename T>
+@@ -706,22 +706,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator&
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x & s);
++ v.x & s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator&
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s & v.x);
++ s_ & v.x);
+ }
+
+ template <typename T>
+@@ -739,22 +739,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator|
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x | s);
++ v.x | s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator|
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s | v.x);
++ s_ | v.x);
+ }
+
+ template <typename T>
+@@ -772,22 +772,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator^
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x ^ s);
++ v.x ^ s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator^
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s ^ v.x);
++ s_ ^ v.x);
+ }
+
+ template <typename T>
+@@ -805,22 +805,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator<<
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x << s);
++ v.x << s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator<<
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s << v.x);
++ s_ << v.x);
+ }
+
+ template <typename T>
+@@ -838,22 +838,22 @@
+ GLM_FUNC_QUALIFIER tvec1<T> operator>>
+ (
+ tvec1<T> const & v,
+- typename tvec1<T>::value_type const & s
++ typename tvec1<T>::value_type const & s_
+ )
+ {
+ return tvec1<T>(
+- v.x >> s);
++ v.x >> s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec1<T> operator>>
+ (
+- typename tvec1<T>::value_type const & s,
++ typename tvec1<T>::value_type const & s_,
+ tvec1<T> const & v
+ )
+ {
+ return tvec1<T>(
+- s >> v.x);
++ s_ >> v.x);
+ }
+
+ template <typename T>
+@@ -883,9 +883,9 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref1<T>::tref1
+ (
+- T & x
++ T & x_
+ ) :
+- x(x)
++ x(x_)
+ {}
+
+ template <typename T>
+diff -ur glm.org/glm/core/type_vec2.inl glm/glm/core/type_vec2.inl
+--- glm.org/glm/core/type_vec2.inl 2013-12-08 17:04:59.705365270 +0100
++++ glm/glm/core/type_vec2.inl 2013-12-08 17:07:20.078840535 +0100
+@@ -91,10 +91,10 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+ (
+- value_type const & s
++ value_type const & s_
+ ) :
+- x(s),
+- y(s)
++ x(s_),
++ y(s_)
+ {}
+
+ template <typename T>
+@@ -113,10 +113,10 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+ (
+- tref2<T> const & r
++ tref2<T> const & r_
+ ) :
+- x(r.x),
+- y(r.y)
++ x(r_.x),
++ y(r_.y)
+ {}
+
+ //////////////////////////////////////
+@@ -126,10 +126,10 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+ (
+- U const & x
++ U const & x_
+ ) :
+- x(value_type(x)),
+- y(value_type(x))
++ x(value_type(x_)),
++ y(value_type(x_))
+ {}
+
+ template <typename T>
+@@ -204,10 +204,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=(U s_)
+ {
+- this->x += T(s);
+- this->y += T(s);
++ this->x += T(s_);
++ this->y += T(s_);
+ return *this;
+ }
+
+@@ -225,10 +225,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=(U s_)
+ {
+- this->x -= T(s);
+- this->y -= T(s);
++ this->x -= T(s_);
++ this->y -= T(s_);
+ return *this;
+ }
+
+@@ -246,10 +246,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=(U s_)
+ {
+- this->x *= T(s);
+- this->y *= T(s);
++ this->x *= T(s_);
++ this->y *= T(s_);
+ return *this;
+ }
+
+@@ -267,10 +267,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=(U s_)
+ {
+- this->x /= T(s);
+- this->y /= T(s);
++ this->x /= T(s_);
++ this->y /= T(s_);
+ return *this;
+ }
+
+@@ -330,10 +330,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=(U s_)
+ {
+- this->x %= T(s);
+- this->y %= T(s);
++ this->x %= T(s_);
++ this->y %= T(s_);
+ return *this;
+ }
+
+@@ -351,10 +351,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=(U s_)
+ {
+- this->x &= T(s);
+- this->y &= T(s);
++ this->x &= T(s_);
++ this->y &= T(s_);
+ return *this;
+ }
+
+@@ -372,10 +372,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=(U s_)
+ {
+- this->x |= T(s);
+- this->y |= T(s);
++ this->x |= T(s_);
++ this->y |= T(s_);
+ return *this;
+ }
+
+@@ -393,10 +393,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=(U s_)
+ {
+- this->x ^= T(s);
+- this->y ^= T(s);
++ this->x ^= T(s_);
++ this->y ^= T(s_);
+ return *this;
+ }
+
+@@ -414,10 +414,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=(U s_)
+ {
+- this->x <<= T(s);
+- this->y <<= T(s);
++ this->x <<= T(s_);
++ this->y <<= T(s_);
+ return *this;
+ }
+
+@@ -435,10 +435,10 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=(U s)
++ GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=(U s_)
+ {
+- this->x >>= T(s);
+- this->y >>= T(s);
++ this->x >>= T(s_);
++ this->y >>= T(s_);
+ return *this;
+ }
+
+@@ -460,50 +460,50 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER typename tvec2<T>::value_type tvec2<T>::swizzle
+ (
+- comp x
++ comp x_
+ ) const
+ {
+- return (*this)[x];
++ return (*this)[x_];
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec2<T> tvec2<T>::swizzle
+ (
+- comp x,
+- comp y
++ comp x_,
++ comp y_
+ ) const
+ {
+ return tvec2<T>(
+- (*this)[x],
+- (*this)[y]);
++ (*this)[x_],
++ (*this)[y_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> tvec2<T>::swizzle
+ (
+- comp x,
+- comp y,
++ comp x_,
++ comp y_,
+ comp z
+ ) const
+ {
+ return tvec3<T>(
+- (*this)[x],
+- (*this)[y],
++ (*this)[x_],
++ (*this)[y_],
+ (*this)[z]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> tvec2<T>::swizzle
+ (
+- comp x,
+- comp y,
++ comp x_,
++ comp y_,
+ comp z,
+ comp w
+ ) const
+ {
+ return tvec4<T>(
+- (*this)[x],
+- (*this)[y],
++ (*this)[x_],
++ (*this)[y_],
+ (*this)[z],
+ (*this)[w]);
+ }
+@@ -511,13 +511,13 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref2<T> tvec2<T>::swizzle
+ (
+- comp x,
+- comp y
++ comp x_,
++ comp y_
+ )
+ {
+ return tref2<T>(
+- (*this)[x],
+- (*this)[y]);
++ (*this)[x_],
++ (*this)[y_]);
+ }
+
+ //////////////////////////////////////
+@@ -527,12 +527,12 @@
+ GLM_FUNC_QUALIFIER tvec2<T> operator+
+ (
+ tvec2<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec2<T>(
+- v.x + T(s),
+- v.y + T(s));
++ v.x + T(s_),
++ v.y + T(s_));
+ }
+
+ template <typename T>
+@@ -942,11 +942,11 @@
+ template <typename T>
+ tref2<T>::tref2
+ (
+- T & x,
+- T & y
++ T & x_,
++ T & y_
+ ) :
+- x(x),
+- y(y)
++ x(x_),
++ y(y_)
+ {}
+
+ template <typename T>
+diff -ur glm.org/glm/core/type_vec3.hpp glm/glm/core/type_vec3.hpp
+--- glm.org/glm/core/type_vec3.hpp 2013-12-08 17:04:59.707365220 +0100
++++ glm/glm/core/type_vec3.hpp 2013-12-08 17:07:20.081840460 +0100
+@@ -170,15 +170,15 @@
+ }
+
+ template <int E0, int E1>
+- GLM_FUNC_DECL tvec3(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & s)
++ GLM_FUNC_DECL tvec3(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & s_)
+ {
+- *this = tvec3<T>(v(), s);
++ *this = tvec3<T>(v(), s_);
+ }
+
+ template <int E0, int E1>
+- GLM_FUNC_DECL tvec3(T const & s, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)
++ GLM_FUNC_DECL tvec3(T const & s_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)
+ {
+- *this = tvec3<T>(s, v());
++ *this = tvec3<T>(s_, v());
+ }
+
+ //////////////////////////////////////
+diff -ur glm.org/glm/core/type_vec3.inl glm/glm/core/type_vec3.inl
+--- glm.org/glm/core/type_vec3.inl 2013-12-08 17:04:59.706365245 +0100
++++ glm/glm/core/type_vec3.inl 2013-12-08 17:07:20.079840510 +0100
+@@ -93,11 +93,11 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+- value_type const & s
++ value_type const & s_
+ ) :
+- x(s),
+- y(s),
+- z(s)
++ x(s_),
++ y(s_),
++ z(s_)
+ {}
+
+ template <typename T>
+@@ -118,11 +118,11 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+- tref3<T> const & r
++ tref3<T> const & r_
+ ) :
+- x(r.x),
+- y(r.y),
+- z(r.z)
++ x(r_.x),
++ y(r_.y),
++ z(r_.z)
+ {}
+
+ template <typename T>
+@@ -130,21 +130,21 @@
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+ tref2<A> const & v,
+- B const & s
++ B const & s_
+ ) :
+ x(value_type(v.x)),
+ y(value_type(v.y)),
+- z(value_type(s))
++ z(value_type(s_))
+ {}
+
+ template <typename T>
+ template <typename A, typename B>
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+- A const & s,
++ A const & s_,
+ tref2<B> const & v
+ ) :
+- x(value_type(s)),
++ x(value_type(s_)),
+ y(value_type(v.x)),
+ z(value_type(v.y))
+ {}
+@@ -156,24 +156,24 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+- U const & s
++ U const & s_
+ ) :
+- x(value_type(s)),
+- y(value_type(s)),
+- z(value_type(s))
++ x(value_type(s_)),
++ y(value_type(s_)),
++ z(value_type(s_))
+ {}
+
+ template <typename T>
+ template <typename A, typename B, typename C>
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+- A const & x,
+- B const & y,
+- C const & z
++ A const & x_,
++ B const & y_,
++ C const & z_
+ ) :
+- x(value_type(x)),
+- y(value_type(y)),
+- z(value_type(z))
++ x(value_type(x_)),
++ y(value_type(y_)),
++ z(value_type(z_))
+ {}
+
+ //////////////////////////////////////
+@@ -184,21 +184,21 @@
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+ tvec2<A> const & v,
+- B const & s
++ B const & s_
+ ) :
+ x(value_type(v.x)),
+ y(value_type(v.y)),
+- z(value_type(s))
++ z(value_type(s_))
+ {}
+
+ template <typename T>
+ template <typename A, typename B>
+ GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+ (
+- A const & s,
++ A const & s_,
+ tvec2<B> const & v
+ ) :
+- x(value_type(s)),
++ x(value_type(s_)),
+ y(value_type(v.x)),
+ z(value_type(v.y))
+ {}
+@@ -255,11 +255,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=(U s_)
+ {
+- this->x += T(s);
+- this->y += T(s);
+- this->z += T(s);
++ this->x += T(s_);
++ this->y += T(s_);
++ this->z += T(s_);
+ return *this;
+ }
+
+@@ -278,11 +278,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=(U s_)
+ {
+- this->x -= T(s);
+- this->y -= T(s);
+- this->z -= T(s);
++ this->x -= T(s_);
++ this->y -= T(s_);
++ this->z -= T(s_);
+ return *this;
+ }
+
+@@ -301,11 +301,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=(U s_)
+ {
+- this->x *= T(s);
+- this->y *= T(s);
+- this->z *= T(s);
++ this->x *= T(s_);
++ this->y *= T(s_);
++ this->z *= T(s_);
+ return *this;
+ }
+
+@@ -324,11 +324,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=(U s_)
+ {
+- this->x /= T(s);
+- this->y /= T(s);
+- this->z /= T(s);
++ this->x /= T(s_);
++ this->y /= T(s_);
++ this->z /= T(s_);
+ return *this;
+ }
+
+@@ -391,11 +391,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=(U s_)
+ {
+- this->x %= s;
+- this->y %= s;
+- this->z %= s;
++ this->x %= s_;
++ this->y %= s_;
++ this->z %= s_;
+ return *this;
+ }
+
+@@ -414,11 +414,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=(U s_)
+ {
+- this->x &= s;
+- this->y &= s;
+- this->z &= s;
++ this->x &= s_;
++ this->y &= s_;
++ this->z &= s_;
+ return *this;
+ }
+
+@@ -437,11 +437,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=(U s_)
+ {
+- this->x |= s;
+- this->y |= s;
+- this->z |= s;
++ this->x |= s_;
++ this->y |= s_;
++ this->z |= s_;
+ return *this;
+ }
+
+@@ -460,11 +460,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=(U s_)
+ {
+- this->x ^= s;
+- this->y ^= s;
+- this->z ^= s;
++ this->x ^= s_;
++ this->y ^= s_;
++ this->z ^= s_;
+ return *this;
+ }
+
+@@ -483,11 +483,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=(U s_)
+ {
+- this->x <<= s;
+- this->y <<= s;
+- this->z <<= s;
++ this->x <<= s_;
++ this->y <<= s_;
++ this->z <<= s_;
+ return *this;
+ }
+
+@@ -506,11 +506,11 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=(U s)
++ GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=(U s_)
+ {
+- this->x >>= T(s);
+- this->y >>= T(s);
+- this->z >>= T(s);
++ this->x >>= T(s_);
++ this->y >>= T(s_);
++ this->z >>= T(s_);
+ return *this;
+ }
+
+@@ -534,78 +534,78 @@
+ GLM_FUNC_QUALIFIER typename tvec3<T>::value_type
+ tvec3<T>::swizzle
+ (
+- comp x
++ comp x_
+ ) const
+ {
+- return (*this)[x];
++ return (*this)[x_];
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec2<T> tvec3<T>::swizzle
+ (
+- comp x,
+- comp y
++ comp x_,
++ comp y_
+ ) const
+ {
+ return tvec2<T>(
+- (*this)[x],
+- (*this)[y]);
++ (*this)[x_],
++ (*this)[y_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> tvec3<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z
++ comp x_,
++ comp y_,
++ comp z_
+ ) const
+ {
+ return tvec3<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z]);
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> tvec3<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z,
++ comp x_,
++ comp y_,
++ comp z_,
+ comp w
+ ) const
+ {
+ return tvec4<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z],
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_],
+ (*this)[w]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref2<T> tvec3<T>::swizzle
+ (
+- comp x,
+- comp y
++ comp x_,
++ comp y_
+ )
+ {
+ return tref2<T>(
+- (*this)[x],
+- (*this)[y]);
++ (*this)[x_],
++ (*this)[y_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z
++ comp x_,
++ comp y_,
++ comp z_
+ )
+ {
+ return tref3<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z]);
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_]);
+ }
+
+ //////////////////////////////////////
+@@ -615,26 +615,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator+
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x + T(s),
+- v.y + T(s),
+- v.z + T(s));
++ v.x + T(s_),
++ v.y + T(s_),
++ v.z + T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator+
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) + v.x,
+- T(s) + v.y,
+- T(s) + v.z);
++ T(s_) + v.x,
++ T(s_) + v.y,
++ T(s_) + v.z);
+ }
+
+ template <typename T>
+@@ -655,26 +655,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator-
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x - T(s),
+- v.y - T(s),
+- v.z - T(s));
++ v.x - T(s_),
++ v.y - T(s_),
++ v.z - T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator-
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) - v.x,
+- T(s) - v.y,
+- T(s) - v.z);
++ T(s_) - v.x,
++ T(s_) - v.y,
++ T(s_) - v.z);
+ }
+
+ template <typename T>
+@@ -695,26 +695,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator*
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x * T(s),
+- v.y * T(s),
+- v.z * T(s));
++ v.x * T(s_),
++ v.y * T(s_),
++ v.z * T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator*
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) * v.x,
+- T(s) * v.y,
+- T(s) * v.z);
++ T(s_) * v.x,
++ T(s_) * v.y,
++ T(s_) * v.z);
+ }
+
+ template <typename T>
+@@ -735,26 +735,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator/
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x / T(s),
+- v.y / T(s),
+- v.z / T(s));
++ v.x / T(s_),
++ v.y / T(s_),
++ v.z / T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator/
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) / v.x,
+- T(s) / v.y,
+- T(s) / v.z);
++ T(s_) / v.x,
++ T(s_) / v.y,
++ T(s_) / v.z);
+ }
+
+ template <typename T>
+@@ -816,26 +816,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator%
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x % T(s),
+- v.y % T(s),
+- v.z % T(s));
++ v.x % T(s_),
++ v.y % T(s_),
++ v.z % T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator%
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) % v.x,
+- T(s) % v.y,
+- T(s) % v.z);
++ T(s_) % v.x,
++ T(s_) % v.y,
++ T(s_) % v.z);
+ }
+
+ template <typename T>
+@@ -855,26 +855,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator&
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x & T(s),
+- v.y & T(s),
+- v.z & T(s));
++ v.x & T(s_),
++ v.y & T(s_),
++ v.z & T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator&
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) & v.x,
+- T(s) & v.y,
+- T(s) & v.z);
++ T(s_) & v.x,
++ T(s_) & v.y,
++ T(s_) & v.z);
+ }
+
+ template <typename T>
+@@ -894,26 +894,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator|
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x | T(s),
+- v.y | T(s),
+- v.z | T(s));
++ v.x | T(s_),
++ v.y | T(s_),
++ v.z | T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator|
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) | v.x,
+- T(s) | v.y,
+- T(s) | v.z);
++ T(s_) | v.x,
++ T(s_) | v.y,
++ T(s_) | v.z);
+ }
+
+ template <typename T>
+@@ -933,26 +933,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator^
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x ^ T(s),
+- v.y ^ T(s),
+- v.z ^ T(s));
++ v.x ^ T(s_),
++ v.y ^ T(s_),
++ v.z ^ T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator^
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) ^ v.x,
+- T(s) ^ v.y,
+- T(s) ^ v.z);
++ T(s_) ^ v.x,
++ T(s_) ^ v.y,
++ T(s_) ^ v.z);
+ }
+
+ template <typename T>
+@@ -972,26 +972,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator<<
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x << T(s),
+- v.y << T(s),
+- v.z << T(s));
++ v.x << T(s_),
++ v.y << T(s_),
++ v.z << T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator<<
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- T(s) << v.x,
+- T(s) << v.y,
+- T(s) << v.z);
++ T(s_) << v.x,
++ T(s_) << v.y,
++ T(s_) << v.z);
+ }
+
+ template <typename T>
+@@ -1011,26 +1011,26 @@
+ GLM_FUNC_QUALIFIER tvec3<T> operator>>
+ (
+ tvec3<T> const & v,
+- T const & s
++ T const & s_
+ )
+ {
+ return tvec3<T>(
+- v.x >> T(s),
+- v.y >> T(s),
+- v.z >> T(s));
++ v.x >> T(s_),
++ v.y >> T(s_),
++ v.z >> T(s_));
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> operator>>
+ (
+- T const & s,
++ T const & s_,
+ tvec3<T> const & v
+ )
+ {
+ return tvec3<T>(
+- s >> T(v.x),
+- s >> T(v.y),
+- s >> T(v.z));
++ s_ >> T(v.x),
++ s_ >> T(v.y),
++ s_ >> T(v.z));
+ }
+
+ template <typename T>
+@@ -1062,10 +1062,10 @@
+ // tref definition
+
+ template <typename T>
+- GLM_FUNC_QUALIFIER tref3<T>::tref3(T & x, T & y, T & z) :
+- x(x),
+- y(y),
+- z(z)
++ GLM_FUNC_QUALIFIER tref3<T>::tref3(T & x_, T & y_, T & z_) :
++ x(x_),
++ y(y_),
++ z(z_)
+ {}
+
+ template <typename T>
+diff -ur glm.org/glm/core/type_vec4.hpp glm/glm/core/type_vec4.hpp
+--- glm.org/glm/core/type_vec4.hpp 2013-12-08 17:04:59.705365270 +0100
++++ glm/glm/core/type_vec4.hpp 2013-12-08 17:07:20.078840535 +0100
+@@ -177,33 +177,33 @@
+ }
+
+ template <int E0, int E1>
+- GLM_FUNC_DECL tvec4(T const & x, T const & y, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)
++ GLM_FUNC_DECL tvec4(T const & x_, T const & y_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v)
+ {
+- *this = tvec4<T>(x, y, v());
++ *this = tvec4<T>(x_, y_, v());
+ }
+
+ template <int E0, int E1>
+- GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & w)
++ GLM_FUNC_DECL tvec4(T const & x_, glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & w_)
+ {
+- *this = tvec4<T>(x, v(), w);
++ *this = tvec4<T>(x_, v(), w);
+ }
+
+ template <int E0, int E1>
+- GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & z, T const & w)
++ GLM_FUNC_DECL tvec4(glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2> const & v, T const & z_, T const & w_)
+ {
+- *this = tvec4<T>(v(), z, w);
++ *this = tvec4<T>(v(), z_, w_);
+ }
+
+ template <int E0, int E1, int E2>
+- GLM_FUNC_DECL tvec4(glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v, T const & w)
++ GLM_FUNC_DECL tvec4(glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v, T const & w_)
+ {
+- *this = tvec4<T>(v(), w);
++ *this = tvec4<T>(v(), w_);
+ }
+
+ template <int E0, int E1, int E2>
+- GLM_FUNC_DECL tvec4(T const & x, glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v)
++ GLM_FUNC_DECL tvec4(T const & x_, glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1> const & v)
+ {
+- *this = tvec4<T>(x, v());
++ *this = tvec4<T>(x_, v());
+ }
+
+ //////////////////////////////////////
+diff -ur glm.org/glm/core/type_vec4.inl glm/glm/core/type_vec4.inl
+--- glm.org/glm/core/type_vec4.inl 2013-12-08 17:04:59.706365245 +0100
++++ glm/glm/core/type_vec4.inl 2013-12-08 17:07:20.079840510 +0100
+@@ -95,12 +95,12 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+- value_type const & s
++ value_type const & s_
+ ) :
+- x(s),
+- y(s),
+- z(s),
+- w(s)
++ x(s_),
++ y(s_),
++ z(s_),
++ w(s_)
+ {}
+
+ template <typename T>
+@@ -123,12 +123,12 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+- tref4<T> const & r
++ tref4<T> const & r_
+ ) :
+- x(r.x),
+- y(r.y),
+- z(r.z),
+- w(r.w)
++ x(r_.x),
++ y(r_.y),
++ z(r_.z),
++ w(r_.w)
+ {}
+
+ template <typename T>
+@@ -178,22 +178,22 @@
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+ tref3<A> const & v,
+- B const & s
++ B const & s_
+ ) :
+ x(value_type(v.x)),
+ y(value_type(v.y)),
+ z(value_type(v.z)),
+- w(value_type(s))
++ w(value_type(s_))
+ {}
+
+ template <typename T>
+ template <typename A, typename B>
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+- A const & s,
++ A const & s_,
+ tref3<B> const & v
+ ) :
+- x(value_type(s)),
++ x(value_type(s_)),
+ y(value_type(v.x)),
+ z(value_type(v.y)),
+ w(value_type(v.z))
+@@ -245,27 +245,27 @@
+ template <typename U>
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+- U const & x
++ U const & x_
+ ) :
+- x(value_type(x)),
+- y(value_type(x)),
+- z(value_type(x)),
+- w(value_type(x))
++ x(value_type(x_)),
++ y(value_type(x_)),
++ z(value_type(x_)),
++ w(value_type(x_))
+ {}
+
+ template <typename T>
+ template <typename A, typename B, typename C, typename D>
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+- A const & x,
+- B const & y,
+- C const & z,
+- D const & w
+- ) :
+- x(value_type(x)),
+- y(value_type(y)),
+- z(value_type(z)),
+- w(value_type(w))
++ A const & x_,
++ B const & y_,
++ C const & z_,
++ D const & w_
++ ) :
++ x(value_type(x_)),
++ y(value_type(y_)),
++ z(value_type(z_)),
++ w(value_type(w_))
+ {}
+
+ //////////////////////////////////////
+@@ -318,22 +318,22 @@
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+ tvec3<A> const & v,
+- B const & s
++ B const & s_
+ ) :
+ x(value_type(v.x)),
+ y(value_type(v.y)),
+ z(value_type(v.z)),
+- w(value_type(s))
++ w(value_type(s_))
+ {}
+
+ template <typename T>
+ template <typename A, typename B>
+ GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+ (
+- A const & s,
++ A const & s_,
+ tvec3<B> const & v
+ ) :
+- x(value_type(s)),
++ x(value_type(s_)),
+ y(value_type(v.x)),
+ z(value_type(v.y)),
+ w(value_type(v.z))
+@@ -396,12 +396,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+= (U s_)
+ {
+- this->x += T(s);
+- this->y += T(s);
+- this->z += T(s);
+- this->w += T(s);
++ this->x += T(s_);
++ this->y += T(s_);
++ this->z += T(s_);
++ this->w += T(s_);
+ return *this;
+ }
+
+@@ -421,12 +421,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-= (U s_)
+ {
+- this->x -= T(s);
+- this->y -= T(s);
+- this->z -= T(s);
+- this->w -= T(s);
++ this->x -= T(s_);
++ this->y -= T(s_);
++ this->z -= T(s_);
++ this->w -= T(s_);
+ return *this;
+ }
+
+@@ -446,12 +446,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*= (U s_)
+ {
+- this->x *= T(s);
+- this->y *= T(s);
+- this->z *= T(s);
+- this->w *= T(s);
++ this->x *= T(s_);
++ this->y *= T(s_);
++ this->z *= T(s_);
++ this->w *= T(s_);
+ return *this;
+ }
+
+@@ -471,12 +471,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/= (U s_)
+ {
+- this->x /= T(s);
+- this->y /= T(s);
+- this->z /= T(s);
+- this->w /= T(s);
++ this->x /= T(s_);
++ this->y /= T(s_);
++ this->z /= T(s_);
++ this->w /= T(s_);
+ return *this;
+ }
+
+@@ -519,12 +519,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%= (U s_)
+ {
+- this->x %= T(s);
+- this->y %= T(s);
+- this->z %= T(s);
+- this->w %= T(s);
++ this->x %= T(s_);
++ this->y %= T(s_);
++ this->z %= T(s_);
++ this->w %= T(s_);
+ return *this;
+ }
+
+@@ -544,12 +544,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&= (U s_)
+ {
+- this->x &= T(s);
+- this->y &= T(s);
+- this->z &= T(s);
+- this->w &= T(s);
++ this->x &= T(s_);
++ this->y &= T(s_);
++ this->z &= T(s_);
++ this->w &= T(s_);
+ return *this;
+ }
+
+@@ -569,12 +569,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|= (U s_)
+ {
+- this->x |= T(s);
+- this->y |= T(s);
+- this->z |= T(s);
+- this->w |= T(s);
++ this->x |= T(s_);
++ this->y |= T(s_);
++ this->z |= T(s_);
++ this->w |= T(s_);
+ return *this;
+ }
+
+@@ -594,12 +594,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^= (U s_)
+ {
+- this->x ^= T(s);
+- this->y ^= T(s);
+- this->z ^= T(s);
+- this->w ^= T(s);
++ this->x ^= T(s_);
++ this->y ^= T(s_);
++ this->z ^= T(s_);
++ this->w ^= T(s_);
+ return *this;
+ }
+
+@@ -619,12 +619,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<= (U s_)
+ {
+- this->x <<= T(s);
+- this->y <<= T(s);
+- this->z <<= T(s);
+- this->w <<= T(s);
++ this->x <<= T(s_);
++ this->y <<= T(s_);
++ this->z <<= T(s_);
++ this->w <<= T(s_);
+ return *this;
+ }
+
+@@ -644,12 +644,12 @@
+
+ template <typename T>
+ template <typename U>
+- GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>= (U s)
++ GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>= (U s_)
+ {
+- this->x >>= T(s);
+- this->y >>= T(s);
+- this->z >>= T(s);
+- this->w >>= T(s);
++ this->x >>= T(s_);
++ this->y >>= T(s_);
++ this->z >>= T(s_);
++ this->w >>= T(s_);
+ return *this;
+ }
+
+@@ -674,94 +674,94 @@
+ GLM_FUNC_QUALIFIER typename tvec4<T>::value_type
+ tvec4<T>::swizzle
+ (
+- comp x
++ comp x_
+ ) const
+ {
+- return (*this)[x];
++ return (*this)[x_];
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec2<T> tvec4<T>::swizzle
+ (
+- comp x,
+- comp y
++ comp x_,
++ comp y_
+ ) const
+ {
+ return tvec2<T>(
+- (*this)[x],
+- (*this)[y]);
++ (*this)[x_],
++ (*this)[y_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec3<T> tvec4<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z
++ comp x_,
++ comp y_,
++ comp z_
+ ) const
+ {
+ return tvec3<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z]);
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> tvec4<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z,
+- comp w
++ comp x_,
++ comp y_,
++ comp z_,
++ comp w_
+ ) const
+ {
+ return tvec4<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z],
+- (*this)[w]);
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_],
++ (*this)[w_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref2<T> tvec4<T>::swizzle
+ (
+- comp x,
+- comp y
++ comp x_,
++ comp y_
+ )
+ {
+ return tref2<T>(
+- (*this)[x],
+- (*this)[y]);
++ (*this)[x_],
++ (*this)[y_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref3<T> tvec4<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z
++ comp x_,
++ comp y_,
++ comp z_
+ )
+ {
+ return tref3<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z]);
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_]);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle
+ (
+- comp x,
+- comp y,
+- comp z,
+- comp w
++ comp x_,
++ comp y_,
++ comp z_,
++ comp w_
+ )
+ {
+ return tref4<T>(
+- (*this)[x],
+- (*this)[y],
+- (*this)[z],
+- (*this)[w]);
++ (*this)[x_],
++ (*this)[y_],
++ (*this)[z_],
++ (*this)[w_]);
+ }
+
+ //////////////////////////////////////
+@@ -771,28 +771,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator+
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x + s,
+- v.y + s,
+- v.z + s,
+- v.w + s);
++ v.x + s_,
++ v.y + s_,
++ v.z + s_,
++ v.w + s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator+
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s + v.x,
+- s + v.y,
+- s + v.z,
+- s + v.w);
++ s_ + v.x,
++ s_ + v.y,
++ s_ + v.z,
++ s_ + v.w);
+ }
+
+ template <typename T>
+@@ -814,28 +814,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator-
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x - s,
+- v.y - s,
+- v.z - s,
+- v.w - s);
++ v.x - s_,
++ v.y - s_,
++ v.z - s_,
++ v.w - s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator-
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s - v.x,
+- s - v.y,
+- s - v.z,
+- s - v.w);
++ s_ - v.x,
++ s_ - v.y,
++ s_ - v.z,
++ s_ - v.w);
+ }
+
+ template <typename T>
+@@ -857,28 +857,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator*
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x * s,
+- v.y * s,
+- v.z * s,
+- v.w * s);
++ v.x * s_,
++ v.y * s_,
++ v.z * s_,
++ v.w * s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator*
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s * v.x,
+- s * v.y,
+- s * v.z,
+- s * v.w);
++ s_ * v.x,
++ s_ * v.y,
++ s_ * v.z,
++ s_ * v.w);
+ }
+
+ template <typename T>
+@@ -900,28 +900,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator/
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x / s,
+- v.y / s,
+- v.z / s,
+- v.w / s);
++ v.x / s_,
++ v.y / s_,
++ v.z / s_,
++ v.w / s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator/
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s / v.x,
+- s / v.y,
+- s / v.z,
+- s / v.w);
++ s_ / v.x,
++ s_ / v.y,
++ s_ / v.z,
++ s_ / v.w);
+ }
+
+ template <typename T>
+@@ -1012,28 +1012,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator%
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x % s,
+- v.y % s,
+- v.z % s,
+- v.w % s);
++ v.x % s_,
++ v.y % s_,
++ v.z % s_,
++ v.w % s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator%
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s % v.x,
+- s % v.y,
+- s % v.z,
+- s % v.w);
++ s_ % v.x,
++ s_ % v.y,
++ s_ % v.z,
++ s_ % v.w);
+ }
+
+ template <typename T>
+@@ -1054,28 +1054,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator&
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x & s,
+- v.y & s,
+- v.z & s,
+- v.w & s);
++ v.x & s_,
++ v.y & s_,
++ v.z & s_,
++ v.w & s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator&
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s & v.x,
+- s & v.y,
+- s & v.z,
+- s & v.w);
++ s_ & v.x,
++ s_ & v.y,
++ s_ & v.z,
++ s_ & v.w);
+ }
+
+ template <typename T>
+@@ -1096,28 +1096,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator|
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x | s,
+- v.y | s,
+- v.z | s,
+- v.w | s);
++ v.x | s_,
++ v.y | s_,
++ v.z | s_,
++ v.w | s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator|
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s | v.x,
+- s | v.y,
+- s | v.z,
+- s | v.w);
++ s_ | v.x,
++ s_ | v.y,
++ s_ | v.z,
++ s_ | v.w);
+ }
+
+ template <typename T>
+@@ -1138,28 +1138,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator^
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x ^ s,
+- v.y ^ s,
+- v.z ^ s,
+- v.w ^ s);
++ v.x ^ s_,
++ v.y ^ s_,
++ v.z ^ s_,
++ v.w ^ s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator^
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s ^ v.x,
+- s ^ v.y,
+- s ^ v.z,
+- s ^ v.w);
++ s_ ^ v.x,
++ s_ ^ v.y,
++ s_ ^ v.z,
++ s_ ^ v.w);
+ }
+
+ template <typename T>
+@@ -1180,28 +1180,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator<<
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x << s,
+- v.y << s,
+- v.z << s,
+- v.w << s);
++ v.x << s_,
++ v.y << s_,
++ v.z << s_,
++ v.w << s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator<<
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s << v.x,
+- s << v.y,
+- s << v.z,
+- s << v.w);
++ s_ << v.x,
++ s_ << v.y,
++ s_ << v.z,
++ s_ << v.w);
+ }
+
+ template <typename T>
+@@ -1222,28 +1222,28 @@
+ GLM_FUNC_QUALIFIER tvec4<T> operator>>
+ (
+ tvec4<T> const & v,
+- typename tvec4<T>::value_type const & s
++ typename tvec4<T>::value_type const & s_
+ )
+ {
+ return tvec4<T>(
+- v.x >> s,
+- v.y >> s,
+- v.z >> s,
+- v.w >> s);
++ v.x >> s_,
++ v.y >> s_,
++ v.z >> s_,
++ v.w >> s_);
+ }
+
+ template <typename T>
+ GLM_FUNC_QUALIFIER tvec4<T> operator>>
+ (
+- typename tvec4<T>::value_type const & s,
++ typename tvec4<T>::value_type const & s_,
+ tvec4<T> const & v
+ )
+ {
+ return tvec4<T>(
+- s >> v.x,
+- s >> v.y,
+- s >> v.z,
+- s >> v.w);
++ s_ >> v.x,
++ s_ >> v.y,
++ s_ >> v.z,
++ s_ >> v.w);
+ }
+
+ template <typename T>
+@@ -1279,15 +1279,15 @@
+ template <typename T>
+ tref4<T>::tref4
+ (
+- T & x,
+- T & y,
+- T & z,
+- T & w
+- ) :
+- x(x),
+- y(y),
+- z(z),
+- w(w)
++ T & x_,
++ T & y_,
++ T & z_,
++ T & w_
++ ) :
++ x(x_),
++ y(y_),
++ z(z_),
++ w(w_)
+ {}
+
+ template <typename T>
+diff -ur glm.org/glm/gtc/quaternion.inl glm/glm/gtc/quaternion.inl
+--- glm.org/glm/gtc/quaternion.inl 2013-12-08 17:04:59.707365220 +0100
++++ glm/glm/gtc/quaternion.inl 2013-12-08 17:07:20.081840460 +0100
+@@ -60,15 +60,15 @@
+ template <typename T>
+ GLM_FUNC_QUALIFIER tquat<T>::tquat
+ (
+- value_type const & w,
+- value_type const & x,
+- value_type const & y,
+- value_type const & z
++ value_type const & w_,
++ value_type const & x_,
++ value_type const & y_,
++ value_type const & z_
+ ) :
+- x(x),
+- y(y),
+- z(z),
+- w(w)
++ x(x_),
++ y(y_),
++ z(z_),
++ w(w_)
+ {}
+
+ //////////////////////////////////////////////////////////////
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,graphite))
+
+$(eval $(call gb_Module_add_targets,graphite,\
+ StaticLibrary_graphite \
+ UnpackedTarball_graphite \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for providing rendering capabilities for complex non-Roman writing systems.
+
+From:
+[http://graphite.sil.org/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,graphite))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,graphite,graphite))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,graphite))
+
+$(eval $(call gb_StaticLibrary_set_include,graphite,\
+ -I$(call gb_UnpackedTarball_get_dir,graphite/include) \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_defs,graphite,\
+ -DDISABLE_TRACING \
+ -DGR2_STATIC \
+))
+
+ifeq ($(COM),GCC)
+ifneq ($(COM_GCC_IS_CLANG),TRUE)
+$(eval $(call gb_StaticLibrary_add_cxxflags,graphite,\
+ -fpermissive \
+))
+endif
+endif
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,graphite,cpp))
+
+$(eval $(call gb_StaticLibrary_add_generated_cxxobjects,graphite,\
+ UnpackedTarball/graphite/src/$(if $(filter GCC,$(COM)),direct,call)_machine \
+ UnpackedTarball/graphite/src/gr_char_info \
+ UnpackedTarball/graphite/src/gr_face \
+ UnpackedTarball/graphite/src/gr_features \
+ UnpackedTarball/graphite/src/gr_font \
+ UnpackedTarball/graphite/src/gr_logging \
+ UnpackedTarball/graphite/src/gr_segment \
+ UnpackedTarball/graphite/src/gr_slot \
+ UnpackedTarball/graphite/src/json \
+ UnpackedTarball/graphite/src/Bidi \
+ UnpackedTarball/graphite/src/CachedFace \
+ UnpackedTarball/graphite/src/CmapCache \
+ UnpackedTarball/graphite/src/Code \
+ UnpackedTarball/graphite/src/Face \
+ UnpackedTarball/graphite/src/FeatureMap \
+ UnpackedTarball/graphite/src/FileFace \
+ UnpackedTarball/graphite/src/Font \
+ UnpackedTarball/graphite/src/GlyphCache \
+ UnpackedTarball/graphite/src/GlyphFace \
+ UnpackedTarball/graphite/src/Justifier \
+ UnpackedTarball/graphite/src/NameTable \
+ UnpackedTarball/graphite/src/Pass \
+ UnpackedTarball/graphite/src/SegCache \
+ UnpackedTarball/graphite/src/SegCacheEntry \
+ UnpackedTarball/graphite/src/SegCacheStore \
+ UnpackedTarball/graphite/src/Segment \
+ UnpackedTarball/graphite/src/Silf \
+ UnpackedTarball/graphite/src/Slot \
+ UnpackedTarball/graphite/src/Sparse \
+ UnpackedTarball/graphite/src/TtfUtil \
+ UnpackedTarball/graphite/src/UtfCodec \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,graphite))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,graphite,$(GRAPHITE_TARBALL)))
+
+# http://projects.palaso.org/issues/1115
+$(eval $(call gb_UnpackedTarball_add_patches,graphite,\
+ external/graphite/graphite2.issue1115.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- graphite/src/Code.cpp
++++ graphite/src/Code.cpp
+@@ -169,8 +169,8 @@ Machine::Code::Code(bool is_constraint,
+ bytecode_end,
+ pre_context,
+ rule_length,
+- silf.numClasses(),
+- face.glyphs().numAttrs(),
++ static_cast<uint16>(silf.numClasses()),
++ static_cast<uint16>(face.glyphs().numAttrs()),
+ face.numFeatures(),
+ {1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,255,
+@@ -178,7 +178,7 @@ Machine::Code::Code(bool is_constraint,
+ 1,1,1,1,1,1,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+- 0,0,0,0,0,0,0, silf.numUser()}
++ 0,0,0,0,0,0,0, static_cast<byte>(silf.numUser())}
+ };
+
+ decoder dec(lims, *this);
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,harfbuzz))
+
+$(eval $(call gb_ExternalProject_use_autoconf,harfbuzz,build))
+
+$(eval $(call gb_ExternalProject_register_targets,harfbuzz,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,harfbuzz,\
+ icu \
+))
+
+$(call gb_ExternalProject_get_state_target,harfbuzz,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ --enable-static \
+ --disable-shared \
+ --with-pic \
+ --with-icu=yes \
+ --with-freetype=no \
+ --with-cairo=no \
+ --with-glib=no \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && (cd $(EXTERNAL_WORKDIR)/src && $(MAKE)) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,harfbuzz))
+
+$(eval $(call gb_Module_add_targets,harfbuzz,\
+ ExternalProject_harfbuzz \
+ UnpackedTarball_harfbuzz \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+HarfBuzz is an OpenType text shaping engine. From [http://harfbuzz.org/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,harfbuzz))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,harfbuzz,$(HARFBUZZ_TARBALL),,harfbuzz))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,hsqldb_project,hsqldb))
+
+$(eval $(call gb_ExternalPackage_use_external_project,hsqldb_project,hsqldb))
+
+$(eval $(call gb_ExternalPackage_add_file,hsqldb_project,$(LIBO_SHARE_JAVA_FOLDER)/hsqldb.jar,lib/hsqldb.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,hsqldb))
+
+$(eval $(call gb_ExternalProject_register_targets,hsqldb,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,hsqldb,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build/build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,hsqldb))
+
+$(eval $(call gb_Module_add_targets,hsqldb,\
+ ExternalPackage_hsqldb \
+ ExternalProject_hsqldb \
+ UnpackedTarball_hsqldb \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Java database engine from [http://hsqldb.org/].
+
+Default database format for OpenOffice.org.
+Also used in LibreOffice but shall be replaced as default by Firebird.
+
+See:
+https://bugs.freedesktop.org/show_bug.cgi?id=51781
+http://www.firebirdsql.org
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,hsqldb))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,hsqldb,$(HSQLDB_TARBALL),,hsqldb))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,hsqldb,\
+ build/build.xml \
+ src/org/hsqldb/Library.java \
+ src/org/hsqldb/persist/HsqlDatabaseProperties.java \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\
+ external/hsqldb/patches/i96823.patch \
+ external/hsqldb/patches/i97032.patch \
+ external/hsqldb/patches/i103528.patch \
+ external/hsqldb/patches/i104901.patch \
+ external/hsqldb/patches/fdo36824.patch \
+ external/hsqldb/patches/limit_as_table_alias.patch \
+ $(if $(HSQLDB_USE_JDBC_4_1),\
+ external/hsqldb/patches/jdbc-4.1.patch \
+ ) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/hsqldb/src/org/hsqldb/Expression.java 2012-07-03 19:49:00.000000000 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Expression.java 2012-07-03 19:39:00.000000000 +0200
+@@ -1552,7 +1552,7 @@
+ return columnQuoted;
+ }
+
+- return false;
++ return true;
+ }
+
+ /**
--- /dev/null
+--- misc/hsqldb/src/org/hsqldb/Library.java
++++ misc/build/hsqldb/src/org/hsqldb/Library.java
+@@ -1957,7 +1957,7 @@
+ functionMap.put("bitand", bitand);
+ functionMap.put("bitlength", bitLength);
+ functionMap.put("bitor", bitor);
+- functionMap.put("bitxor", bitor);
++ functionMap.put("bitxor", bitxor);
+ functionMap.put("character", character);
+ functionMap.put("concat", concat);
+ functionMap.put("cot", cot);
--- /dev/null
+--- misc/hsqldb/src/org/hsqldb/Table.java 2007-10-19 23:59:07.000000000 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Table.java 2009-09-11 13:45:42.939231519 +0200
+@@ -149,10 +149,10 @@
+ Constraint[] constraintList; // constrainst for the table
+ HsqlArrayList[] triggerLists; // array of trigger lists
+ private int[] colTypes; // fredt - types of columns
+- private int[] colSizes; // fredt - copy of SIZE values for columns
++ int[] colSizes; // fredt - copy of SIZE values for columns
+ private int[] colScales; // fredt - copy of SCALE values for columns
+ private boolean[] colNullable; // fredt - modified copy of isNullable() values
+- private Expression[] colDefaults; // fredt - expressions of DEFAULT values
++ Expression[] colDefaults; // fredt - expressions of DEFAULT values
+ private int[] defaultColumnMap; // fred - holding 0,1,2,3,...
+ private boolean hasDefaultValues; //fredt - shortcut for above
+ boolean sqlEnforceSize; // inherited from the database -
+--- misc/hsqldb/src/org/hsqldb/TableWorks.java 2007-01-14 06:48:16.000000000 +0100
++++ misc/build/hsqldb/src/org/hsqldb/TableWorks.java 2009-09-11 13:47:50.328667463 +0200
+@@ -670,7 +670,8 @@
+ // default expressions can change
+ oldCol.setType(newCol);
+ oldCol.setDefaultExpression(newCol.getDefaultExpression());
+- table.setColumnTypeVars(colIndex);
++ table.colSizes[colIndex] = oldCol.getSize();
++ table.colDefaults[colIndex] = oldCol.getDefaultExpression();
+ table.resetDefaultsFlag();
+
+ return;
--- /dev/null
+--- misc/hsqldb/src/org/hsqldb/Expression.java 2008-05-27 17:15:05.000000000 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Expression.java 2009-01-27 11:42:16.890625000 +0100
+@@ -803,61 +803,62 @@
+
+ case EXISTS :
+ buf.append(' ').append(Token.T_EXISTS).append(' ');
+- break;
++
++ return buf.toString();
+
+ case COUNT :
+ buf.append(' ').append(Token.T_COUNT).append('(');
+- break;
++ if ( "(*)".equals(left))buf.append('*');else buf.append(left); buf.append(')'); return buf.toString();
+
+ case SUM :
+ buf.append(' ').append(Token.T_SUM).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case MIN :
+ buf.append(' ').append(Token.T_MIN).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case MAX :
+ buf.append(' ').append(Token.T_MAX).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case AVG :
+ buf.append(' ').append(Token.T_AVG).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case EVERY :
+ buf.append(' ').append(Token.T_EVERY).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case SOME :
+ buf.append(' ').append(Token.T_SOME).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case STDDEV_POP :
+ buf.append(' ').append(Token.T_STDDEV_POP).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case STDDEV_SAMP :
+ buf.append(' ').append(Token.T_STDDEV_SAMP).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case VAR_POP :
+ buf.append(' ').append(Token.T_VAR_POP).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+
+ case VAR_SAMP :
+ buf.append(' ').append(Token.T_VAR_SAMP).append('(');
+ buf.append(left).append(')');
+- break;
++ return buf.toString();
+ }
+
+ throw Trace.error(Trace.EXPRESSION_NOT_SUPPORTED);
+@@ -1522,6 +1523,16 @@
+ if (exprType == COLUMN) {
+ return columnName;
+ }
++ if ( isAggregate(exprType) )
++ {
++ try
++ {
++ return getDDL();
++ }
++ catch(Exception e)
++ {
++ }
++ }
+
+ return "";
+ }
--- /dev/null
+--- misc/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2008-03-17 17:05:41.000000000 +0100
++++ misc/build/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2009-01-21 13:09:24.493470142 +0100
+@@ -429,6 +429,7 @@
+ setProperty(hsqldb_log_size, 10);
+ setProperty(sql_enforce_strict_size, true);
+ setProperty(hsqldb_nio_data_file, false);
++ setProperty(hsqldb_lock_file, true);
+ }
+
+ // OOo end
--- /dev/null
+--- misc/hsqldb/build/build.xml 2012-07-12 10:58:11.000000000 +0200
++++ misc/build/hsqldb/build/build.xml 2012-07-12 10:49:28.000000000 +0200
+@@ -98,16 +98,24 @@
+ <echo message="ant.java.hasjsse=${ant.java.hasjsse}" />
+ </target>
+
+- <target name="javaversion6">
++ <target name="javaversion7" unless="ant.java.iscjavaset">
++ <available classname="java.util.Objects" property="ant.java.iscjava17"/>
++ <available classname="java.util.Objects" property="ant.java.iscjavaset"/>
++ </target>
++
++ <target name="javaversion6" depends="javaversion7" unless="ant.java.iscjavaset">
+ <available classname="java.net.IDN" property="ant.java.iscjava16"/>
++ <available classname="java.net.IDN" property="ant.java.iscjavaset"/>
+ </target>
+
+- <target name="javaversion4" depends="javaversion6" unless="ant.java.iscjava16">
++ <target name="javaversion4" depends="javaversion6" unless="ant.java.iscjavaset">
+ <available classname="java.nio.Buffer" property="ant.java.iscjava14"/>
++ <available classname="java.nio.Buffer" property="ant.java.iscjavaset"/>
+ </target>
+
+- <target name="javaversion2" depends="javaversion4" unless="ant.java.iscjava14">
++ <target name="javaversion2" depends="javaversion4" unless="ant.java.iscjavaset">
+ <available classname="java.lang.ref.Reference" property="ant.java.iscjava12"/>
++ <available classname="java.lang.ref.Reference" property="ant.java.iscjavaset"/>
+ </target>
+
+ <target name="-prepare" depends="init,javaversion2">
+@@ -166,6 +177,7 @@
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcStatement.java"/>
+ <arg file="${src}/org/hsqldb/persist/LockFile.java"/>
+ <arg file="${src}/org/hsqldb/persist/Logger.java"/>
+@@ -183,6 +195,7 @@
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -210,6 +223,7 @@
+ <arg value="+JAVA2FULL"/>
+ <arg value="-JAVA4"/>
+ <arg value="-JAVA6"/>
++ <arg value="-JAVA7"/>
+ </java>
+ </target>
+
+@@ -218,6 +232,7 @@
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -244,6 +259,7 @@
+ <arg value="+JAVA2FULL"/>
+ <arg value="+JAVA4"/>
+ <arg value="-JAVA6"/>
++ <arg value="-JAVA7"/>
+ </java>
+ </target>
+
+@@ -253,6 +269,43 @@
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcCallableStatement.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcClob.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcConnection.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcParameterMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcPreparedStatement.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcResultSet.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcResultSetMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcStatement.java"/>
++ <arg file="${src}/org/hsqldb/persist/LockFile.java"/>
++ <arg file="${src}/org/hsqldb/persist/Logger.java"/>
++ <arg file="${src}/org/hsqldb/persist/ScaledRAFile.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/util/DatabaseManager.java"/>
++ <arg file="${src}/org/hsqldb/util/ConnectionDialogCommon.java"/>
++ <arg file="${src}/org/hsqldb/lib/SimpleLog.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/lib/SimpleLog.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/HsqlDateTime.java"/>
++ <arg value="+JAVA2"/>
++ <arg value="+JAVA2FULL"/>
++ <arg value="+JAVA4"/>
++ <arg value="+JAVA6"/>
++ <arg value="-JAVA7"/>
++ </java>
++ </target>
++
++ <target name="switchtojdk17" depends="switchtojdk16"
++ description="self explanatory" if="ant.java.iscjava17">
++ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
++ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
++ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -279,10 +332,11 @@
+ <arg value="+JAVA2FULL"/>
+ <arg value="+JAVA4"/>
+ <arg value="+JAVA6"/>
++ <arg value="+JAVA7"/>
+ </java>
+ </target>
+
+- <target name="store" depends="switchtojdk16"
++ <target name="store" depends="switchtojdk17"
+ description="compiles the /store folder">
+ <javac srcdir="${src}"
+ destdir="classes"
+--- misc/hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java 2012-02-08 15:14:42.802123563 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java 2012-02-08 15:47:35.842635642 +0000
+@@ -3375,4 +3375,18 @@
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public <T> T getObject(int ColumnIndex, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++
++//#endif JAVA7
+ }
+--- misc/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java 2012-02-08 15:14:42.802123563 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java 2012-02-08 15:47:35.851635628 +0000
+@@ -48,6 +48,12 @@
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++import java.util.concurrent.Executor;
++
++//#endif JAVA7
++
+ import java.sql.PreparedStatement;
+ import java.sql.SQLException;
+ import java.sql.SQLWarning;
+@@ -2793,4 +2799,31 @@
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public int getNetworkTimeout() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void setNetworkTimeout(Executor executor, int millis) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void abort(Executor executor) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public String getSchema() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void setSchema(String schema) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++//#endif JAVA7
+ }
+--- misc/hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java 2012-02-08 15:14:42.802123563 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java 2012-02-08 15:47:35.835635654 +0000
+@@ -5693,4 +5693,21 @@
+ */
+
+ //#endif JAVA6
++
++
++//#ifdef JAVA7
++ public boolean generatedKeyAlwaysReturned() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public ResultSet getPseudoColumns(String catalog, String schemaPattern,
++ String tableNamePattern, String columnNamePattern) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++
++//#endif JAVA7
++
+ }
+--- misc/hsqldb/src/org/hsqldb/jdbc/jdbcDataSource.java 2012-02-08 15:14:42.802123563 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcDataSource.java 2012-02-08 15:47:35.836635653 +0000
+@@ -47,6 +47,11 @@
+ //#endif JAVA4
+ import org.hsqldb.jdbcDriver;
+
++//#ifdef JAVA7
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++//#endif JAVA7
++
+ // boucherb@users 20040411 - doc 1.7.2 - javadoc updates toward 1.7.2 final
+
+ /**
+@@ -323,4 +328,15 @@
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException
++ {
++ throw new AbstractMethodError(
++ "org.hsqldb.jdbc.jdbcDataSource.getParentLogger should throw" +
++ " SQLFeatureNotSupportedException, but that is not yet available" +
++ " in Java 5");
++ }
++
++//#endif JAVA7
+ }
+--- misc/hsqldb/src/org/hsqldb/jdbc/jdbcResultSet.java 2012-02-08 15:14:42.802123563 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcResultSet.java 2012-02-08 15:47:35.866635606 +0000
+@@ -5324,4 +5324,19 @@
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public <T> T getObject(int columnNum, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++//#endif JAVA7
++
+ }
+--- misc/hsqldb/src/org/hsqldb/jdbc/jdbcStatement.java 2012-02-08 15:14:42.802123563 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcStatement.java 2012-02-08 15:47:35.872635595 +0000
+@@ -1608,4 +1608,16 @@
+ }
+ */
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public boolean isCloseOnCompletion() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void closeOnCompletion() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++//#endif JAVA7
+ }
+--- misc/hsqldb/src/org/hsqldb/jdbcDriver.java 2012-02-08 15:14:42.800123566 +0000
++++ misc/build/hsqldb/src/org/hsqldb/jdbcDriver.java 2012-02-08 15:47:35.826635667 +0000
+@@ -42,6 +42,11 @@
+ import org.hsqldb.persist.HsqlDatabaseProperties;
+ import org.hsqldb.persist.HsqlProperties;
+
++//#ifdef JAVA7
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++//#endif JAVA7
++
+ // fredt@users 20011220 - patch 1.7.0 by fredt
+ // new version numbering scheme
+ // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
+@@ -321,4 +326,15 @@
+ DriverManager.registerDriver(new jdbcDriver());
+ } catch (Exception e) {}
+ }
++
++//#ifdef JAVA7
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException
++ {
++ throw new AbstractMethodError(
++ "org.hsqldb.jdbcDriver.getParentLogger should throw" +
++ " SQLFeatureNotSupportedException, but that is not yet available" +
++ " in Java 5");
++ }
++
++//#endif JAVA7
+ }
--- /dev/null
+--- misc/hsqldb/src/org/hsqldb/Token.java 2013-06-13 10:04:28.975934479 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Token.java 2013-06-13 10:06:09.915931966 +0200
+@@ -819,7 +819,7 @@
+ Token.T_EXTRACT, Token.T_FOR, Token.T_FROM, Token.T_GROUP,
+ Token.T_HAVING, Token.T_IF, Token.T_INTO, Token.T_IFNULL,
+ Token.T_IS, Token.T_IN, Token.T_INTERSECT, Token.T_JOIN,
+- Token.T_INNER, Token.T_LEADING, Token.T_LIKE, Token.T_MAX,
++ Token.T_INNER, Token.T_LEADING, Token.T_LIKE, Token.T_LIMIT, Token.T_MAX,
+ Token.T_MIN, Token.T_NEXT, Token.T_NULLIF, Token.T_NOT,
+ Token.T_NVL, Token.T_MINUS, Token.T_ON, Token.T_ORDER, Token.T_OR,
+ Token.T_OUTER, Token.T_POSITION, Token.T_PRIMARY, Token.T_SELECT,
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,hunspell))
+
+$(eval $(call gb_ExternalProject_register_targets,hunspell,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,hunspell,build):
+ $(call gb_ExternalProject_run,build,\
+ LIBS="$(gb_STDLIBS) $(LIBS)" \
+ ./configure --disable-shared --disable-nls --with-pic \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
+ $(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
+ $(if $(filter C53,$(COM)),CFLAGS="-xc99=none") \
+ $(if $(filter-out WNTGCC,$(OS)$(COM)),,LDFLAGS="-Wl,--enable-runtime-pseudo-reloc-v2") \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,hunspell))
+
+$(eval $(call gb_Module_add_targets,hunspell,\
+ UnpackedTarball_hunspell \
+))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_targets,hunspell,\
+ StaticLibrary_hunspell \
+))
+else
+$(eval $(call gb_Module_add_targets,hunspell,\
+ ExternalProject_hunspell \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for spell checking.
+
+From:
+[http://hunspell.sourceforge.net/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,hunspell))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,hunspell,hunspell))
+
+$(eval $(call gb_StaticLibrary_use_external,hunspell,icu_headers))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,hunspell))
+
+$(eval $(call gb_StaticLibrary_add_defs,hunspell,\
+ -DHUNSPELL_STATIC \
+ -DOPENOFFICEORG \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cxxobjects,hunspell,\
+ UnpackedTarball/hunspell/src/hunspell/affentry \
+ UnpackedTarball/hunspell/src/hunspell/affixmgr \
+ UnpackedTarball/hunspell/src/hunspell/dictmgr \
+ UnpackedTarball/hunspell/src/hunspell/csutil \
+ UnpackedTarball/hunspell/src/hunspell/hashmgr \
+ UnpackedTarball/hunspell/src/hunspell/suggestmgr \
+ UnpackedTarball/hunspell/src/hunspell/phonet \
+ UnpackedTarball/hunspell/src/hunspell/hunzip \
+ UnpackedTarball/hunspell/src/hunspell/filemgr \
+ UnpackedTarball/hunspell/src/hunspell/replist \
+ UnpackedTarball/hunspell/src/hunspell/hunspell \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+ -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,hunspell))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
+ external/hunspell/hunspell-solaris.patch \
+ external/hunspell/hunspell-1.3.2-overflow.patch \
+ external/hunspell/hunspell-android.patch \
+ external/hunspell/hunspell-1.3.2-nullptr.patch \
+ external/hunspell/hunspell-1.3.2-literal.patch \
+ external/hunspell/hunspell-fdo48017-wfopen.patch \
+))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_UnpackedTarball_set_post_action,hunspell,\
+ touch src/hunspell/config.h \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/hunspell-1.3.2/src/tools/hunspell.cxx 2012-08-13 12:09:06.107017665 +0200
++++ misc/build/hunspell-1.3.2/src/tools/hunspell.cxx 2012-08-13 12:14:12.233500532 +0200
+@@ -20,7 +20,7 @@
+ #define HUNSPELL_VERSION VERSION
+ #define INPUTLEN 50
+
+-#define HUNSPELL_PIPE_HEADING "@(#) International Ispell Version 3.2.06 (but really Hunspell "VERSION")\n"
++#define HUNSPELL_PIPE_HEADING "@(#) International Ispell Version 3.2.06 (but really Hunspell " VERSION ")\n"
+ #define HUNSPELL_HEADING "Hunspell "
+ #define ODF_EXT "odt|ott|odp|otp|odg|otg|ods|ots"
+ #define ENTITY_APOS "'"
--- /dev/null
+--- misc/hunspell-1.3.2/src/hunspell/affentry.hxx 2010-04-15 13:22:08.000000000 +0200
++++ misc/build/hunspell-1.3.2/src/hunspell/affentry.hxx 2012-08-13 12:08:48.568996730 +0200
+@@ -27,7 +27,7 @@
+ struct hentry * checkword(const char * word, int len, char in_compound,
+ const FLAG needflag = FLAG_NULL);
+
+- struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
++ struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL);
+
+ char * check_morph(const char * word, int len, char in_compound,
+ const FLAG needflag = FLAG_NULL);
+@@ -90,7 +90,7 @@
+ // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT);
+ const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0);
+
+- struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
++ struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL);
+
+ char * check_twosfx_morph(const char * word, int len, int optflags,
+ PfxEntry* ppfx, const FLAG needflag = FLAG_NULL);
--- /dev/null
+--- misc/hunspell-1.3.2/src/hunspell/affixmgr.cxx 2010-02-27 12:59:53.000000000 +0100
++++ misc/build/hunspell-1.3.2/src/hunspell/affixmgr.cxx 2011-05-18 16:29:45.919141893 +0200
+@@ -6,6 +6,8 @@
+ #include <stdio.h>
+ #include <ctype.h>
+
++#include <limits>
++
+ #include <vector>
+
+ #include "affixmgr.hxx"
+@@ -4000,7 +4002,10 @@
+ case 3: {
+ np++;
+ numents = atoi(piece);
+- if (numents == 0) {
++ if ((numents <= 0) ||
++ ((::std::numeric_limits<size_t>::max()
++ / sizeof(struct affentry)) < numents))
++ {
+ char * err = pHMgr->encode_flag(aflag);
+ if (err) {
+ HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
+--- misc/hunspell-1.3.2/src/tools/munch.c 2010-02-27 21:49:49.000000000 +0100
++++ misc/build/hunspell-1.3.2/src/tools/munch.c 2011-05-18 15:53:53.427072106 +0200
+@@ -4,6 +4,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+@@ -233,10 +233,19 @@
+ case 1: { achar = *piece; break; }
+ case 2: { if (*piece == 'Y') ff = XPRODUCT; break; }
+ case 3: { numents = atoi(piece);
+- ptr = malloc(numents * sizeof(struct affent));
+- ptr->achar = achar;
+- ptr->xpflg = ff;
+- fprintf(stderr,"parsing %c entries %d\n",achar,numents);
++ if ((numents < 0) ||
++ ((SIZE_MAX/sizeof(struct affent)) < numents))
++ {
++ fprintf(stderr,
++ "Error: too many entries: %d\n", numents);
++ numents = 0;
++ } else {
++ ptr = malloc(numents * sizeof(struct affent));
++ ptr->achar = achar;
++ ptr->xpflg = ff;
++ fprintf(stderr,"parsing %c entries %d\n",
++ achar,numents);
++ }
+ break;
+ }
+ default: break;
+--- misc/hunspell-1.3.2/src/tools/unmunch.c 2010-02-23 15:53:29.000000000 +0100
++++ misc/build/hunspell-1.3.2/src/tools/unmunch.c 2011-05-18 20:53:43.843599726 +0200
+@@ -6,6 +6,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+@@ -158,10 +159,19 @@
+ case 1: { achar = *piece; break; }
+ case 2: { if (*piece == 'Y') ff = XPRODUCT; break; }
+ case 3: { numents = atoi(piece);
+- ptr = malloc(numents * sizeof(struct affent));
+- ptr->achar = achar;
+- ptr->xpflg = ff;
+- fprintf(stderr,"parsing %c entries %d\n",achar,numents);
++ if ((numents < 0) ||
++ ((SIZE_MAX/sizeof(struct affent)) < numents))
++ {
++ fprintf(stderr,
++ "Error: too many entries: %d\n", numents);
++ numents = 0;
++ } else {
++ ptr = malloc(numents * sizeof(struct affent));
++ ptr->achar = achar;
++ ptr->xpflg = ff;
++ fprintf(stderr,"parsing %c entries %d\n",
++ achar,numents);
++ }
+ break;
+ }
+ default: break;
--- /dev/null
+--- misc/hunspell-1.3.2/config.sub 2010-02-23 10:08:48.000000000 +0100
++++ misc/build/hunspell-1.3.2/config.sub 2011-09-26 23:31:02.000000000 +0200
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+@@ -1161,7 +1161,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
--- /dev/null
+diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx
+--- hunspell/src/hunspell/csutil.cxx 2011-02-02 11:35:43.000000000 +0100
++++ build/hunspell/src/hunspell/csutil.cxx 2014-04-24 19:42:01.373285409 +0200
+@@ -57,9 +57,14 @@
+ if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
+ int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
++ wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t));
++ FILE * f = NULL;
+ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
+- FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++ if (_wfullpath( buff2, buff, len ) != NULL) {
++ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++ }
+ free(buff);
++ free(buff2);
+ return f;
+ }
+ #endif
--- /dev/null
+--- misc/hunspell-1.3.2.orig/src/tools/hunspell.cxx 2010-02-27 23:42:05.000000000 +0000
++++ misc/build/hunspell-1.3.2/src/tools/hunspell.cxx 2010-02-27 23:43:02.000000000 +0000
+@@ -10,6 +10,9 @@
+ #include "hunspell.hxx"
+ #include "csutil.hxx"
+
++// switch off iconv support for tests (fixing Solaris problems)
++#undef HAVE_ICONV
++
+ #ifndef HUNSPELL_EXTRA
+ #define suggest_auto suggest
+ #endif
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,hyphen))
+
+$(eval $(call gb_ExternalProject_use_external,hyphen,hunspell))
+
+$(eval $(call gb_ExternalProject_register_targets,hyphen,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,hyphen,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-shared \
+ $(if $(filter-out IOS,$(OS)),--with-pic) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,hyphen))
+
+ifeq ($(SYSTEM_HYPH),)
+
+$(eval $(call gb_Module_add_targets,hyphen,\
+ UnpackedTarball_hyphen \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,hyphen,\
+ StaticLibrary_hyphen \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,hyphen,\
+ ExternalProject_hyphen \
+))
+
+endif # $(COM)
+
+endif # $(SYSTEM_HYPH)
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Hyphenator library from [http://hunspell.sourceforge.net]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,hyphen))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,hyphen,hyphen))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,hyphen))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,hyphen,\
+ UnpackedTarball/hyphen/hyphen \
+ UnpackedTarball/hyphen/hnjalloc \
+))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,hyphen))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,hyphen,$(HYPHEN_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,hyphen,\
+ external/hyphen/hyphen-lenwaswrong.patch \
+ external/hyphen/hyphen-fdo43931.patch \
+ external/hyphen/hyphen-android.patch \
+ external/hyphen/hyphen-rhmin.patch \
+ external/hyphen/hyphen-build.patch \
+ external/hyphen/hyphen-fdo48017-wfopen.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/hyphen-2.8.4/config.sub
++++ misc/build/hyphen-2.8.4/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1215,7 +1215,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+--- misc/hyphen-2.8.4/Makefile.am 2010-07-19 11:23:17.000000000 +0200
++++ misc/build/hyphen-2.8.4/Makefile.am 2010-12-02 10:15:44.390625000 +0100
+@@ -25,13 +25,13 @@
+
+ hyphen.us3:
+ cp -f $(srcdir)/hyphen.tex hyphen.us
+- patch < $(srcdir)/hyphen.patch
++ $(GNUPATCH) < $(srcdir)/hyphen.patch
+ $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
+ cat hyphen.us hyphen.us2 | $(AWK) -f $(srcdir)/lig.awk >hyphen.us3
+ cat $(srcdir)/ligpatch.txt >>hyphen.us3
+
+-hyph_en_US.dic: hyphen.us3
+- perl $(srcdir)/substrings.pl hyphen.us3 hyph_en_US.dic UTF-8 2 3 >/dev/null
++hyph_en_US.dic:
++ @echo "hyph_en_US.txt distributed with Hyphen library"
+
+ clean-local:
+ rm -rf hyphen.us* hyph_en_US.dic
+--- misc/hyphen-2.8.4/Makefile.in 2010-12-01 02:31:29.000000000 +0100
++++ misc/build/hyphen-2.8.4/Makefile.in 2010-12-02 10:17:16.546875000 +0100
+@@ -940,13 +940,13 @@
+
+ hyphen.us3:
+ cp -f $(srcdir)/hyphen.tex hyphen.us
+- patch < $(srcdir)/hyphen.patch
++ $(GNUPATCH) < $(srcdir)/hyphen.patch
+ $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
+ cat hyphen.us hyphen.us2 | $(AWK) -f $(srcdir)/lig.awk >hyphen.us3
+ cat $(srcdir)/ligpatch.txt >>hyphen.us3
+
+-hyph_en_US.dic: hyphen.us3
+- perl $(srcdir)/substrings.pl hyphen.us3 hyph_en_US.dic UTF-8 2 3 >/dev/null
++hyph_en_US.dic:
++ @echo "hyph_en_US.txt distributed with Hyphen library"
+
+ clean-local:
+ rm -rf hyphen.us* hyph_en_US.dic
--- /dev/null
+--- misc//hyphen-2.8.4/hyphen.c 2011-10-10 15:49:33.000000000 +0200
++++ misc/build/hyphen-2.8.4/hyphen.c 2011-12-27 13:49:07.568283812 +0100
+@@ -436,9 +436,9 @@
+ }
+ } else if (k == 1) {
+ /* default first level: hyphen and ASCII apostrophe */
+- if (!dict[0]->utf8) hnj_hyphen_load_line("NOHYPHEN '\n", dict[k], hashtab);
+- else hnj_hyphen_load_line("NOHYPHEN ',\xe2\x80\x93,\xe2\x80\x99\n", dict[k], hashtab);
+- strncpy(buf, "1-1/=,1,1\n", MAX_CHARS-1); // buf rewritten by hnj_hyphen_load here
++ if (!dict[0]->utf8) hnj_hyphen_load_line("NOHYPHEN ',-\n", dict[k], hashtab);
++ else hnj_hyphen_load_line("NOHYPHEN ',\xe2\x80\x93,\xe2\x80\x99,-\n", dict[k], hashtab);
++ strncpy(buf, "1-1\n", MAX_CHARS-1); // buf rewritten by hnj_hyphen_load here
+ buf[MAX_CHARS-1] = '\0';
+ hnj_hyphen_load_line(buf, dict[k], hashtab); /* remove hyphen */
+ hnj_hyphen_load_line("1'1\n", dict[k], hashtab); /* ASCII apostrophe */
--- /dev/null
+diff -u hyphen/hyphen.c build/hyphen/hyphen.c
+--- hyphen/hyphen.c 2014-05-22 00:28:13.164587974 +0200
++++ build/hyphen/hyphen.c 2014-05-22 11:08:55.000000000 +0200
+@@ -44,6 +44,11 @@
+ #include <unistd.h> /* for exit */
+ #endif
+
++#ifdef _WIN32
++#include <windows.h>
++#include <wchar.h>
++#endif
++
+ #define noVERBOSE
+
+ /* calculate hyphenmin values with long ligature length (2 or 3 characters
+@@ -371,6 +376,26 @@
+ }
+ }
+
++FILE * hnj_fopen(const char * path, const char * mode) {
++#ifdef _WIN32
++#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
++ if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
++ int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
++ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
++ wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t));
++ FILE * f = NULL;
++ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
++ if (_wfullpath( buff2, buff, len ) != NULL) {
++ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++ }
++ free(buff);
++ free(buff2);
++ return f;
++ }
++#endif
++ return fopen(path, mode);
++}
++
+ HyphenDict *
+ hnj_hyphen_load (const char *fn)
+ {
+@@ -383,7 +408,7 @@
+ HashEntry *e;
+ int state_num = 0;
+
+- f = fopen (fn, "r");
++ f = hnj_fopen (fn, "r");
+ if (f == NULL)
+ return NULL;
+
--- /dev/null
+--- misc/hyphen-2.8.4/hyphen.c 29 Jun 2012 10:02:24 -0000 1.6
++++ misc/build/hyphen-2.8.4/hyphen.c 12 Jul 2012 15:19:16 -0000
+@@ -951,7 +951,7 @@
+ rep2 = hnj_malloc (word_size * sizeof(char *));
+ pos2 = hnj_malloc (word_size * sizeof(int));
+ cut2 = hnj_malloc (word_size * sizeof(int));
+- hyphens2 = hnj_malloc (word_size);
++ hyphens2 = hnj_malloc (word_size + 3);
+ for (i = 0; i < word_size; i++) rep2[i] = NULL;
+ for (i = 0; i < word_size; i++) if
+ (hyphens[i]&1 || (begin > 0 && i + 1 == word_size)) {
--- /dev/null
+--- misc//hyphen-2.8.4/hyphen.c
++++ misc/build/hyphen-2.8.4/hyphen.c
+@@ -734,13 +734,13 @@
+ int hnj_hyphen_rhmin(int utf8, const char *word, int word_size, char * hyphens,
+ char *** rep, int ** pos, int ** cut, int rhmin)
+ {
+- int i = 1;
++ int i = 0;
+ int j;
+
+ // ignore numbers
+ for (j = word_size - 1; j > 0 && word[j] <= '9' && word[j] >= '0'; j--) i--;
+
+- for (j = word_size - 2; i < rhmin && j > 0; j--) {
++ for (j = word_size - 1; i < rhmin && j > 0; j--) {
+ // check length of the non-standard part
+ if (*rep && *pos && *cut && (*rep)[j]) {
+ char * rh = strchr((*rep)[j], '=');
+@@ -753,7 +753,7 @@
+ } else {
+ hyphens[j] = '0';
+ }
+- if (!utf8 || (word[j] & 0xc0) != 0xc0) i++;
++ if (!utf8 || (word[j] & 0xc0) == 0xc0 || (word[j] & 0x80) != 0x80) i++;
+ }
+ return 0;
+ }
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+icu_VERSION := $(ICU_MAJOR).$(ICU_MINOR)$(if $(ICU_MICRO),.$(ICU_MICRO))
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,icu,icu))
+
+$(eval $(call gb_ExternalPackage_use_external_project,icu,icu))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+ifeq ($(OS),WNT)
+
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_files,icu,$(LIBO_LIB_FOLDER),\
+ source/lib/icuin$(ICU_MAJOR).dll \
+))
+else
+$(eval $(call gb_ExternalPackage_add_files,icu,$(LIBO_LIB_FOLDER),\
+ source/lib/icuin$(if $(MSVC_USE_DEBUG_RUNTIME),d)$(ICU_MAJOR).dll \
+))
+endif # $(COM)
+
+else ifeq ($(OS),ANDROID)
+
+$(eval $(call gb_ExternalPackage_add_files,icu,$(LIBO_LIB_FOLDER),\
+ source/lib/libicudatalo.so \
+ source/lib/libicuuclo.so \
+ source/lib/libicui18nlo.so \
+))
+
+else # $(OS) != WNT/ANDROID
+
+$(eval $(call gb_ExternalPackage_add_file,icu,$(LIBO_LIB_FOLDER)/libicudata$(gb_Library_DLLEXT).$(ICU_MAJOR),source/lib/libicudata$(gb_Library_DLLEXT).$(icu_VERSION)))
+$(eval $(call gb_ExternalPackage_add_file,icu,$(LIBO_LIB_FOLDER)/libicuuc$(gb_Library_DLLEXT).$(ICU_MAJOR),source/lib/libicuuc$(gb_Library_DLLEXT).$(icu_VERSION)))
+$(eval $(call gb_ExternalPackage_add_file,icu,$(LIBO_LIB_FOLDER)/libicui18n$(gb_Library_DLLEXT).$(ICU_MAJOR),source/lib/libicui18n$(gb_Library_DLLEXT).$(icu_VERSION)))
+
+endif # $(OS)
+endif # DISABLE_DYNLOADING
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# libxml2 is in URE and depends on icuuc*.dll on Windows - extra package needed
+$(eval $(call gb_ExternalPackage_ExternalPackage,icu_ure,icu))
+
+$(eval $(call gb_ExternalPackage_use_external_project,icu_ure,icu))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+ifeq ($(OS),WNT)
+
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_files,icu_ure,$(LIBO_URE_LIB_FOLDER),\
+ source/lib/icudt$(ICU_MAJOR).dll \
+ source/lib/icuuc$(ICU_MAJOR).dll \
+))
+else
+$(eval $(call gb_ExternalPackage_add_files,icu_ure,$(LIBO_URE_LIB_FOLDER),\
+ source/lib/icudt$(if $(MSVC_USE_DEBUG_RUNTIME),d)$(ICU_MAJOR).dll \
+ source/lib/icuuc$(if $(MSVC_USE_DEBUG_RUNTIME),d)$(ICU_MAJOR).dll \
+))
+endif # $(COM)
+
+endif # $(OS)
+endif # DISABLE_DYNLOADING
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,icu))
+
+$(eval $(call gb_ExternalProject_register_targets,icu,\
+ build \
+))
+
+icu_CPPFLAGS:="-DHAVE_GCC_ATOMICS=$(if $(filter TRUE,$(GCC_HAVE_BUILTIN_ATOMIC)),1,0)"
+
+ifeq ($(OS),WNT)
+
+# Note: runConfigureICU ignores everything following the platform name!
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,icu,build) :
+ $(call gb_ExternalProject_run,build,\
+ export LIB="$(ILIB)" \
+ && CFLAGS="$(SOLARINC)" CPPFLAGS="$(SOLARINC)" CXXFLAGS="$(SOLARINC)" \
+ ./runConfigureICU \
+ $(if $(MSVC_USE_DEBUG_RUNTIME),--enable-debug --disable-release) \
+ Cygwin/MSVC \
+ && $(MAKE) \
+ ,source)
+else
+$(call gb_ExternalProject_get_state_target,icu,build) :
+ $(call gb_ExternalProject_run,build,\
+ CPPFLAGS=$(icu_CPPFLAGS) CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" \
+ LIBS="$(if $(MINGW_SHARED_GXXLIB),$(MINGW_SHARED_LIBSTDCPP))" \
+ LDFLAGS="-L$(COMPATH)/lib -Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 \
+ $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ ./configure \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ --with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source) \
+ --disable-layout --disable-static --enable-shared --disable-samples \
+ && $(MAKE) \
+ && for lib in icudata icuin icuuc; do \
+ touch $$lib; \
+ done \
+ ,source)
+endif
+
+else # $(OS)
+
+icu_CFLAGS:=" \
+ $(if $(filter IOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
+ $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \
+ $(if $(debug),$(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) \
+ $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
+ $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
+ $(if $(filter $(true),$(gb_SYMBOL)),-g) \
+ $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)"
+icu_CXXFLAGS:="$(CXXFLAGS_CXX11) \
+ $(if $(filter IOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
+ $(if $(debug),$(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) \
+ $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
+ $(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
+ $(if $(filter $(true),$(gb_SYMBOL)),-g) \
+ $(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)"
+icu_LDFLAGS:=" \
+ $(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
+ $(if $(filter TRUE,$(HAVE_LD_HASH_STYLE)),-Wl$(COMMA)--hash-style=$(WITH_LINKER_HASH_STYLE)) \
+ $(if $(SYSBASE),-L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)/usr/lib) \
+ $(if $(filter TRUE,$(HAVE_LD_BSYMBOLIC_FUNCTIONS)),\
+ -Wl$(COMMA)-Bsymbolic-functions -Wl$(COMMA)--dynamic-list-cpp-new -Wl$(COMMA)--dynamic-list-cpp-typeinfo) \
+ $(if $(filter ANDROID,$(OS)),-lgnustl_shared -lm)"
+
+$(call gb_ExternalProject_get_state_target,icu,build) :
+ $(call gb_ExternalProject_run,build,\
+ CPPFLAGS=$(icu_CPPFLAGS) CFLAGS=$(icu_CFLAGS) \
+ CXXFLAGS=$(icu_CXXFLAGS) LDFLAGS=$(icu_LDFLAGS) \
+ ./configure \
+ --disable-layout --disable-samples \
+ $(if $(CROSS_COMPILING),--disable-tools --disable-extras) \
+ $(if $(filter IOS ANDROID,$(OS)),--disable-dyload) \
+ $(if $(filter ANDROID,$(OS)),--disable-strict ac_cv_c_bigendian=no) \
+ $(if $(filter SOLARIS AIX,$(OS)),--disable-64bit-libs) \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),\
+ --enable-static --disable-shared,\
+ --disable-static --enable-shared $(if $(filter ANDROID,$(OS)),--with-library-suffix=lo)) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)\
+ --with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source) \
+ $(if $(filter IOS,$(OS)), \
+ --with-data-packaging=archive) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),&& $(PERL) \
+ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(gb_Package_SOURCEDIR_icu)/source/lib/libicudata$(gb_Library_DLLEXT).$(icu_VERSION) \
+ $(gb_Package_SOURCEDIR_icu)/source/lib/libicuuc$(gb_Library_DLLEXT).$(icu_VERSION) \
+ $(gb_Package_SOURCEDIR_icu)/source/lib/libicui18n$(gb_Library_DLLEXT).$(icu_VERSION)) \
+ ,source)
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,icu))
+
+$(eval $(call gb_Module_add_targets,icu,\
+ UnpackedTarball_icu \
+ ExternalPackage_icu \
+ ExternalPackage_icu_ure \
+ ExternalProject_icu \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library providing Unicode support, from [http://site.icu-project.org/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,icu))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,icu,$(ICU_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,icu,\
+ external/icu/icu4c-build.patch \
+ external/icu/icu4c-aix.patch \
+ external/icu/icu4c-wchar_t.patch \
+ external/icu/icu4c-warnings.patch \
+ external/icu/icu4c-macosx.patch \
+ external/icu/icu4c-solarisgcc.patch \
+ external/icu/icu4c-mkdir.patch \
+ external/icu/icu4c-buffer-overflow.patch \
+ external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch \
+ external/icu/icu4c-icu11054.patch.1 \
+ external/icu/icu4c-icu11100.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/icu/source/config/mh-aix-gcc 2010-06-24 20:58:16.000000000 -0500
++++ misc/build/icu/source/config/mh-aix-gcc 2013-10-31 20:34:16.607982310 +0700
+@@ -13,84 +13,29 @@
+ GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
+ GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
+
+-## Commands to link
+-## We need to use the C++ linker, even when linking C programs, since
+-## our libraries contain C++ code (C++ static init not called)
+-LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
+-LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
+-
+-## Shared library options
+-LD_SOOPTIONS= -Wl,-bsymbolic
+-
+-## Commands to make a shared library
+-SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS)
+-SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS)
+-
+-## Compiler switch to embed a runtime search path
+-LD_RPATH= -I
+-LD_RPATH_PRE=
++## Flags for position independent code
++SHAREDLIBCFLAGS = -fPIC
++SHAREDLIBCXXFLAGS = -fPIC
++SHAREDLIBCPPFLAGS = -DPIC
++
++## Additional flags when building libraries and with threads
++THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
++LIBCPPFLAGS =
+
+-## enable the shared lib loader
+-LDFLAGS += -Wl,-bbigtoc
++LD_RPATH=
++LD_RPATH_PRE=
+
+ ## These are the library specific LDFLAGS
+ LDFLAGSICUDT=-nodefaultlibs -nostdlib
+
+-## We need to delete things prior to linking, or else we'll get
+-## SEVERE ERROR: output file in use .. on AIX.
+-## But, shell script version should NOT delete target as we don't
+-## have $@ in that context. (SH = only shell script, icu-config)
+-AIX_PREDELETE=rm -f $@ ;
+-#SH# AIX_PREDELETE=
+-
+ ## Environment variable to set a runtime search path
+ LDLIBRARYPATH_ENVVAR = LIBPATH
+
+-## Override Versioned target for a shared library.
+-FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
+-MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
+-SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
+-SHARED_OBJECT_NO_VERSION = $(basename $(SO_TARGET)).$(SOBJ)
+-
+-# The following is for Makefile.inc's use.
+-ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
+-
+-# this one is for icudefs.mk's use
+-ifeq ($(ENABLE_SHARED),YES)
+-SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
+-endif
+-
+-## Compiler switch to embed a library name. Not present on AIX.
+-LD_SONAME =
+-
+-## The type of assembly needed when pkgdata is used for generating shared libraries.
+-GENCCODE_ASSEMBLY=-a xlc
+-
+ ## Shared object suffix
+-SOBJ= so
+-# without the -brtl option, the library names use .a. AIX is funny that way.
+-SO= a
+-A= a
++SO= so
+
+ ## Non-shared intermediate object suffix
+-STATIC_O = o
+-
+-## Special AIX rules
+-
+-## Build archive from shared object
+-%.a : %.so
+- ln -f $< $(SHARED_OBJECT_NO_VERSION)
+- $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
+- rm -f $(SHARED_OBJECT_NO_VERSION)
+-$(LIBDIR)/%.a : %.so
+- ln -f $< $(SHARED_OBJECT_NO_VERSION)
+- $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
+- rm -f $(SHARED_OBJECT_NO_VERSION)
+-
+-## Build import list from export list
+-%.e : %.exp
+- @echo "Building an import list for $<"
+- @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
++STATIC_O = ao
+
+ ## Compilation rules
+ %.$(STATIC_O): $(srcdir)/%.c
+@@ -118,10 +63,10 @@
+ [ -s $@ ] || rm -f $@'
+
+ ## Versioned libraries rules
+-%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
+- $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
+-%.$(SO): %$(SO_TARGET_VERSION).$(SO)
+- $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
++ $(RM) $@ && ln -s ${<F} $@
++%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
++ $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
+
+
+ ## BIR - bind with internal references [so app data and icu data doesn't collide]
+--- misc/icu/source/tools/pkgdata/pkgdata.cpp 2013-04-06 20:56:00.935656635 +0100
++++ misc/build/icu/source/tools/pkgdata/pkgdata.cpp 2013-10-31 20:38:10.623984554 +0700
+@@ -888,7 +888,7 @@
+
+ uprv_strcat(pkgDataFlags[SO_EXT], ".");
+ uprv_strcat(pkgDataFlags[SO_EXT], pkgDataFlags[A_EXT]);
+-#elif U_PLATFORM == U_PF_OS400 || defined(_AIX)
++#elif U_PLATFORM == U_PF_OS400
+ sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s.%s",
+ libFileNames[LIB_FILE],
+ pkgDataFlags[SOBJ_EXT]);
+@@ -1302,15 +1302,6 @@
+ pkgDataFlags[LDICUDTFLAGS],
+ targetDir,
+ libFileNames[LIB_FILE_CYGWIN_VERSION],
+-#elif U_PLATFORM == U_PF_AIX
+- sprintf(cmd, "%s %s%s;%s %s -o %s%s %s %s%s %s %s",
+- RM_CMD,
+- targetDir,
+- libFileNames[LIB_FILE_VERSION_TMP],
+- pkgDataFlags[GENLIB],
+- pkgDataFlags[LDICUDTFLAGS],
+- targetDir,
+- libFileNames[LIB_FILE_VERSION_TMP],
+ #else
+ sprintf(cmd, "%s %s -o %s%s %s %s%s %s %s",
+ pkgDataFlags[GENLIB],
+
--- /dev/null
+--- misc/icu/source/config/mh-linux 2013-10-05 03:50:00.000000000 +0700
++++ misc/build/icu/source/config/mh-linux 2013-11-10 17:11:46.856222557 +0700
+@@ -25,7 +25,7 @@
+
+ ## Compiler switch to embed a library name
+ # The initial tab in the next line is to prevent icu-config from reading it.
+- LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
++ #LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
+ #SH# # We can't depend on MIDDLE_SO_TARGET being set.
+ #SH# LD_SONAME=
+
+--- misc/icu/source/configure 2013-10-05 03:54:58.000000000 +0700
++++ misc/build/icu/source/configure 2013-11-10 17:19:19.200218763 +0700
+@@ -4872,7 +4872,7 @@
+ else
+ icu_cv_host_frag=mh-linux-va
+ fi ;;
+-*-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) icu_cv_host_frag=mh-linux ;;
++*-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu|*-*-*-androideabi*) icu_cv_host_frag=mh-linux ;;
+ *-*-cygwin|*-*-mingw32|*-*-mingw64)
+ if test "$GCC" = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6032,6 +6032,10 @@
+ # Check to see if genccode can generate simple assembly.
+ GENCCODE_ASSEMBLY=
+ case "${host}" in
++arm-*-linux-androideabi)
++ if test "$GCC" = yes; then
++ GENCCODE_ASSEMBLY="-a gcc-android-arm"
++ fi ;;
+ *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
+ if test "$GCC" = yes; then
+ # We're using gcc, and the simple -a gcc command line works for genccode
+@@ -7104,6 +7108,10 @@
+ # wchar_t can be used
+ CHECK_UTF16_STRING_RESULT="available"
+ ;;
++*-*-*-androideabi|mips-unknown-linux-android)
++ # no UTF-16 strings thanks, I think, this is to avoid the -std=c++0x which causes trouble with uint64_t
++ CHECK_UTF16_STRING_RESULT="nope"
++ ;;
+ *)
+ ;;
+ esac
+
+--- misc/icu/source/common/unicode/platform.h 2013-10-05 03:49:10.000000000 +0700
++++ misc/build/icu/source/common/unicode/platform.h 2013-11-10 17:22:27.160217186 +0700
+@@ -703,7 +703,7 @@
+ #elif defined(U_STATIC_IMPLEMENTATION)
+ # define U_EXPORT
+ #elif defined(__GNUC__)
+-# define U_EXPORT __attribute__((visibility("default")))
++# define U_EXPORT
+ #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
+ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
+ # define U_EXPORT __global
+
--- /dev/null
+I: Statement might be overflowing a buffer in strncat. Common mistake:
+ BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument
+ GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
+E: icu bufferoverflowstrncat pkgdata.cpp:299:87
+
+---
+ source/tools/pkgdata/pkgdata.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+Index: icu/source/tools/pkgdata/pkgdata.cpp
+===================================================================
+--- build/icu.orig/source/tools/pkgdata/pkgdata.cpp
++++ build/icu/source/tools/pkgdata/pkgdata.cpp
+@@ -2060,12 +2060,12 @@
+ const char cmd[] = "icu-config --incpkgdatafile";
+
+ /* #1 try the same path where pkgdata was called from. */
+- findDirname(progname, cmdBuf, 1024, &status);
++ findDirname(progname, cmdBuf, sizeof(cmdBuf), &status);
+ if(U_SUCCESS(status)) {
+ if (cmdBuf[0] != 0) {
+- uprv_strncat(cmdBuf, U_FILE_SEP_STRING, 1024);
++ uprv_strncat(cmdBuf, U_FILE_SEP_STRING, sizeof(cmdBuf)-1-strlen(cmdBuf));
+ }
+- uprv_strncat(cmdBuf, cmd, 1023);
++ uprv_strncat(cmdBuf, cmd, sizeof(cmdBuf)-1-strlen(cmdBuf));
+
+ if(verbose) {
+ fprintf(stdout, "# Calling icu-config: %s\n", cmdBuf);
+
--- /dev/null
+--- misc/icu/source/tools/toolutil/pkg_genc.h
++++ misc/build/icu/source/tools/toolutil/pkg_genc.h
+@@ -58,7 +58,7 @@
+ #endif
+
+ #define LARGE_BUFFER_MAX_SIZE 2048
+-#define SMALL_BUFFER_MAX_SIZE 512
++#define SMALL_BUFFER_MAX_SIZE 2048
+ #define SMALL_BUFFER_FLAG_NAMES 32
+ #define BUFFER_PADDING_SIZE 20
+
+--- misc/icu/source/tools/toolutil/pkg_genc.c
++++ misc/build/icu/source/tools/toolutil/pkg_genc.c
+@@ -152,6 +152,28 @@
+
+ ".long ","",HEX_0X
+ },
++ {"gcc-android-arm",
++ "\t.arch armv5te\n"
++ "\t.fpu softvfp\n"
++ "\t.eabi_attribute 20, 1\n"
++ "\t.eabi_attribute 21, 1\n"
++ "\t.eabi_attribute 23, 3\n"
++ "\t.eabi_attribute 24, 1\n"
++ "\t.eabi_attribute 25, 1\n"
++ "\t.eabi_attribute 26, 2\n"
++ "\t.eabi_attribute 30, 6\n"
++ "\t.eabi_attribute 18, 4\n"
++ "\t.file \"%s.s\"\n"
++ "\t.global %s\n"
++ "\t.section .rodata\n"
++ "\t.align 2\n"
++ "\t.type %s, %%object\n"
++ "%s:\n",
++
++ "\t.word ",
++ "\t.section .note.GNU-stack,\"\",%%progbits\n",
++ HEX_0X
++ },
+ // 16 bytes alignment.
+ // http://docs.oracle.com/cd/E19641-01/802-1947/802-1947.pdf
+ {"sun",
+
+--- misc/icu/source/config/mh-darwin 2010-09-29 20:37:36.000000000 +0200
++++ misc/build/icu/source/config/mh-darwin 2011-03-15 10:56:26.653056004 +0100
+@@ -28,11 +28,7 @@
+ SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS)
+
+ ## Compiler switches to embed a library name and version information
+-ifeq ($(ENABLE_RPATH),YES)
+-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))
+-else
+-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
+-endif
++LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name @__________________________________________________OOO/$(notdir $(MIDDLE_SO_TARGET))
+
+ ## Compiler switch to embed a runtime search path
+ LD_RPATH=
+@@ -48,10 +44,6 @@
+ ## Non-shared intermediate object suffix
+ STATIC_O = ao
+
+-## Override Versioned target for a shared library.
+-FINAL_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
+-MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
+-
+ ## Compilation and dependency rules
+ %.$(STATIC_O): $(srcdir)/%.c
+ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -MMD -MT "$*.d $*.o $*.$(STATIC_O)" -o $@ $<)
+@@ -65,16 +57,10 @@
+
+ ## Versioned libraries rules
+
+-%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
+ $(RM) $@ && ln -s ${<F} $@
+-%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
+- $(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
+-
+-# tzcode option
+-TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
+-
+-# genren opts
+-GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
++%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
++ $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
+
+ ## Remove shared library 's'
+ STATIC_PREFIX_WHEN_USED =
--- /dev/null
+--- icu/source/common/ubidi.c.orig 2014-08-09 20:54:39.338833533 +0100
++++ icu/source/common/ubidi.c 2014-08-09 20:55:48.625469055 +0100
+@@ -679,10 +679,10 @@
+ bd->isoRuns[0].contextPos=0;
+ if(pBiDi->openingsMemory) {
+ bd->openings=pBiDi->openingsMemory;
+- bd->openingsSize=pBiDi->openingsSize;
++ bd->openingsCount=pBiDi->openingsSize / sizeof(Opening);
+ } else {
+ bd->openings=bd->simpleOpenings;
+- bd->openingsSize=SIMPLE_OPENINGS_SIZE;
++ bd->openingsCount=SIMPLE_OPENINGS_SIZE;
+ }
+ bd->isNumbersSpecial=bd->pBiDi->reorderingMode==UBIDI_REORDER_NUMBERS_SPECIAL ||
+ bd->pBiDi->reorderingMode==UBIDI_REORDER_INVERSE_FOR_NUMBERS_SPECIAL;
+@@ -743,7 +743,7 @@
+ bracketAddOpening(BracketData *bd, UChar match, int32_t position) {
+ IsoRun *pLastIsoRun=&bd->isoRuns[bd->isoRunLast];
+ Opening *pOpening;
+- if(pLastIsoRun->limit>=bd->openingsSize) { /* no available new entry */
++ if(pLastIsoRun->limit>=bd->openingsCount) { /* no available new entry */
+ UBiDi *pBiDi=bd->pBiDi;
+ if(!getInitialOpeningsMemory(pBiDi, pLastIsoRun->limit * 2))
+ return FALSE;
+@@ -751,7 +751,7 @@
+ uprv_memcpy(pBiDi->openingsMemory, bd->simpleOpenings,
+ SIMPLE_OPENINGS_SIZE * sizeof(Opening));
+ bd->openings=pBiDi->openingsMemory; /* may have changed */
+- bd->openingsSize=pBiDi->openingsSize;
++ bd->openingsCount=pBiDi->openingsSize / sizeof(Opening);
+ }
+ pOpening=&bd->openings[pLastIsoRun->limit];
+ pOpening->position=position;
+--- icu/source/common/ubidiimp.h.orig 2014-08-09 20:55:15.053161192 +0100
++++ icu/source/common/ubidiimp.h 2014-08-09 20:56:07.028637725 +0100
+@@ -173,7 +173,7 @@
+ /* array of opening entries which should be enough in most cases; no malloc() */
+ Opening simpleOpenings[SIMPLE_OPENINGS_SIZE];
+ Opening *openings; /* pointer to current array of entries */
+- int32_t openingsSize; /* number of allocated entries */
++ int32_t openingsCount; /* number of allocated entries */
+ int32_t isoRunLast; /* index of last used entry */
+ /* array of nested isolated sequence entries; can never excess UBIDI_MAX_EXPLICIT_LEVEL
+ + 1 for index 0, + 1 for before the first isolated sequence */
--- /dev/null
+--- icu/source/common/ubidi.c.orig 2014-08-09 20:54:39.338833533 +0100
++++ icu/source/common/ubidi.c 2014-08-09 20:55:48.625469055 +0100
+@@ -2096,6 +2096,14 @@
+ return DirProp_ON;
+ }
+
++static int
++isolatesavailable(UBiDi *pBiDi) {
++ if (pBiDi->isolates == pBiDi->simpleIsolates) {
++ return pBiDi->isolateCount < SIMPLE_ISOLATES_SIZE-1;
++ }
++ return pBiDi->isolateCount < pBiDi->isolatesSize/sizeof(Isolate)-1;
++}
++
+ static void
+ resolveImplicitLevels(UBiDi *pBiDi,
+ int32_t start, int32_t limit,
+@@ -2239,7 +2247,7 @@
+ /* look for the last char not a BN or LRE/RLE/LRO/RLO/PDF */
+ for(i=limit-1; i>start&&(DIRPROP_FLAG(dirProps[i])&MASK_BN_EXPLICIT); i--);
+ dirProp=dirProps[i];
+- if((dirProp==LRI || dirProp==RLI) && limit<pBiDi->length) {
++ if((dirProp==LRI || dirProp==RLI) && limit<pBiDi->length && isolatesavailable(pBiDi)) {
+ pBiDi->isolateCount++;
+ pBiDi->isolates[pBiDi->isolateCount].stateImp=stateImp;
+ pBiDi->isolates[pBiDi->isolateCount].state=levState.state;
--- /dev/null
+--- misc/icu/source/common/putil.cpp
++++ misc/build/icu/source/common/putil.cpp
+@@ -1111,8 +1111,16 @@
+ static const time_t decemberSolstice=1198332540; /*2007-12-22 06:09 UT*/
+
+ /* This probing will tell us when daylight savings occurs. */
++#if U_PLATFORM_IS_DARWIN_BASED
++ struct tm *tmp;
++ tmp = localtime(&juneSolstice);
++ juneSol = *tmp;
++ tmp = localtime(&decemberSolstice);
++ decemberSol = *tmp;
++#else
+ localtime_r(&juneSolstice, &juneSol);
+ localtime_r(&decemberSolstice, &decemberSol);
++#endif
+ if(decemberSol.tm_isdst > 0) {
+ daylightType = U_DAYLIGHT_DECEMBER;
+ } else if(juneSol.tm_isdst > 0) {
+
--- /dev/null
+--- misc/icu/source/dataMakefile.in.sav 2012-04-05 22:49:20.000000000 +0200
++++ build/icu/source/data/Makefile.in 2012-12-04 14:24:40.548026700 +0100
+@@ -350,6 +350,7 @@
+ ifeq ($(PKGDATA_MODE),dll)
+ SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
+ $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
++ mkdir -p $(OUTTMPDIR)
+ rc.exe /i$(srcdir)/../common /i$(top_builddir)/common /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
+ endif
+ endif
+
--- /dev/null
+--- misc/icu/source/data/pkgdataMakefile.in 2010-12-22 23:44:02.000000000 +0100
++++ misc/build/icu/source/data/pkgdataMakefile.in 2011-01-03 17:52:44.000000000 +0100
+@@ -15,6 +15,9 @@ include $(top_builddir)/icudefs.mk
+ OUTPUTFILE=icupkg.inc
+ MIDDLE_SO_TARGET=
+
++# escape $ with \ when passing to echo; needed to preserve $ORIGIN
++SHLIB.c.shell := $(subst $$,\$$,$(SHLIB.c))
++
+ all : clean
+ @echo GENCCODE_ASSEMBLY_TYPE=$(GENCCODE_ASSEMBLY) >> $(OUTPUTFILE)
+ @echo SO=$(SO) >> $(OUTPUTFILE)
+@@ -24,7 +27,7 @@ all : clean
+ @echo LIB_EXT_ORDER=$(FINAL_SO_TARGET) >> $(OUTPUTFILE)
+ @echo COMPILE="$(COMPILE.c)" >> $(OUTPUTFILE)
+ @echo LIBFLAGS="-I$(top_srcdir)/common -I$(top_builddir)/common $(SHAREDLIBCPPFLAGS) $(SHAREDLIBCFLAGS)" >> $(OUTPUTFILE)
+- @echo GENLIB="$(SHLIB.c)" >> $(OUTPUTFILE)
++ @echo GENLIB="$(SHLIB.c.shell)" >> $(OUTPUTFILE)
+ @echo LDICUDTFLAGS=$(LDFLAGSICUDT) >> $(OUTPUTFILE)
+ @echo LD_SONAME=$(LD_SONAME) >> $(OUTPUTFILE)
+ @echo RPATH_FLAGS=$(RPATH_FLAGS) >> $(OUTPUTFILE)
+--- misc/icu/source/config/mh-linux 2010-09-29 20:37:36.000000000 +0200
++++ misc/build/icu/source/config/mh-linux 2011-03-15 10:56:26.653056004 +0100
+@@ -20,6 +20,11 @@
+ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+ LD_RPATH_PRE = -Wl,-rpath,
+
++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
++## (incl. the C++ runtime libs potentially found in the URE lib dir):
++ENABLE_RPATH=YES
++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'
++
+ ## These are the library specific LDFLAGS
+ LDFLAGSICUDT=-nodefaultlibs -nostdlib
+
+
--- /dev/null
+--- build/icu.old/source/common/uposixdefs.h
++++ build/icu/source/common/uposixdefs.h
+@@ -52,7 +52,7 @@
+ *
+ * z/OS needs this definition for timeval and to get usleep.
+ */
+-#if !defined(_XOPEN_SOURCE_EXTENDED)
++#if !defined(_XOPEN_SOURCE_EXTENDED) && (defined(__IBMC__) || defined(__IBMCPP__))
+ # define _XOPEN_SOURCE_EXTENDED 1
+ #endif
+
+
--- /dev/null
+--- misc/icu/source/common/unicode/utf16.h
++++ misc/build/icu/source/common/unicode/utf16.h
+@@ -319,6 +319,7 @@
+ (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
+ } else /* c>0x10ffff or not enough space */ { \
+ (isError)=TRUE; \
++ (void)(isError); \
+ } \
+ }
+
+--- misc/icu/source/common/unicode/utypes.h
++++ misc/build/icu/source/common/unicode/utypes.h
+@@ -399,7 +399,7 @@
+ * some Linux/Unix compilers have problems with defining global new/delete.
+ * On Windows, it is _MSC_VER>=1200 for MSVC 6.0 and higher.
+ */
+-#if defined(__cplusplus) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
++#if defined(__cplusplus) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && defined (_MSC_VER) && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
+
+ #ifndef U_HIDE_INTERNAL_API
+ /**
+
--- /dev/null
+--- misc/icu/source/config/mh-cygwin-msvc
++++ misc/build/icu/source/config/mh-cygwin-msvc
+@@ -43,10 +43,9 @@
+
+ # /GF pools strings and places them into read-only memory
+ # /EHsc enables exception handling
+-# /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility.
+ # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions.
+-CFLAGS+=-GF -nologo
+-CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t
++CFLAGS+=-GF -nologo -Zc:wchar_t-
++CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t-
+ CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE
+ DEFS+=-DWIN32 -DCYGWINMSVC
+ LDFLAGS+=-nologo
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_flow_engine,jfreereport_flow_engine))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_flow_engine,jfreereport_flow_engine))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_flow_engine,$(LIBO_SHARE_JAVA_FOLDER)/flow-engine.jar,build/lib/flow-engine.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_flute,jfreereport_flute))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_flute,jfreereport_flute))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_flute,$(LIBO_SHARE_JAVA_FOLDER)/flute-$(FLUTE_VERSION).jar,dist/flute-$(FLUTE_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_libbase,jfreereport_libbase))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_libbase,jfreereport_libbase))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_libbase,$(LIBO_SHARE_JAVA_FOLDER)/libbase-$(LIBBASE_VERSION).jar,dist/libbase-$(LIBBASE_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_libfonts,jfreereport_libfonts))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_libfonts,jfreereport_libfonts))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_libfonts,$(LIBO_SHARE_JAVA_FOLDER)/libfonts-$(LIBFONTS_VERSION).jar,dist/libfonts-$(LIBFONTS_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_libformula,jfreereport_libformula))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_libformula,jfreereport_libformula))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_libformula,$(LIBO_SHARE_JAVA_FOLDER)/libformula-$(LIBFORMULA_VERSION).jar,dist/libformula-$(LIBFORMULA_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_liblayout,jfreereport_liblayout))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_liblayout,jfreereport_liblayout))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_liblayout,$(LIBO_SHARE_JAVA_FOLDER)/liblayout.jar,build/lib/liblayout.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_libloader,jfreereport_libloader))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_libloader,jfreereport_libloader))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_libloader,$(LIBO_SHARE_JAVA_FOLDER)/libloader-$(LIBLOADER_VERSION).jar,dist/libloader-$(LIBLOADER_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_librepository,jfreereport_librepository))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_librepository,jfreereport_librepository))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_librepository,$(LIBO_SHARE_JAVA_FOLDER)/librepository-$(LIBREPOSITORY_VERSION).jar,dist/librepository-$(LIBREPOSITORY_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_libserializer,jfreereport_libserializer))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_libserializer,jfreereport_libserializer))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_libserializer,$(LIBO_SHARE_JAVA_FOLDER)/libserializer-$(LIBBASE_VERSION).jar,dist/libserializer-$(LIBBASE_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_libxml,jfreereport_libxml))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_libxml,jfreereport_libxml))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_libxml,$(LIBO_SHARE_JAVA_FOLDER)/libxml-$(LIBXML_VERSION).jar,dist/libxml-$(LIBXML_VERSION).jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,jfreereport_sac,jfreereport_sac))
+
+$(eval $(call gb_ExternalPackage_use_external_project,jfreereport_sac,jfreereport_sac))
+
+$(eval $(call gb_ExternalPackage_add_file,jfreereport_sac,$(LIBO_SHARE_JAVA_FOLDER)/sac.jar,build/lib/sac.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_flow_engine))
+
+$(eval $(call gb_ExternalProject_use_external_projects,jfreereport_flow_engine,\
+ jfreereport_liblayout \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_flow_engine,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_flow_engine,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(SYSTEM_APACHE_COMMONS),\
+ -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR), \
+ -Dcommons-logging.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-1.1.3.jar") \
+ -Dlibbase.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libbase)/dist/libbase-$(LIBBASE_VERSION).jar \
+ -Dlibformula.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libformula)/dist/libformula-$(LIBFORMULA_VERSION).jar \
+ -Dliblayout.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_liblayout)/build/lib/liblayout.jar \
+ -Dlibloader.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libloader)/dist/libloader-$(LIBLOADER_VERSION).jar \
+ -Dlibserializer.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libserializer)/dist/libserializer-$(LIBBASE_VERSION).jar \
+ -Dlibxml.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libxml)/dist/libxml-$(LIBXML_VERSION).jar \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_flute))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_flute,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_flute,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(FLUTE_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_libbase))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_libbase,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_libbase,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBBASE_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_libfonts))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_libfonts,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_libfonts,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBFONTS_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_libformula))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_libformula,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_libformula,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBFORMULA_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_liblayout))
+
+$(eval $(call gb_ExternalProject_use_externals,jfreereport_liblayout,\
+ commons-logging \
+))
+
+$(eval $(call gb_ExternalProject_use_external_projects,jfreereport_liblayout,\
+ jfreereport_sac \
+ jfreereport_libbase \
+ jfreereport_flute \
+ jfreereport_libloader \
+ jfreereport_libxml \
+ jfreereport_libformula \
+ jfreereport_libfonts \
+ jfreereport_librepository \
+ jfreereport_libserializer \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_liblayout,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_liblayout,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(SYSTEM_APACHE_COMMONS),\
+ -Dcommons-logging.jar=$(COMMONS_LOGGING_JAR), \
+ -Dcommons-logging.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-1.1.3.jar") \
+ -Dflute.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_flute)/dist/flute-$(FLUTE_VERSION).jar \
+ -Dlibbase.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libbase)/dist/libbase-$(LIBBASE_VERSION).jar \
+ -Dlibformula.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libformula)/dist/libformula-$(LIBFORMULA_VERSION).jar \
+ -Dlibfonts.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libfonts)/dist/libfonts-$(LIBFONTS_VERSION).jar \
+ -Dlibloader.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libloader)/dist/libloader-$(LIBLOADER_VERSION).jar \
+ -Dlibrepository.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_librepository)/dist/librepository-$(LIBREPOSITORY_VERSION).jar \
+ -Dlibserializer.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libserializer)/dist/libserializer-$(LIBBASE_VERSION).jar \
+ -Dlibxml.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_libxml)/dist/libxml-$(LIBXML_VERSION).jar \
+ -Dsac.jar=$(call gb_UnpackedTarball_get_dir,jfreereport_sac)/build/lib/sac.jar \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_libloader))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_libloader,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_libloader,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBLOADER_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_librepository))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_librepository,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_librepository,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBREPOSITORY_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_libserializer))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_libserializer,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_libserializer,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)." \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBSERIALIZER_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_libxml))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_libxml,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_libxml,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ -Dbuild.id="10682" \
+ -Dproject.revision="$(LIBXML_VERSION)" \
+ $(if $(debug),-Dbuild.debug="on") jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,jfreereport_sac))
+
+$(eval $(call gb_ExternalProject_register_targets,jfreereport_sac,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,jfreereport_sac,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ -Dantcontrib.available="true" \
+ $(if $(debug),-Dbuild.debug="on") all \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,jfreereport))
+
+$(eval $(call gb_Module_add_targets,jfreereport,\
+ ExternalPackage_jfreereport_flow_engine \
+ ExternalPackage_jfreereport_flute \
+ ExternalPackage_jfreereport_libbase \
+ ExternalPackage_jfreereport_libfonts \
+ ExternalPackage_jfreereport_libformula \
+ ExternalPackage_jfreereport_liblayout \
+ ExternalPackage_jfreereport_libloader \
+ ExternalPackage_jfreereport_librepository \
+ ExternalPackage_jfreereport_libserializer \
+ ExternalPackage_jfreereport_libxml \
+ ExternalPackage_jfreereport_sac \
+ ExternalProject_jfreereport_flow_engine \
+ ExternalProject_jfreereport_flute \
+ ExternalProject_jfreereport_libbase \
+ ExternalProject_jfreereport_libfonts \
+ ExternalProject_jfreereport_libformula \
+ ExternalProject_jfreereport_liblayout \
+ ExternalProject_jfreereport_libloader \
+ ExternalProject_jfreereport_librepository \
+ ExternalProject_jfreereport_libserializer \
+ ExternalProject_jfreereport_libxml \
+ ExternalProject_jfreereport_sac \
+ UnpackedTarball_jfreereport_flow_engine \
+ UnpackedTarball_jfreereport_flute \
+ UnpackedTarball_jfreereport_libbase \
+ UnpackedTarball_jfreereport_libfonts \
+ UnpackedTarball_jfreereport_libformula \
+ UnpackedTarball_jfreereport_liblayout \
+ UnpackedTarball_jfreereport_libloader \
+ UnpackedTarball_jfreereport_librepository \
+ UnpackedTarball_jfreereport_libserializer \
+ UnpackedTarball_jfreereport_libxml \
+ UnpackedTarball_jfreereport_sac \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Java library providing basic functionality for the report builder, from [http://www.object-refinery.com/jfreereport/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_flow_engine))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_flow_engine,$(JFREEREPORT_FLOW_ENGINE_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_flow_engine,\
+ build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_flow_engine,\
+ external/jfreereport/patches/flow-engine.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_flute))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_flute,$(JFREEREPORT_FLUTE_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_flute,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_flute,\
+ external/jfreereport/patches/common_build.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_libbase))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_libbase,$(JFREEREPORT_LIBBASE_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libbase,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libbase,\
+ external/jfreereport/patches/common_build.patch \
+ external/jfreereport/patches/libbase-$(LIBBASE_VERSION)-deprecated.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_libfonts))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_libfonts,$(JFREEREPORT_LIBFONTS_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libfonts,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libfonts,\
+ external/jfreereport/patches/common_build.patch \
+ external/jfreereport/patches/libfonts-$(LIBFONTS_VERSION)-deprecated.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_libformula))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_libformula,$(JFREEREPORT_LIBFORMULA_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libformula,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libformula,\
+ external/jfreereport/patches/common_build.patch \
+ external/jfreereport/patches/libformula-time-notz.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_liblayout))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_liblayout,$(JFREEREPORT_LIBLAYOUT_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_liblayout,\
+ build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_liblayout,\
+ external/jfreereport/patches/liblayout.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_libloader))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_libloader,$(JFREEREPORT_LIBLOADER_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libloader,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libloader,\
+ external/jfreereport/patches/common_build.patch \
+ external/jfreereport/patches/libloader-$(LIBLOADER_VERSION)-deprecated.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# for VERSION
+include $(SRCDIR)/external/jfreereport/version.mk
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_librepository))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_librepository,$(JFREEREPORT_LIBREPOSITORY_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_librepository,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_librepository,\
+ external/jfreereport/patches/common_build.patch \
+ external/jfreereport/patches/librepository-$(LIBREPOSITORY_VERSION)-deprecated.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_libserializer))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_libserializer,$(JFREEREPORT_LIBSERIALIZER_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libserializer,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libserializer,\
+ external/jfreereport/patches/common_build.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_libxml))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_libxml,$(JFREEREPORT_LIBXML_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,jfreereport_libxml,\
+ common_build.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jfreereport_libxml,\
+ external/jfreereport/patches/common_build.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jfreereport_sac))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jfreereport_sac,$(JFREEREPORT_SAC_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_file,jfreereport_sac,build.xml,external/jfreereport/java/sac/build.xml))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+<project name="sac" default="all" basedir=".">
+
+ <!-- Properties -->
+
+ <property name="name" value="sac"/>
+ <property name="src" value="src"/>
+ <property name="build" value="build"/>
+ <property name="build.classes" value="${build}/classes"/>
+ <property name="build.doc" value="${build}/api"/>
+ <property name="build.lib" value="${build}/lib"/>
+ <property name="packagenames" value="org.w3c.css.sac.*"/>
+
+ <!-- Targets -->
+
+ <!-- Prepare build directories -->
+ <target name="prepare">
+ <mkdir dir="${src}"/>
+ <mkdir dir="${build}"/>
+ <mkdir dir="${build.classes}"/>
+ <mkdir dir="${build.lib}"/>
+ <mkdir dir="${build.doc}"/>
+ <copy todir="${src}/org">
+ <fileset dir="org"/>
+ </copy>
+ </target>
+
+ <!-- Kill all the created directories -->
+ <target name="clean">
+ <delete dir="${build}"/>
+ <delete dir="${src}"/>
+ </target>
+
+ <!-- Build classes -->
+ <target name="classes" depends="prepare">
+ <javac srcdir="${src}" destdir="${build.classes}" debug="off" optimize="on"/>
+ <copy todir="${build.classes}">
+ <fileset dir="${src}">
+ <include name="**/*.properties"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- Build jar archives -->
+ <target name="jar" depends="classes">
+ <jar jarfile="${build.lib}/${name}.jar" basedir="${build.classes}"/>
+ </target>
+
+ <!-- Build the full JavaDocs -->
+ <target name="javadoc" depends="prepare">
+ <javadoc sourcepath="${src}"
+ destdir="${build.doc}"
+ doctitle="${name} JavaDoc"
+ windowtitle="${name} JavaDoc"
+ package="true"
+ author="true"
+ version="true"
+ packagenames="${packagenames}"
+ />
+ </target>
+
+ <!-- Build everything -->
+ <target name="all" depends="jar,javadoc"/>
+
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>flute-13a</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/flute</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>flute</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>jcommon-serializer</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/jcommon-serializer</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>jcommon-serializer</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>jfreereport</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/jfreereport</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>jfreereport</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>libfonts</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/libfonts</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>libfonts</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>libformula</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/libformula</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>libformula</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>liblayout</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/liblayout</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>liblayout</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>libloader</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/libloader</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>libloader</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>librepository</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/librepository</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>librepository</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+ <!-- Do not use Project Properties customizer when editing this file manually. -->
+ <name>libxml</name>
+ <properties>
+ <property name="project.dir">../../wntmsci10/misc/build/libxml</property>
+ <property name="ant.script">${project.dir}/ant/build.xml</property>
+ </properties>
+ <folders>
+ <source-folder>
+ <label>libxml</label>
+ <location>${project.dir}</location>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <script>${ant.script}</script>
+ <target>all</target>
+ </action>
+ <action name="javadoc">
+ <script>${ant.script}</script>
+ <target>javadoc</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-file>
+ <location>${ant.script}</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="javadoc"/>
+ </context-menu>
+ </view>
+ </general-data>
+ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"/>
+ </configuration>
+</project>
--- /dev/null
+--- misc/libloader-1.1.3/common_build.xml 2009-11-16 10:25:34.000000000 +0100
++++ misc/build/libloader-1.1.3/common_build.xml 2009-12-04 10:22:24.277647200 +0100
+@@ -261,7 +261,7 @@ TYPICAL TARGET SEQUENCE
+ <property name="project.revision" value="${Implementation-Version}" description="Sets the version number of the project based on the Implementation-Version found in the manifest file (if one is supplied and nothing is specified in the build.properties)" />
+ <fail message="A project revision number has not been determined!">
+ <condition>
+- <matches string="${project.revision}" pattern="\$\{.*\}" />
++ <contains string="${project.revision}" substring="\$\{" />
+ </condition>
+ </fail>
+
+@@ -270,7 +270,7 @@ TYPICAL TARGET SEQUENCE
+ <property name="impl.title" value="${Implementation-Title}" description="Sets the title of the project based on the Implementation-Title found in the manifest file (if one is supplied and nothing is specified in the build.properties)" />
+ <fail message="A project title has not been determined!">
+ <condition>
+- <matches string="${impl.title}" pattern="\$\{.*\}" />
++ <contains string="${impl.title}" substring="\$\{" />
+ </condition>
+ </fail>
+
+@@ -497,7 +497,7 @@
+ Sets a property build.id to the either "development" or the svn revision
+ if in release mode
+ ====================================================================-->
+- <target name="set-build.id" unless="build.id" depends="install-antcontrib">
++ <target name="set-build.id" unless="build.id" >
+ <if>
+ <istrue value="${release}" />
+ <then>
+@@ -1061,6 +1061,11 @@
+ Performs the actual compile
+ ====================================================================-->
+ <target name="compile.compile" depends="init">
++ <copy todir="${classes.dir}">
++ <fileset dir="source">
++ <include name="**/*.properties"/>
++ </fileset>
++ </copy>
+ <javac destdir="${classes.dir}"
+ debug="${javac.debug}"
+ deprecation="${javac.deprecation}"
+@@ -1082,27 +1087,32 @@
+ duplicate copying of resources from src tree (handled by compile.src_copy
+ if jar.include.source is set.
+ ====================================================================-->
+- <target name="compile.res_copy" depends="install-antcontrib">
+- <if>
+- <available file="${res.dir}" />
+- <then>
+- <copy todir="${classes.dir}">
+- <fileset dir="${res.dir}" />
+- </copy>
+- </then>
+- </if>
++ <target name="compile.res_copy" >
++ <condition property="copy.res.available">
++ <available file="$(res.dir)" type="dir" />
++ </condition>
++ <antcall target="copy.res" />
+
+- <if>
+- <not>
+- <isset property="jar.include.source" />
+- </not>
+- <then>
+- <copy todir="${classes.dir}" flatten="false">
+- <fileset dir="${src.dir}" excludes="**/*.java" />
+- </copy>
+- </then>
+- </if>
+- </target>
++ <condition property="copy.res.class.available">
++ <not>
++ <isset property="jar.include.source" />
++ </not>
++ </condition>
++ <antcall target="copy.res.class" />
++ </target>
++
++ <target name="copy.res" if="copy.res.available" >
++ <copy todir="${classes.dir}">
++ <fileset dir="${res.dir}"/>
++ </copy>
++ </target>
++
++ <target name="copy.res.class" if="copy.res.class.available" >
++ <uptodate targetfile="${classes.dir}" property="s">
++ <srcfiles dir= "${src.dir}" excludes="**/*.java" />
++ <flattenmapper/>
++ </uptodate>
++ </target>
+
+
+ <!--=======================================================================
+@@ -1167,7 +1177,6 @@
+ <target name="generate.manifest" depends="init,set-build.id">
+ <delete file="${dist.manifest.file}" />
+ <touch file="${dist.manifest.file}" />
+- <copy file="${manifest.file}" tofile="${dist.manifest.file}" overwrite="true" failonerror="false" />
+
+ <manifest file="${dist.manifest.file}" mode="update">
+ <attribute name="Implementation-Title" value="${impl.title}" />
--- /dev/null
+--- misc/flow-engine-0.9.4/build.xml (Revision 6728)
++++ misc/build/flow-engine-0.9.4/build.xml (Arbeitskopie)
+@@ -24,9 +24,13 @@
+
+ <!-- Setup the compile classpath -->
+ <path id="classpath">
+- <fileset dir="lib">
+- <include name="*.jar" />
+- </fileset>
++ <pathelement path="${commons-logging.jar}"/>
++ <pathelement path="${libbase.jar}"/>
++ <pathelement path="${libformula.jar}"/>
++ <pathelement path="${liblayout.jar}"/>
++ <pathelement path="${libloader.jar}"/>
++ <pathelement path="${libserializer.jar}"/>
++ <pathelement path="${libxml.jar}"/>
+ </path>
+
+ <!-- Kill all the created directories -->
--- /dev/null
+--- misc/libbase-1.1.6/source/org/pentaho/reporting/libraries/base/boot/ModuleInitializeException.java 2010-04-27 15:58:44.000000000 +0200
++++ misc/build/libbase-1.1.6/source/org/pentaho/reporting/libraries/base/boot/ModuleInitializeException.java 2011-06-13 01:28:14.000000000 +0200
+@@ -48,7 +48,7 @@
+ */
+ public ModuleInitializeException(final String s, final Exception e)
+ {
+- super(s, e);
++ super(s, (Throwable) e);
+ }
+
+ /**
--- /dev/null
+--- misc/libfonts-1.1.6/source/org/pentaho/reporting/libraries/fonts/FontException.java 2010-04-27 16:09:00.000000000 +0200
++++ misc/build/libfonts-1.1.6/source/org/pentaho/reporting/libraries/fonts/FontException.java 2011-06-13 02:04:51.000000000 +0200
+@@ -39,7 +39,7 @@
+ */
+ public FontException(final String message, final Exception ex)
+ {
+- super(message, ex);
++ super(message, (Throwable) ex);
+ }
+
+ /**
--- /dev/null
+--- a/jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/DefaultLocalizationContext.java 2010-06-01 17:15:52.000000000 +0200
++++ a/jfreereport_libformula.patched/source/org/pentaho/reporting/libraries/formula/DefaultLocalizationContext.java 2013-08-06 13:11:58.000000000 +0200
+@@ -162,11 +169,17 @@
+ final Locale activeLocale = getLocale();
+ datetimeFormats.add(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, activeLocale));
+ dateFormats.add(DateFormat.getDateInstance(DateFormat.FULL, activeLocale));
+- timeFormats.add(DateFormat.getTimeInstance(DateFormat.FULL, activeLocale));
++ // LEM: "FULL" does not really make sense for isolated times:
++ // in the absence of a date, it cannot know whether it is meant in the winter-timezone
++ // or in the summer (daylight saving time) timezone, and will always display the winter timezone.
++ // timeFormats.add(DateFormat.getTimeInstance(DateFormat.FULL, activeLocale));
+
+ datetimeFormats.add(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, activeLocale));
+ dateFormats.add(DateFormat.getDateInstance(DateFormat.LONG, activeLocale));
+- timeFormats.add(DateFormat.getTimeInstance(DateFormat.LONG, activeLocale));
++ // LEM: "LONG" does not really make sense for isolated times:
++ // in the absence of a date, it cannot know whether it is meant in the winter-timezone
++ // or in the summer (daylight saving time) timezone, and will always display the winter timezone.
++ // timeFormats.add(DateFormat.getTimeInstance(DateFormat.LONG, activeLocale));
+
+ datetimeFormats.add(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, activeLocale));
+ dateFormats.add(DateFormat.getDateInstance(DateFormat.MEDIUM, activeLocale));
--- /dev/null
+--- misc/liblayout-0.2.10/build.xml (Revision 6728)
++++ misc/build/liblayout-0.2.10/build.xml (Arbeitskopie)
+@@ -24,9 +24,16 @@
+
+ <!-- Setup the compile classpath -->
+ <path id="classpath">
+- <fileset dir="lib">
+- <include name="*.jar" />
+- </fileset>
++ <pathelement path="${commons-logging.jar}"/>
++ <pathelement path="${flute.jar}"/>
++ <pathelement path="${libbase.jar}"/>
++ <pathelement path="${libformula.jar}"/>
++ <pathelement path="${libfonts.jar}"/>
++ <pathelement path="${libloader.jar}"/>
++ <pathelement path="${librepository.jar}"/>
++ <pathelement path="${libserializer.jar}"/>
++ <pathelement path="${libxml.jar}"/>
++ <pathelement path="${sac.jar}"/>
+ </path>
+
+ <!-- Kill all the created directories -->
--- /dev/null
+--- misc/libloader-1.1.6/source/org/pentaho/reporting/libraries/resourceloader/ResourceException.java 2010-04-27 16:07:00.000000000 +0200
++++ misc/build/libloader-1.1.6/source/org/pentaho/reporting/libraries/resourceloader/ResourceException.java 2011-06-13 02:00:46.000000000 +0200
+@@ -42,7 +42,7 @@
+ */
+ public ResourceException(final String message, final Exception ex)
+ {
+- super(message, ex);
++ super(message, (Throwable) ex);
+ }
+
+ /**
--- /dev/null
+--- misc/librepository-1.1.6/source/org/pentaho/reporting/libraries/repository/ContentIOException.java 2010-04-27 16:04:50.000000000 +0200
++++ misc/build/librepository-1.1.6/source/org/pentaho/reporting/libraries/repository/ContentIOException.java 2011-06-13 01:44:35.000000000 +0200
+@@ -43,7 +43,7 @@
+ */
+ public ContentIOException(final String message, final Exception ex)
+ {
+- super(message, ex);
++ super(message, (Throwable) ex);
+ }
+
+ /**
--- /dev/null
+*** misc/sac-1.3/build.xml Thu Oct 18 09:22:24 2007
+--- misc/build/sac-1.3/build.xml Thu Oct 18 08:53:59 2007
+***************
+*** 1 ****
+! dummy
+--- 1,66 ----
+! <!-- simple generic build file -->
+!
+! <project name="sac" default="all" basedir=".">
+!
+! <!-- Properties -->
+!
+! <property name="name" value="sac"/>
+! <property name="src" value="src"/>
+! <property name="build" value="build"/>
+! <property name="build.classes" value="${build}/classes"/>
+! <property name="build.doc" value="${build}/api"/>
+! <property name="build.lib" value="${build}/lib"/>
+! <property name="packagenames" value="org.w3c.css.sac.*"/>
+!
+! <!-- Targets -->
+!
+! <!-- Prepare build directories -->
+! <target name="prepare">
+! <mkdir dir="${src}"/>
+! <mkdir dir="${build}"/>
+! <mkdir dir="${build.classes}"/>
+! <mkdir dir="${build.lib}"/>
+! <mkdir dir="${build.doc}"/>
+! <copy todir="${src}/org">
+! <fileset dir="org"/>
+! </copy>
+! </target>
+!
+! <!-- Kill all the created directories -->
+! <target name="clean">
+! <delete dir="${build}"/>
+! <delete dir="${src}"/>
+! </target>
+!
+! <!-- Build classes -->
+! <target name="classes" depends="prepare">
+! <javac srcdir="${src}" destdir="${build.classes}" debug="off" optimize="on"/>
+! <copy todir="${build.classes}">
+! <fileset dir="${src}">
+! <include name="**/*.properties"/>
+! </fileset>
+! </copy>
+! </target>
+!
+! <!-- Build jar archives -->
+! <target name="jar" depends="classes">
+! <jar jarfile="${build.lib}/${name}.jar" basedir="${build.classes}"/>
+! </target>
+!
+! <!-- Build the full JavaDocs -->
+! <target name="javadoc" depends="prepare">
+! <javadoc sourcepath="${src}"
+! destdir="${build.doc}"
+! doctitle="${name} JavaDoc"
+! windowtitle="${name} JavaDoc"
+! package="true"
+! author="true"
+! version="true"
+! packagenames="${packagenames}"
+! />
+! </target>
+!
+! <!-- Build everything -->
+! <target name="all" depends="jar,javadoc"/>
+!
+! </project>
+\ No newline at end of file
--- /dev/null
+FLUTE_VERSION=1.1.6
+LIBBASE_VERSION=1.1.6
+LIBFONTS_VERSION=1.1.6
+LIBFORMAT_VERSION=1.1.6
+LIBFORMULA_VERSION=1.1.7
+LIBLOADER_VERSION=1.1.6
+LIBREPOSITORY_VERSION=1.1.6
+LIBSERIALIZER_VERSION=1.1.6
+LIBXML_VERSION=1.1.7
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,jpeg))
+
+ifeq ($(SYSTEM_JPEG),)
+
+$(eval $(call gb_Module_add_targets,jpeg,\
+ UnpackedTarball_jpeg \
+ StaticLibrary_jpeg \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+External library for reading/writing jpegs
+
+This is only used by the jpeg import filter that is provided
+for use by VCL see [[vcl/source/filter/jpeg]]
+
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,jpeg))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,jpeg))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,jpeg,jpeg))
+
+$(eval $(call gb_StaticLibrary_set_include,jpeg,\
+ -I$(call gb_UnpackedTarball_get_dir,jpeg) \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,jpeg,\
+ UnpackedTarball/jpeg/jaricom \
+ UnpackedTarball/jpeg/jcapimin \
+ UnpackedTarball/jpeg/jcapistd \
+ UnpackedTarball/jpeg/jcarith \
+ UnpackedTarball/jpeg/jccoefct \
+ UnpackedTarball/jpeg/jccolor \
+ UnpackedTarball/jpeg/jcdctmgr \
+ UnpackedTarball/jpeg/jchuff \
+ UnpackedTarball/jpeg/jcinit \
+ UnpackedTarball/jpeg/jcmainct \
+ UnpackedTarball/jpeg/jcmarker \
+ UnpackedTarball/jpeg/jcmaster \
+ UnpackedTarball/jpeg/jcomapi \
+ UnpackedTarball/jpeg/jcparam \
+ UnpackedTarball/jpeg/jcprepct \
+ UnpackedTarball/jpeg/jcsample \
+ UnpackedTarball/jpeg/jctrans \
+ UnpackedTarball/jpeg/jdapimin \
+ UnpackedTarball/jpeg/jdapistd \
+ UnpackedTarball/jpeg/jdarith \
+ UnpackedTarball/jpeg/jdatadst \
+ UnpackedTarball/jpeg/jdatasrc \
+ UnpackedTarball/jpeg/jdcoefct \
+ UnpackedTarball/jpeg/jdcolor \
+ UnpackedTarball/jpeg/jddctmgr \
+ UnpackedTarball/jpeg/jdhuff \
+ UnpackedTarball/jpeg/jdinput \
+ UnpackedTarball/jpeg/jdmainct \
+ UnpackedTarball/jpeg/jdmarker \
+ UnpackedTarball/jpeg/jdmaster \
+ UnpackedTarball/jpeg/jdmerge \
+ UnpackedTarball/jpeg/jdpostct \
+ UnpackedTarball/jpeg/jdsample \
+ UnpackedTarball/jpeg/jdtrans \
+ UnpackedTarball/jpeg/jerror \
+ UnpackedTarball/jpeg/jfdctflt \
+ UnpackedTarball/jpeg/jfdctfst \
+ UnpackedTarball/jpeg/jfdctint \
+ UnpackedTarball/jpeg/jidctflt \
+ UnpackedTarball/jpeg/jidctfst \
+ UnpackedTarball/jpeg/jidctint \
+ UnpackedTarball/jpeg/jquant1 \
+ UnpackedTarball/jpeg/jquant2 \
+ UnpackedTarball/jpeg/jmemmgr \
+ UnpackedTarball/jpeg/jmemnobs \
+ UnpackedTarball/jpeg/jutils \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,jpeg))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,jpeg,$(JPEG_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_file,jpeg,jconfig.h,external/jpeg/configs/jconfig.h))
+
+$(eval $(call gb_UnpackedTarball_add_patches,jpeg,\
+ external/jpeg/patches/jpeg-8c-jmorecfg.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+/* jconfig.h. Generated from jconfig.cfg by configure. */
+/* jconfig.cfg --- source file edited by configure script */
+/* see jconfig.txt for explanations */
+
+#define HAVE_PROTOTYPES 1
+#define HAVE_UNSIGNED_CHAR 1
+#define HAVE_UNSIGNED_SHORT 1
+/* #undef void */
+/* #undef const */
+/* #undef CHAR_IS_UNSIGNED */
+#define HAVE_STDDEF_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_LOCALE_H 1
+/* #undef NEED_BSD_STRINGS */
+/* #undef NEED_SYS_TYPES_H */
+/* #undef NEED_FAR_POINTERS */
+/* #undef NEED_SHORT_EXTERNAL_NAMES */
+/* Define this if you get warnings about undefined structures. */
+/* #undef INCOMPLETE_TYPES_BROKEN */
+
+/* Define "boolean" as unsigned char, not enum, on Windows systems. */
+#ifdef _WIN32
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#ifndef FALSE /* in case these macros already exist */
+#define FALSE 0 /* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+#endif
+
+#ifdef JPEG_INTERNALS
+
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
+#ifdef WNT
+#define INLINE __inline
+#elif defined SOLARIS
+#define INLINE
+#else
+#define INLINE inline
+#endif
+/* These are for configuring the JPEG memory manager. */
+/* #undef DEFAULT_MAX_MEM */
+/* #undef NO_MKTEMP */
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#undef BMP_SUPPORTED /* BMP image file format */
+#undef GIF_SUPPORTED /* GIF image file format */
+#undef PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
+/* #undef RLE_SUPPORTED */
+#undef TARGA_SUPPORTED /* Targa image file format */
+
+/* #undef TWO_FILE_COMMANDLINE */
+/* #undef NEED_SIGNAL_CATCHER */
+/* #undef DONT_USE_B_MODE */
+
+/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
+/* #undef PROGRESS_REPORT */
+
+#endif /* JPEG_CJPEG_DJPEG */
--- /dev/null
+--- misc/jpeg-9a/jmorecfg.h 2009-11-20 09:01:24.000000000 +0100
++++ misc/build/jpeg-9a/jmorecfg.h 2011-03-24 21:29:02.073761750 +0100
+@@ -210,6 +210,7 @@
+ /* INT32 must hold at least signed 32-bit values. */
+
+ #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
++#ifndef _SOLAR_H
+ #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
+ #ifndef _BASETSD_H /* MinGW is slightly different */
+ #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
+@@ -217,6 +218,7 @@
+ #endif
+ #endif
+ #endif
++#endif
+ #endif
+
+ /* Datatype used for image dimensions. The JPEG standard only supports
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExtensionPackage_ExtensionPackage,LanguageTool,$(call gb_UnpackedTarball_get_dir,languagetool)/dist/LanguageTool.oxt))
+
+$(eval $(call gb_ExtensionPackage_use_external_project,LanguageTool,languagetool))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,languagetool))
+
+$(eval $(call gb_ExternalProject_register_targets,languagetool,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_jars,languagetool,\
+ juh \
+ jurt \
+ ridl \
+ unoil \
+))
+
+$(call gb_ExternalProject_get_state_target,languagetool,build) :
+ cd "$(call gb_UnpackedTarball_get_dir,languagetool)" && \
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ -Dext.ooo.juh.lib="$(call gb_Jar_get_target,juh)" \
+ -Dext.ooo.jurt.lib="$(call gb_Jar_get_target,jurt)" \
+ -Dext.ooo.ridl.lib="$(call gb_Jar_get_target,ridl)" \
+ -Dext.ooo.unoil.lib="$(call gb_Jar_get_target,unoil)" \
+ dist && \
+ touch $@
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/JLanguageTool-1.7.0/build.xml 2012-02-29 22:18:05.118789546 +0100
++++ misc/build/JLanguageTool-1.7.0/build.xml 2012-02-29 22:17:02.385235706 +0100
+@@ -82,7 +82,6 @@
+ <include name="openoffice/Linguistic.xcu"/>
+ <include name="openoffice/description.xml"/>
+ <include name="openoffice/images/dialog.png"/>
+- <include name="openoffice/images/dialogh.png"/>
+ <include name="openoffice/images/LanguageToolBig.png"/>
+ <include name="openoffice/images/LanguageToolSmall.png"/>
+ <include name="openoffice/images/dialog.png"/>
+--- misc/build/JLanguageTool-1.7.0/openoffice/Linguistic.xcu 2011-06-26 20:29:43.000000000 +0200
++++ misc/build/JLanguageTool-1.7.0/openoffice/Linguistic.xcu 2012-02-29 22:17:25.551071099 +0100
+@@ -27,9 +27,6 @@
+ <prop oor:name="SpellAndGrammarDialogImage" oor:type="xs:string">
+ <value>%origin%/images/dialog.png</value>
+ </prop>
+- <prop oor:name="SpellAndGrammarDialogImage_HC" oor:type="xs:string">
+- <value>%origin%/images/dialogh.png</value>
+- </prop>
+ </node>
+ </node>
+ </node>
--- /dev/null
+diff -Naur misc/build/JLanguageTool-1.7.0/build.xml misc/build/JLanguageTool-1.7.0_patched/build.xml
+--- misc/build/JLanguageTool-1.7.0/build.xml 2012-06-25 08:22:35.000000000 +0200
++++ misc/build/JLanguageTool-1.7.0_patched/build.xml 2012-06-25 09:27:39.077442000 +0200
+@@ -29,7 +29,9 @@
+ <pathelement location="${ext.CJFtransform.lib}" />
+ <pathelement location="${ext.commons-validator.lib}" />
+ <!-- -->
+- <pathelement location="${ext.ooo.juh.lib}" />
++ <pathelement location="${ext.junit.lib}"/>
++ <!-- -->
++ <pathelement location="${ext.ooo.juh.lib}" />
+ <pathelement location="${ext.ooo.unoil.lib}" />
+ <pathelement location="${ext.ooo.ridl.lib}" />
+ <pathelement location="${ext.ooo.jurt.lib}" />
+@@ -442,11 +444,11 @@
+ <!-- ================================================================== -->
+
+ <target name="dist" depends="ooo-internal" description="Builds one ZIP for both OpenOffice.org and stand-alone use">
+-<zip compress="yes" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
++<zip compress="yes" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
+ </target>
+
+ <target name="fast" depends="ooo-internal" description="like dist, but without ZIP compression (for development only)">
+-<zip compress="no" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
++<zip compress="no" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
+ </target>
+
+ <target name="common" depends="clean,init,build,ooo-build">
+@@ -651,7 +653,6 @@
+ <copy file="${resource.dir}/ast/asturian.dict" todir="${dist.dir}/resource/ast" />
+ <copy file="${resource.dir}/ast/asturian.info" todir="${dist.dir}/resource/ast" />
+
+- <copy file="${resource.dir}/xx/dummy.dict" tofile="${dist.dir}/resource/cs/czech.dict" />
+ <copy todir="${dist.dir}/rules">
+ <fileset dir="src/rules" excludes="CVS" />
+ </copy>
+@@ -678,7 +678,7 @@
+
+ <filter filtersFile="ooolocales.properties" />
+ <copy filtering="true" encoding="${encoding}" todir="${dist.dir}/">
+- <fileset dir="openoffice/" includes="description.xml,*.xcu,Options.xdl,META-INF/**" />
++ <fileset dir="openoffice/" includes="components.rdb,description.xml,*.xcu,Options.xdl,META-INF/**" />
+ </copy>
+ <copy todir="${dist.dir}/">
+ <fileset dir="openoffice/" includes="images/**,help/**" />
+diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/components.rdb misc/build/JLanguageTool-1.7.0_patched/openoffice/components.rdb
+--- misc/build/JLanguageTool-1.7.0/openoffice/components.rdb 1970-01-01 01:00:00.000000000 +0100
++++ misc/build/JLanguageTool-1.7.0_patched/openoffice/components.rdb 2012-06-25 10:26:23.183633100 +0200
+@@ -0,0 +1,9 @@
++<?xml version="1.0"?>
++<components xmlns="http://openoffice.org/2010/uno-components">
++ <component loader="com.sun.star.loader.Java2" uri="./LanguageTool.uno.jar">
++ <implementation name="org.languagetool.openoffice.Main">
++ <service name="com.sun.star.linguistic2.Proofreader"/>
++ <service name="org.languagetool.openoffice.Main"/>
++ </implementation>
++ </component>
++</components>
+diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/META-INF/manifest.xml misc/build/JLanguageTool-1.7.0_patched/openoffice/META-INF/manifest.xml
+--- misc/build/JLanguageTool-1.7.0/openoffice/META-INF/manifest.xml 2012-06-25 08:22:34.000000000 +0200
++++ misc/build/JLanguageTool-1.7.0_patched/openoffice/META-INF/manifest.xml 2012-06-25 09:39:56.751738000 +0200
+@@ -2,8 +2,8 @@
+ <manifest:manifest>
+ <manifest:file-entry manifest:full-path="Addons.xcu"
+ manifest:media-type="application/vnd.sun.star.configuration-data" />
+- <manifest:file-entry manifest:full-path="LanguageTool.uno.jar"
+- manifest:media-type="application/vnd.sun.star.uno-component;type=Java" />
++ <manifest:file-entry manifest:full-path="components.rdb"
++ manifest:media-type="application/vnd.sun.star.uno-components" />
+ <manifest:file-entry
+ manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="Linguistic.xcu" />
+diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/description.xml misc/build/JLanguageTool-1.7.0_patched/openoffice/description.xml
+--- misc/build/JLanguageTool-1.7.0/openoffice/description.xml 2012-06-25 08:22:35.000000000 +0200
++++ misc/build/JLanguageTool-1.7.0_patched/openoffice/description.xml 2012-06-25 10:29:48.520591800 +0200
+@@ -21,7 +21,7 @@
+ <name lang="zh">LanguageTool. 开源的语言检查工具</name>
+ <name lang="br">LanguageTool. Reizher reizhskrivadurel frank.</name>
+ </display-name>
+- <version value="@version@" />
++ <version value="1.7.1" />
+ <release-notes>
+ <src xlink:href="CHANGES.txt" lang="en" />
+ </release-notes>
+diff -Naur misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/gui/Configuration.java misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/gui/Configuration.java
+--- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/gui/Configuration.java 2012-06-25 08:21:31.000000000 +0200
++++ misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/gui/Configuration.java 2012-06-25 09:31:40.737466400 +0200
+@@ -23,6 +23,7 @@
+ import java.io.FileNotFoundException;
+ import java.io.FileOutputStream;
+ import java.io.IOException;
++import java.lang.ClassLoader;
+ import java.util.*;
+
+ import org.languagetool.Language;
+@@ -142,7 +143,18 @@
+
+ final String motherTongueStr = (String) props.get(MOTHER_TONGUE_CONFIG_KEY);
+ if (motherTongueStr != null) {
+- motherTongue = Language.getLanguageForShortName(motherTongueStr);
++ // FIXME: hack to disable the functionality for JRE 1.5
++ // javax.xml.bind.JAXBException is part of JRE 1.6
++ boolean isJRE15 = false;
++ try {
++ ClassLoader cl = ClassLoader.getSystemClassLoader();
++ cl.loadClass("javax.xml.bind.JAXBException");
++ } catch (ClassNotFoundException e) {
++ isJRE15 = true;
++ }
++ if (!isJRE15) {
++ motherTongue = Language.getLanguageForShortName(motherTongueStr);
++ }
+ }
+
+ final String autoDetectStr = (String) props.get(AUTO_DETECT_CONFIG_KEY);
+diff -Naur misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/Main.java misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/openoffice/Main.java
+--- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/Main.java 2012-06-25 08:21:28.000000000 +0200
++++ misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/openoffice/Main.java 2012-06-25 09:36:03.778528700 +0200
+@@ -24,6 +24,7 @@
+ * @author Marcin Miłkowski
+ */
+ import java.io.File;
++import java.lang.ClassLoader;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Comparator;
+@@ -494,6 +495,14 @@
+ */
+ @Override
+ public final Locale[] getLocales() {
++ // FIXME: hack to disable the functionality for JRE 1.5
++ // javax.xml.bind.JAXBException is part of JRE 1.6
++ try {
++ ClassLoader cl = ClassLoader.getSystemClassLoader();
++ cl.loadClass("javax.xml.bind.JAXBException");
++ } catch (ClassNotFoundException e) {
++ return new Locale[0];
++ }
+ try {
+ int dims = 0;
+ for (final Language element : Language.LANGUAGES) {
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/OOoAboutDialog.java 2013-07-11 13:33:26.681387525 +0100
++++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/OOoAboutDialog.java 2013-07-11 13:34:46.666424549 +0100
+@@ -19,6 +19,7 @@
+ package org.languagetool.openoffice;
+
+ import com.sun.star.awt.Rectangle;
++import com.sun.star.awt.MessageBoxType;
+ import com.sun.star.awt.XMessageBox;
+ import com.sun.star.awt.XMessageBoxFactory;
+ import com.sun.star.awt.XWindowPeer;
+@@ -49,16 +50,14 @@
+ .getString("guiMenuAbout"));
+ final XMessageBoxFactory messageBoxFactory = (XMessageBoxFactory) UnoRuntime
+ .queryInterface(XMessageBoxFactory.class, winPeer.getToolkit());
+- final Rectangle messageBoxRectangle = new Rectangle();
+ final XMessageBox box = messageBoxFactory
+ .createMessageBox(
+ winPeer,
+- messageBoxRectangle,
+- "infobox",
++ MessageBoxType.INFOBOX,
+ 0,
+ aboutDialogTitle,
+ getAboutText());
+ box.execute();
+ }
+
+-}
+\ No newline at end of file
++}
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,languagetool))
+
+ifneq ($(ENABLE_JAVA),)
+ifneq ($(filter LANGUAGETOOL,$(BUILD_TYPE)),)
+$(eval $(call gb_Module_add_targets,languagetool,\
+ ExternalProject_languagetool \
+ ExtensionPackage_LanguageTool \
+ UnpackedTarball_languagetool \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Style and grammar checker for various languages written in Java, from [http://www.languagetool.org/]
+
+Shipping this is a compile-time option for LibreOffice, but our
+downloadable builds use the light-weight lightproof grammer checker
+instead to avoid the Java bootstrapping performance issues.
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,languagetool))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,languagetool,$(LANGUAGETOOL_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,languagetool,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,languagetool,\
+ external/languagetool/JLanguageTool-1.7.0.patch \
+ external/languagetool/JLanguageTool-1.4.0-no-hc.patch \
+ external/languagetool/MessageBox-apichange.patch \
+ external/languagetool/english.ireland.patch \
+ external/languagetool/esperanto.territory.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/English.java.orig 2013-11-18 09:41:10.625421948 +0000
++++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/English.java 2013-11-18 09:41:25.736570684 +0000
+@@ -67,7 +67,7 @@
+
+ @Override
+ public final String[] getCountryVariants() {
+- return new String[]{"GB", "US", "AU", "CA", "NZ", "ZA"};
++ return new String[]{"GB", "US", "AU", "CA", "IE", "NZ", "ZA"};
+ }
+
+ @Override
--- /dev/null
+--- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/Esperanto.java.orig 2013-11-18 10:18:49.111712785 +0000
++++ misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/language/Esperanto.java 2013-11-18 10:18:59.254813036 +0000
+@@ -71,8 +71,7 @@
+
+ @Override
+ public String[] getCountryVariants() {
+- /* return "ANY" country code as a "country-less" placeholder for OOo: */
+- return new String[] {"ANY"};
++ return new String[] {""};
+ }
+
+ @Override
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,lcms2,lcms2))
+
+$(eval $(call gb_ExternalPackage_use_external_project,lcms2,lcms2))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.2.dylib,src/.libs/liblcms2.2.dylib))
+else ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2-2.dll,src/.libs/liblcms2-2.dll))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/lcms2.dll,bin/lcms2.dll))
+endif # $(COM)
+else # $(OS) != WNT/MACOSX
+$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.6))
+endif # $(OS)
+endif # $(DISABLE_DYNLOADING)
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,lcms2))
+
+$(eval $(call gb_ExternalProject_register_targets,lcms2,\
+ build \
+))
+
+ifeq ($(COM),MSC)
+
+$(call gb_ExternalProject_get_state_target,lcms2,build):
+ $(call gb_ExternalProject_run,build,\
+ MSBuild.exe lcms2_DLL.vcxproj \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ /p:Platform=Win32 /p:TargetName=lcms2 \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) /p:VisualStudioVersion=11.0) \
+ ,Projects/VC2010/lcms2_DLL)
+else
+$(call gb_ExternalProject_get_state_target,lcms2,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --without-jpeg --without-tiff --with-pic \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ CPPFLAGS=" $(SOLARINC)" \
+ $(if $(filter-out WNTGCC,$(OS)$(COM)),,CPPFLAGS=" -DCMS_DLL_BUILD") \
+ $(if $(filter IOS ANDROID,$(OS)), --disable-shared --enable-static, --enable-shared --disable-static) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && cd src \
+ && $(MAKE) \
+ )
+endif
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,lcms2))
+
+$(eval $(call gb_Module_add_targets,lcms2,\
+ UnpackedTarball_lcms2 \
+ ExternalPackage_lcms2 \
+ ExternalProject_lcms2 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+lcms2 (little cms engine)
+lcms2: Little cms is a small, speed optimized color management engine.
+with the new libcdr, writerperfect will depend on lcms2
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,lcms2))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,lcms2,$(LCMS2_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,lcms2,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,lcms2,\
+ external/lcms2/lcms2.patch \
+ external/lcms2/lcms2-2.4-windows.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/lcms2-2.4/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcproj 2012-09-10 18:01:51.000000000 +0200
++++ misc/build/lcms2-2.4/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcproj 2012-10-05 22:35:01.607191700 +0200
+@@ -205,6 +205,10 @@
+ >
+ </File>
+ <File
++ RelativePath="..\..\..\src\cmshalf.c"
++ >
++ </File>
++ <File
+ RelativePath="..\..\..\src\cmsintrp.c"
+ >
+ </File>
+--- misc/lcms2-2.4/Projects/VC2010/lcms2_static/lcms2_static.vcproj 2012-09-10 18:01:51.000000000 +0200
++++ misc/build/lcms2-2.4/Projects/VC2010/lcms2_static/lcms2_static.vcproj 2012-10-05 22:35:28.168963200 +0200
+@@ -175,6 +175,10 @@
+ >
+ </File>
+ <File
++ RelativePath="..\..\..\src\cmshalf.c"
++ >
++ </File>
++ <File
+ RelativePath="..\..\..\src\cmsintrp.c"
+ >
+ </File>
+--- misc/lcms2-2.4/include/lcms2.h 2011-12-15 16:45:47.000000000 +0100
++++ misc/build/lcms2-2.4/include/lcms2.h 2012-03-17 22:53:28.731585981 +0100
+@@ -192,6 +192,15 @@ typedef int cmsBool;
+ # endif
+ #endif
+
++// LibreOffice always builds this as DLL and with the stdcall calling
++// convention, so make this usable from outside without having to
++// specify CMS_DLL manually whenever the library is used.
++#ifndef CMS_DLL_BUILD
++#ifndef CMS_DLL
++#define CMS_DLL
++#endif
++#endif
++
+ // Calling convention -- this is hardly platform and compiler dependent
+ #ifdef CMS_IS_WINDOWS_
+ # if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
--- /dev/null
+--- misc/build/lcms2-2.4/config.sub
++++ misc/build/lcms2-2.4/config.sub
+@@ -123,7 +123,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1294,7 +1294,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libabw))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libabw,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libabw,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libabw,\
+ boost_headers \
+ libxml2 \
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libabw,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),\
+ -I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libabw))
+
+$(eval $(call gb_Module_add_targets,libabw,\
+ ExternalProject_libabw \
+ UnpackedTarball_libabw \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+AbiWord file word processor format import library from
+
+I couldn't find an upstream for this library - although I did only try a primitive Google search.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libabw))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libabw,$(ABW_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libatomic_ops))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libatomic_ops,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libatomic_ops,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,libatomic_ops,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)") \
+ ./configure \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libatomic_ops))
+
+ifeq ($(SYSTEM_LIBATOMIC_OPS),)
+
+$(eval $(call gb_Module_add_targets,libatomic_ops,\
+ ExternalProject_libatomic_ops \
+ UnpackedTarball_libatomic_ops \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [https://github.com/ivmai/libatomic_ops/].
+
+Note that some files (linked into libatomic_ops_gpl) are GPL'd, the portion
+needed for Firebird (ibatomic_ops) is however MIT licensed.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libatomic_ops))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libatomic_ops,$(LIBATOMIC_OPS_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libcdr))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libcdr,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libcdr,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libcdr,\
+ boost_headers \
+ icu \
+ lcms2 \
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libcdr,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libcdr))
+
+$(eval $(call gb_Module_add_targets,libcdr,\
+ ExternalProject_libcdr \
+ UnpackedTarball_libcdr \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library parsing the Corel cdr documents.
+
+I couldn't find an upstream for this library - although I did only try a primitive Google search.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libcdr))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libcdr,$(CDR_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libcmis))
+
+$(eval $(call gb_Module_add_targets,libcmis,\
+ StaticLibrary_cmis \
+ UnpackedTarball_cmis \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+A C++ client library for the CMIS interface.
+
+From:
+[http://sourceforge.net/projects/libcmis/]
+
+Wikipedia (CMIS):
+Content Management Interoperability Services (CMIS) is an open standard that defines an
+abstraction layer for controlling diverse document management systems and repositories using web protocols.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,cmislib))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,cmislib))
+
+ifeq ($(COM_GCC_IS_CLANG),TRUE)
+# Avoid narrowing conversion error (even though the option is technically a warning)
+# caused by boost.
+$(eval $(call gb_StaticLibrary_add_cxxflags,cmislib,\
+ -Wno-error=c++11-narrowing \
+))
+endif
+
+$(eval $(call gb_StaticLibrary_use_unpacked,cmislib,cmis))
+
+$(eval $(call gb_StaticLibrary_use_externals,cmislib,\
+ boost_headers \
+ curl \
+ libxml2 \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,cmislib,\
+ UnpackedTarball/cmis/src/libcmis/allowable-actions \
+ UnpackedTarball/cmis/src/libcmis/atom-document \
+ UnpackedTarball/cmis/src/libcmis/atom-folder \
+ UnpackedTarball/cmis/src/libcmis/atom-object-type \
+ UnpackedTarball/cmis/src/libcmis/atom-object \
+ UnpackedTarball/cmis/src/libcmis/atom-session \
+ UnpackedTarball/cmis/src/libcmis/atom-workspace \
+ UnpackedTarball/cmis/src/libcmis/base-session \
+ UnpackedTarball/cmis/src/libcmis/document \
+ UnpackedTarball/cmis/src/libcmis/folder \
+ UnpackedTarball/cmis/src/libcmis/gdrive-document \
+ UnpackedTarball/cmis/src/libcmis/gdrive-folder \
+ UnpackedTarball/cmis/src/libcmis/gdrive-object \
+ UnpackedTarball/cmis/src/libcmis/gdrive-object-type \
+ UnpackedTarball/cmis/src/libcmis/gdrive-property \
+ UnpackedTarball/cmis/src/libcmis/gdrive-repository \
+ UnpackedTarball/cmis/src/libcmis/gdrive-session \
+ UnpackedTarball/cmis/src/libcmis/gdrive-utils \
+ UnpackedTarball/cmis/src/libcmis/json-utils \
+ UnpackedTarball/cmis/src/libcmis/oauth2-data \
+ UnpackedTarball/cmis/src/libcmis/oauth2-handler \
+ UnpackedTarball/cmis/src/libcmis/oauth2-providers \
+ UnpackedTarball/cmis/src/libcmis/object \
+ UnpackedTarball/cmis/src/libcmis/object-type \
+ UnpackedTarball/cmis/src/libcmis/property-type \
+ UnpackedTarball/cmis/src/libcmis/property \
+ UnpackedTarball/cmis/src/libcmis/rendition \
+ UnpackedTarball/cmis/src/libcmis/repository \
+ UnpackedTarball/cmis/src/libcmis/session-factory \
+ UnpackedTarball/cmis/src/libcmis/ws-document \
+ UnpackedTarball/cmis/src/libcmis/ws-folder \
+ UnpackedTarball/cmis/src/libcmis/ws-navigationservice \
+ UnpackedTarball/cmis/src/libcmis/ws-object \
+ UnpackedTarball/cmis/src/libcmis/ws-object-type \
+ UnpackedTarball/cmis/src/libcmis/ws-objectservice \
+ UnpackedTarball/cmis/src/libcmis/ws-relatedmultipart \
+ UnpackedTarball/cmis/src/libcmis/ws-repositoryservice \
+ UnpackedTarball/cmis/src/libcmis/ws-requests \
+ UnpackedTarball/cmis/src/libcmis/ws-session \
+ UnpackedTarball/cmis/src/libcmis/ws-soap \
+ UnpackedTarball/cmis/src/libcmis/ws-versioningservice \
+ UnpackedTarball/cmis/src/libcmis/xml-utils \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,cmis))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,cmis,$(CMIS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,cmis,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,cmis, \
+ external/libcmis/libcmis-0.4.1.patch \
+ external/libcmis/libcmis-0.4.1-empty-path.patch \
+ external/libcmis/libcmis-0.4.1-properties-fix.patch \
+ external/libcmis/libcmis-libxml2_compatibility.patch \
+ external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+$(eval $(call gb_UnpackedTarball_add_patches,cmis,external/libcmis/boost-win.patch))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff --git src/libcmis/atom-object.cxx src/libcmis/atom-object.cxx
+index ce21384..eef8102 100644
+--- src/libcmis/atom-object.cxx
++++ src/libcmis/atom-object.cxx
+@@ -30,6 +30,9 @@
+ #include <locale>
+ #include <sstream>
+
++#ifndef BOOST_DATE_TIME_NO_LIB
++#define BOOST_DATE_TIME_NO_LIB
++#endif
+ #include <boost/date_time/posix_time/posix_time.hpp>
+
+ #include "atom-document.hxx"
+diff --git src/libcmis/object.hxx src/libcmis/object.hxx
+index 449bb22..c320f06 100644
+--- src/libcmis/object.hxx
++++ src/libcmis/object.hxx
+@@ -36,6 +36,9 @@
+ #include <stdbool.h>
+ #endif
+
++#ifndef BOOST_DATE_TIME_NO_LIB
++#define BOOST_DATE_TIME_NO_LIB
++#endif
+ #include <boost/date_time.hpp>
+ #include <boost/shared_ptr.hpp>
+ #include <libxml/tree.h>
+diff --git src/libcmis/property-type.hxx src/libcmis/property-type.hxx
+index 1a8bee9..6ac946c 100644
+--- src/libcmis/property-type.hxx
++++ src/libcmis/property-type.hxx
+@@ -28,6 +28,9 @@
+ #ifndef _PROPERTY_TYPE_HXX_
+ #define _PROPERTY_TYPE_HXX_
+
++#ifndef BOOST_DATE_TIME_NO_LIB
++#define BOOST_DATE_TIME_NO_LIB
++#endif
+ #include <boost/date_time.hpp>
+ #include <libxml/tree.h>
+
+diff --git src/libcmis/property.hxx src/libcmis/property.hxx
+index f9be04a..2977fb3 100644
+--- src/libcmis/property.hxx
++++ src/libcmis/property.hxx
+@@ -31,6 +31,9 @@
+ #include <libxml/tree.h>
+ #include <libxml/xmlwriter.h>
+
++#ifndef BOOST_DATE_TIME_NO_LIB
++#define BOOST_DATE_TIME_NO_LIB
++#endif
+ #include <boost/date_time.hpp>
+ #include <boost/shared_ptr.hpp>
+
+diff --git src/libcmis/ws-session.cxx src/libcmis/ws-session.cxx
+index b906a5a..bf50644 100644
+--- src/libcmis/ws-session.cxx
++++ src/libcmis/ws-session.cxx
+@@ -28,6 +28,9 @@
+
+ #include <sstream>
+
++#ifndef BOOST_DATE_TIME_NO_LIB
++#define BOOST_DATE_TIME_NO_LIB
++#endif
+ #include <boost/date_time.hpp>
+ #include <libxml/parser.h>
+ #include <libxml/tree.h>
+diff --git src/libcmis/xml-utils.hxx src/libcmis/xml-utils.hxx
+index 52853e2..2f80b91 100644
+--- src/libcmis/xml-utils.hxx
++++ src/libcmis/xml-utils.hxx
+@@ -33,6 +33,9 @@
+ #include <sstream>
+ #include <string>
+
++#ifndef BOOST_DATE_TIME_NO_LIB
++#define BOOST_DATE_TIME_NO_LIB
++#endif
+ #include <boost/date_time.hpp>
+ #include <libxml/tree.h>
+ #include <libxml/xpathInternals.h>
--- /dev/null
+diff --git src/libcmis/document.cxx src/libcmis/document.cxx
+index 1af0d63..7ecfd24 100644
+--- src/libcmis/document.cxx
++++ src/libcmis/document.cxx
+@@ -44,6 +44,8 @@ namespace libcmis
+ it != parents.end(); ++it )
+ {
+ string path = ( *it )->getPath( );
++ if ( path.empty() )
++ continue;
+ if ( path[path.size() - 1] != '/' )
+ path += "/";
+ path += getName( );
--- /dev/null
+From 958b3c763fb52d1bf2ad88c177e7e4f426aab354 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdo@users.sourceforge.net>
+Date: Wed, 4 Dec 2013 10:44:37 +0100
+Subject: [PATCH] Object creation mixed relationship properties with document
+ properties
+
+Added a Unit test to show the problem. We surely don't want the
+relationship cmis:properties to be read as properties. This bug caused
+some problems with other operations like checkout.
+---
+ .../data/atom/test-document-relationships.xml | 179 +++++++++++++++++++++
+ qa/libcmis/test-atom.cxx | 34 ++++
+ src/libcmis/object.cxx | 4 +-
+ 3 files changed, 215 insertions(+), 2 deletions(-)
+ create mode 100644 qa/libcmis/data/atom/test-document-relationships.xml
+
+diff --git qa/libcmis/data/atom/test-document-relationships.xml qa/libcmis/data/atom/test-document-relationships.xml
+new file mode 100644
+index 0000000..bacfda8
+--- /dev/null
++++ qa/libcmis/data/atom/test-document-relationships.xml
+@@ -0,0 +1,179 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app">
++ <atom:author>
++ <atom:name>unknown</atom:name>
++ </atom:author>
++ <atom:id>Some obscure Id</atom:id>
++ <atom:published>2013-01-28T14:10:06Z</atom:published>
++ <atom:title>Test Document</atom:title>
++ <app:edited>2013-01-28T14:10:06Z</app:edited>
++ <atom:updated>2013-01-28T14:10:06Z</atom:updated>
++ <atom:content src="http://mockup/mock/content/data.txt?id=test-document" type="text/plain"/>
++ <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
++ <cmis:properties>
++ <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength">
++ <cmis:value>12345</cmis:value>
++ </cmis:propertyInteger>
++ <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId">
++ <cmis:value>DocumentLevel2</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/>
++ <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/>
++ <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/>
++ <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/>
++ <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/>
++ <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/>
++ <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/>
++ <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/>
++ <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/>
++ <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion">
++ <cmis:value>true</cmis:value>
++ </cmis:propertyBoolean>
++ <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/>
++ <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/>
++ <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut">
++ <cmis:value>false</cmis:value>
++ </cmis:propertyBoolean>
++ <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy">
++ <cmis:value>unknown</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy">
++ <cmis:value>unknown</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/>
++ <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp">
++ <cmis:value>blue</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/>
++ <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/>
++ <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion">
++ <cmis:value>true</cmis:value>
++ </cmis:propertyBoolean>
++ <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/>
++ <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name">
++ <cmis:value>Test Document</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType">
++ <cmis:value>text/plain</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp">
++ <cmis:value>My Doc StringProperty 6</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate">
++ <cmis:value>2013-01-28T14:10:06.736Z</cmis:value>
++ </cmis:propertyDateTime>
++ <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken">
++ <cmis:value>1359382206736</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/>
++ <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/>
++ <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/>
++ <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/>
++ <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId">
++ <cmis:value>test-document</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable">
++ <cmis:value>false</cmis:value>
++ </cmis:propertyBoolean>
++ <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion">
++ <cmis:value>true</cmis:value>
++ </cmis:propertyBoolean>
++ <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId">
++ <cmis:value>cmis:document</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/>
++ <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName">
++ <cmis:value>data.txt</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate">
++ <cmis:value>2013-01-28T14:10:06.736Z</cmis:value>
++ </cmis:propertyDateTime>
++ </cmis:properties>
++ <cmis:allowableActions>
++ <cmis:canDeleteObject>true</cmis:canDeleteObject>
++ <cmis:canUpdateProperties>true</cmis:canUpdateProperties>
++ <cmis:canGetFolderTree>false</cmis:canGetFolderTree>
++ <cmis:canGetProperties>true</cmis:canGetProperties>
++ <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships>
++ <cmis:canGetObjectParents>true</cmis:canGetObjectParents>
++ <cmis:canGetFolderParent>false</cmis:canGetFolderParent>
++ <cmis:canGetDescendants>false</cmis:canGetDescendants>
++ <cmis:canMoveObject>true</cmis:canMoveObject>
++ <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream>
++ <cmis:canCheckOut>true</cmis:canCheckOut>
++ <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut>
++ <cmis:canCheckIn>false</cmis:canCheckIn>
++ <cmis:canSetContentStream>true</cmis:canSetContentStream>
++ <cmis:canGetAllVersions>true</cmis:canGetAllVersions>
++ <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder>
++ <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder>
++ <cmis:canGetContentStream>true</cmis:canGetContentStream>
++ <cmis:canApplyPolicy>false</cmis:canApplyPolicy>
++ <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies>
++ <cmis:canRemovePolicy>false</cmis:canRemovePolicy>
++ <cmis:canGetChildren>false</cmis:canGetChildren>
++ <cmis:canCreateDocument>false</cmis:canCreateDocument>
++ <cmis:canCreateFolder>false</cmis:canCreateFolder>
++ <cmis:canCreateRelationship>false</cmis:canCreateRelationship>
++ <cmis:canDeleteTree>false</cmis:canDeleteTree>
++ <cmis:canGetRenditions>false</cmis:canGetRenditions>
++ <cmis:canGetACL>false</cmis:canGetACL>
++ <cmis:canApplyACL>false</cmis:canApplyACL>
++ </cmis:allowableActions>
++ <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension">
++ <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId>
++ <name>Test Document</name>
++ </exampleExtension:exampleExtension>
++ <cmis:relationship>
++ <cmis:properties>
++ <cmis:propertyId displayName="Target Id" localName="targetId" propertyDefinitionId="cmis:targetId" queryName="cmis:targetId">
++ <cmis:value>workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;2.2</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyId displayName="Object Type Id" localName="objectTypeId" propertyDefinitionId="cmis:objectTypeId" queryName="cmis:objectTypeId">
++ <cmis:value>R:cm:original</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyString displayName="Last Modified By" localName="lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy" queryName="cmis:lastModifiedBy">
++ <cmis:value>admin</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyId displayName="Source Id" localName="sourceId" propertyDefinitionId="cmis:sourceId" queryName="cmis:sourceId">
++ <cmis:value>workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;pwc</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyString displayName="Name" localName="name" propertyDefinitionId="cmis:name" queryName="cmis:name">
++ <cmis:value>75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyString displayName="Created by" localName="createdBy" propertyDefinitionId="cmis:createdBy" queryName="cmis:createdBy">
++ <cmis:value>admin</cmis:value>
++ </cmis:propertyString>
++ <cmis:propertyId displayName="Object Id" localName="objectId" propertyDefinitionId="cmis:objectId" queryName="cmis:objectId">
++ <cmis:value>assoc:75</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyDateTime displayName="Creation Date" localName="creationDate" propertyDefinitionId="cmis:creationDate" queryName="cmis:creationDate">
++ <cmis:value>2010-05-01T00:00:00+02:00</cmis:value>
++ </cmis:propertyDateTime>
++ <cmis:propertyString displayName="Change token" localName="changeToken" propertyDefinitionId="cmis:changeToken" queryName="cmis:changeToken"/>
++ <cmis:propertyId displayName="Base Type Id" localName="baseTypeId" propertyDefinitionId="cmis:baseTypeId" queryName="cmis:baseTypeId">
++ <cmis:value>cmis:relationship</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyId displayName="Alfresco Node Ref" localName="nodeRef" propertyDefinitionId="alfcmis:nodeRef" queryName="alfcmis:nodeRef">
++ <cmis:value>75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original</cmis:value>
++ </cmis:propertyId>
++ <cmis:propertyString displayName="Description" localName="description" propertyDefinitionId="cmis:description" queryName="cmis:description"/>
++ <cmis:propertyDateTime displayName="Last Modified Date" localName="lastModificationDate" propertyDefinitionId="cmis:lastModificationDate" queryName="cmis:lastModificationDate">
++ <cmis:value>2010-05-01T00:00:00+02:00</cmis:value>
++ </cmis:propertyDateTime>
++ </cmis:properties>
++ </cmis:relationship>
++ </cmisra:object>
++ <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/>
++ <atom:link rel="self" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry" cmisra:id="test-document"/>
++ <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/>
++ <atom:link rel="edit" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/>
++ <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/>
++ <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document" type="application/cmisallowableactions+xml"/>
++ <atom:link rel="up" href="http://mockup/mock/parents?id=test-document" type="application/atom+xml;type=feed"/>
++ <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document" type="text/plain"/>
++ <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document" type="application/cmisacl+xml"/>
++ <atom:link rel="version-history" href="http://mockup/mock/versions?id=test-document" type="application/atom+xml;type=feed"/>
++ <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition1" type="image/png" cmisra:renditionKind="cmis:thumbnail" title="picture" length="40385"/>
++ <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition2" type="application/pdf" cmisra:renditionKind="pdf" title="Doc as PDF"/>
++</atom:entry>
+diff --git qa/libcmis/test-atom.cxx qa/libcmis/test-atom.cxx
+index 57864d9..af16616 100644
+--- qa/libcmis/test-atom.cxx
++++ qa/libcmis/test-atom.cxx
+@@ -64,6 +64,7 @@ class AtomTest : public CppUnit::TestFixture
+ void getTypeChildrenTest( );
+ void getObjectTest( );
+ void getDocumentTest( );
++ void getDocumentRelationshipsTest( );
+ void getUnexistantObjectTest( );
+ void getFolderTest( );
+ void getFolderBadTypeTest( );
+@@ -101,6 +102,7 @@ class AtomTest : public CppUnit::TestFixture
+ CPPUNIT_TEST( getTypeChildrenTest );
+ CPPUNIT_TEST( getObjectTest );
+ CPPUNIT_TEST( getDocumentTest );
++ CPPUNIT_TEST( getDocumentRelationshipsTest );
+ CPPUNIT_TEST( getUnexistantObjectTest );
+ CPPUNIT_TEST( getFolderTest );
+ CPPUNIT_TEST( getFolderBadTypeTest );
+@@ -441,6 +443,38 @@ void AtomTest::getDocumentTest( )
+ CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) );
+ }
+
++void AtomTest::getDocumentRelationshipsTest( )
++{
++ curl_mockup_reset( );
++ curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document-relationships.xml" );
++ curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" );
++ curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD );
++
++ AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD );
++
++ string expectedId( "test-document" );
++ libcmis::ObjectPtr actual = session.getObject( expectedId );
++
++ // Do we have a document?
++ libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( actual );
++ CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr",
++ NULL != document );
++
++ // Test the document properties
++ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", expectedId, document->getId( ) );
++ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "Test Document" ), document->getName( ) );
++ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "text/plain" ), document->getContentType( ) );
++ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) );
++
++ CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) );
++ CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() );
++ CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) );
++ CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() );
++ CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !document->getChangeToken( ).empty( ) );
++
++ CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) );
++}
++
+ void AtomTest::getFolderTest( )
+ {
+ curl_mockup_reset( );
+diff --git src/libcmis/object.cxx src/libcmis/object.cxx
+index 538c98e..d5e0c7a 100644
+--- src/libcmis/object.cxx
++++ src/libcmis/object.cxx
+@@ -105,10 +105,10 @@ namespace libcmis
+ xmlXPathFreeObject( xpathObj );
+
+ // First get the type id as it will give us the property definitions
+- string typeIdReq( "//cmis:propertyId[@propertyDefinitionId='cmis:objectTypeId']/cmis:value/text()" );
++ string typeIdReq( "/*/cmis:properties/cmis:propertyId[@propertyDefinitionId='cmis:objectTypeId']/cmis:value/text()" );
+ m_typeId = libcmis::getXPathValue( xpathCtx, typeIdReq );
+
+- string propertiesReq( "//cmis:properties/*" );
++ string propertiesReq( "/*/cmis:properties/*" );
+ xpathObj = xmlXPathEvalExpression( BAD_CAST( propertiesReq.c_str() ), xpathCtx );
+ if ( NULL != xpathObj && NULL != xpathObj->nodesetval )
+ {
+--
+1.8.4.4
+
--- /dev/null
+--- src/libcmis/base-session.cxx
++++ src/libcmis/base-session.cxx
+@@ -281,7 +281,7 @@
+ httpRunRequest( url );
+ response->getData( )->finish( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ // If the access token is expired, we get 401 error,
+ // Need to use the refresh token to get a new one.
+@@ -351,7 +351,7 @@
+ httpRunRequest( url, headers );
+ response->getData( )->finish();
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ long status = getHttpStatus( );
+ /** If we had a HTTP 417 response, this is likely to be due to some
+@@ -438,7 +438,7 @@
+ httpRunRequest( url, headers, redirect );
+ response->getData( )->finish();
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+
+ long status = getHttpStatus( );
+@@ -495,7 +495,7 @@
+ {
+ httpRunRequest( url );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ // If the access token is expired, we get 401 error,
+ // Need to use the refresh token to get a new one.
+--- src/libcmis/oauth2-handler.cxx
++++ src/libcmis/oauth2-handler.cxx
+@@ -104,7 +104,7 @@
+ resp = m_session->httpPostRequest ( m_data->getTokenUrl(), is,
+ "application/x-www-form-urlencoded" );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ throw libcmis::Exception(
+ "Couldn't get tokens from the authorization code ");
+@@ -131,7 +131,7 @@
+ resp = m_session->httpPostRequest( m_data->getTokenUrl( ), is,
+ "application/x-www-form-urlencoded" );
+ }
+- catch (const CurlException& e )
++ catch (const CurlException& )
+ {
+ throw libcmis::Exception( "Couldn't refresh token ");
+ }
+--- src/libcmis/oauth2-providers.cxx
++++ src/libcmis/oauth2-providers.cxx
+@@ -44,7 +44,7 @@
+ {
+ res = session->httpGetRequest( authUrl )->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -65,7 +65,7 @@
+ loginRes = session->httpPostRequest ( loginLink, loginIs, CONTENT_TYPE )
+ ->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -105,7 +105,7 @@
+ {
+ res = session->httpGetRequest( authUrl )->getStream( )->str( );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
+@@ -131,7 +131,7 @@
+ // Alfresco code is in the redirect link
+ resp = session->httpPostRequest( loginLink, loginIs, CONTENT_TYPE, false );
+ }
+- catch ( const CurlException& e )
++ catch ( const CurlException& )
+ {
+ return string( );
+ }
--- /dev/null
+diff --git src/libcmis/json-utils.cxx src/libcmis/json-utils.cxx
+index b537a09..b4e037d 100644
+--- src/libcmis/json-utils.cxx
++++ src/libcmis/json-utils.cxx
+@@ -213,48 +213,54 @@ Json::Type Json::parseType( )
+ {
+ Type type = json_string;
+ string str = toString( );
+- boost::posix_time::ptime time = libcmis::parseDateTime( str );
+- if ( !time.is_not_a_date_time( ) )
+- type = json_datetime;
+- else
++ if ( str.empty( ) )
++ return type;
++ try
+ {
+- Type backupType = type;
+- type = json_bool;
+- try
+- {
+- parseBool( str );
+- }
+- catch (...)
++ boost::posix_time::ptime time = libcmis::parseDateTime( str );
++ if ( !time.is_not_a_date_time( ) )
++ return json_datetime;
++ }
++ catch (...)
++ {
++ // Try other types
++ }
++ Type backupType = type;
++ type = json_bool;
++ try
++ {
++ parseBool( str );
++ }
++ catch (...)
++ {
++ type = backupType;
++ }
++ if ( type != json_bool )
++ {
++ if ( str.find('.') == string::npos )
+ {
+- type = backupType;
++ backupType = type;
++ type = json_int;
++ try
++ {
++ parseInteger( str );
++ }
++ catch(...)
++ {
++ type = backupType;
++ }
+ }
+- if ( type != json_bool )
++ else
+ {
+- if ( str.find('.') == string::npos )
++ backupType = type;
++ type = json_double;
++ try
+ {
+- backupType = type;
+- type = json_int;
+- try
+- {
+- parseInteger( str );
+- }
+- catch(...)
+- {
+- type = backupType;
+- }
++ parseDouble( str );
+ }
+- else
+- {
+- backupType = type;
+- type = json_double;
+- try
+- {
+- parseDouble( str );
+- }
+- catch(...)
+- {
+- type = backupType;
+- }
++ catch(...)
++ {
++ type = backupType;
+ }
+ }
+ }
--- /dev/null
+# -*- Mode: Diff -*-
+--- src/libcmis/oauth2-providers.cxx
++++ src/libcmis/oauth2-providers.cxx
+@@ -34,6 +34,10 @@
+
+ using namespace std;
+
++#if LIBXML_VERSION < 20621
++#define HTML_PARSE_RECOVER 0
++#endif
++
+ string OAuth2Providers::OAuth2Gdrive( BaseSession* session, const string& authUrl,
+ const string& username, const string& password )
+ {
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libebook))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libebook,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libebook,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libebook,\
+ boost_headers \
+ icu \
+ libxml2 \
+ revenge \
+ zlib \
+))
+
+# TODO: remove the generators/stream empty vars on libe-book update
+$(call gb_ExternalProject_get_state_target,libebook,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --without-tools \
+ --disable-tests \
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug,--disable-debug) \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ --disable-werror \
+ --disable-weffc \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ XML_CFLAGS="$(LIBXML_CFLAGS)" \
+ XML_LIBS="$(LIBXML_LIBS)" \
+ REVENGE_GENERATORS_CFLAGS=' ' REVENGE_GENERATORS_LIBS=' ' REVENGE_STREAM_CFLAGS=' ' REVENGE_STREAM_LIBS=' ' \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libebook))
+
+$(eval $(call gb_Module_add_targets,libebook,\
+ ExternalProject_libebook \
+ UnpackedTarball_libebook \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for import of various non-HTML reflowable e-book formats.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libebook))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libebook,$(EBOOK_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libebook,1))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libeot))
+
+$(eval $(call gb_ExternalProject_register_targets,libeot,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,libeot,build) :
+ $(call gb_ExternalProject_run,build,\
+ touch Makefile.in \
+ && export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --disable-debug \
+ && $(MAKE) $(if $(VERBOSE)$(verbose),V=1) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libeot))
+
+$(eval $(call gb_Module_add_targets,libeot,\
+ ExternalProject_libeot \
+ UnpackedTarball_libeot \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for parsing Embedded OpenType files (Microsoft embedded font
+"standard"), and converting them to other formats.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libeot))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libeot,$(LIBEOT_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libetonyek))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libetonyek,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libetonyek,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libetonyek,\
+ boost_headers \
+ libxml2 \
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libetonyek,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ --without-tools \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ BOOST_CFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ XML_CFLAGS="$(LIBXML_CFLAGS)" \
+ XML_LIBS="$(LIBXML_LIBS)" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libetonyek))
+
+$(eval $(call gb_Module_add_targets,libetonyek,\
+ ExternalProject_libetonyek \
+ UnpackedTarball_libetonyek \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for import of Apple Keynote presentations.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libetonyek))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libetonyek,$(ETONYEK_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libetonyek,1))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libexttextcat_fingerprint,exttextcat))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,libexttextcat_fingerprint,$(LIBO_SHARE_FOLDER)/fingerprint,\
+ langclass/fpdb.conf \
+ langclass/LM/ab.lm \
+ langclass/LM/ace.lm \
+ langclass/LM/ada.lm \
+ langclass/LM/af.lm \
+ langclass/LM/alt.lm \
+ langclass/LM/am.lm \
+ langclass/LM/ar.lm \
+ langclass/LM/arn.lm \
+ langclass/LM/ast.lm \
+ langclass/LM/ay.lm \
+ langclass/LM/az-Cyrl.lm \
+ langclass/LM/az.lm \
+ langclass/LM/ban.lm \
+ langclass/LM/be.lm \
+ langclass/LM/bem.lm \
+ langclass/LM/bg.lm \
+ langclass/LM/bho.lm \
+ langclass/LM/bi.lm \
+ langclass/LM/bik.lm \
+ langclass/LM/bm.lm \
+ langclass/LM/bn.lm \
+ langclass/LM/bo.lm \
+ langclass/LM/br.lm \
+ langclass/LM/bs.lm \
+ langclass/LM/ca.lm \
+ langclass/LM/cs.lm \
+ langclass/LM/cy.lm \
+ langclass/LM/da.lm \
+ langclass/LM/de.lm \
+ langclass/LM/dv.lm \
+ langclass/LM/ee.lm \
+ langclass/LM/el.lm \
+ langclass/LM/en.lm \
+ langclass/LM/eo.lm \
+ langclass/LM/es.lm \
+ langclass/LM/et.lm \
+ langclass/LM/eu.lm \
+ langclass/LM/fa.lm \
+ langclass/LM/fi.lm \
+ langclass/LM/fj.lm \
+ langclass/LM/fo.lm \
+ langclass/LM/fr.lm \
+ langclass/LM/fur.lm \
+ langclass/LM/fy.lm \
+ langclass/LM/ga.lm \
+ langclass/LM/gd.lm \
+ langclass/LM/gl.lm \
+ langclass/LM/grc.lm \
+ langclass/LM/gu.lm \
+ langclass/LM/gug.lm \
+ langclass/LM/gv.lm \
+ langclass/LM/ha-NG.lm \
+ langclass/LM/haw.lm \
+ langclass/LM/he.lm \
+ langclass/LM/hi.lm \
+ langclass/LM/hil.lm \
+ langclass/LM/hr.lm \
+ langclass/LM/hsb.lm \
+ langclass/LM/ht.lm \
+ langclass/LM/hu.lm \
+ langclass/LM/hy.lm \
+ langclass/LM/ia.lm \
+ langclass/LM/id.lm \
+ langclass/LM/is.lm \
+ langclass/LM/it.lm \
+ langclass/LM/ja.lm \
+ langclass/LM/ka.lm \
+ langclass/LM/kk.lm \
+ langclass/LM/kl.lm \
+ langclass/LM/km.lm \
+ langclass/LM/kn.lm \
+ langclass/LM/ko.lm \
+ langclass/LM/ktu.lm \
+ langclass/LM/ky.lm \
+ langclass/LM/la.lm \
+ langclass/LM/lb.lm \
+ langclass/LM/lg.lm \
+ langclass/LM/ln.lm \
+ langclass/LM/lo.lm \
+ langclass/LM/lt.lm \
+ langclass/LM/lv.lm \
+ langclass/LM/mai.lm \
+ langclass/LM/mi.lm \
+ langclass/LM/mk.lm \
+ langclass/LM/ml.lm \
+ langclass/LM/mn.lm \
+ langclass/LM/mos.lm \
+ langclass/LM/mr.lm \
+ langclass/LM/ms.lm \
+ langclass/LM/mt.lm \
+ langclass/LM/my.lm \
+ langclass/LM/nb.lm \
+ langclass/LM/ne.lm \
+ langclass/LM/nl.lm \
+ langclass/LM/nn.lm \
+ langclass/LM/nr.lm \
+ langclass/LM/nso.lm \
+ langclass/LM/ny.lm \
+ langclass/LM/oc.lm \
+ langclass/LM/om.lm \
+ langclass/LM/pa.lm \
+ langclass/LM/pl.lm \
+ langclass/LM/plt.lm \
+ langclass/LM/pt.lm \
+ langclass/LM/qxa.lm \
+ langclass/LM/rm.lm \
+ langclass/LM/ro.lm \
+ langclass/LM/ru.lm \
+ langclass/LM/rue.lm \
+ langclass/LM/rw.lm \
+ langclass/LM/sa.lm \
+ langclass/LM/sc.lm \
+ langclass/LM/sco.lm \
+ langclass/LM/sd.lm \
+ langclass/LM/se.lm \
+ langclass/LM/sg.lm \
+ langclass/LM/shs.lm \
+ langclass/LM/si.lm \
+ langclass/LM/sk.lm \
+ langclass/LM/sl.lm \
+ langclass/LM/so.lm \
+ langclass/LM/sq.lm \
+ langclass/LM/sr-Cyrl.lm \
+ langclass/LM/sr-Latn.lm \
+ langclass/LM/ss.lm \
+ langclass/LM/st.lm \
+ langclass/LM/sv.lm \
+ langclass/LM/sw.lm \
+ langclass/LM/ta.lm \
+ langclass/LM/tet.lm \
+ langclass/LM/tg.lm \
+ langclass/LM/th.lm \
+ langclass/LM/ti.lm \
+ langclass/LM/tk.lm \
+ langclass/LM/tl.lm \
+ langclass/LM/tn.lm \
+ langclass/LM/tpi.lm \
+ langclass/LM/tr.lm \
+ langclass/LM/ts.lm \
+ langclass/LM/tt.lm \
+ langclass/LM/ty.lm \
+ langclass/LM/ug.lm \
+ langclass/LM/uk.lm \
+ langclass/LM/ur.lm \
+ langclass/LM/uz.lm \
+ langclass/LM/ve.lm \
+ langclass/LM/vi.lm \
+ langclass/LM/wa.lm \
+ langclass/LM/xh.lm \
+ langclass/LM/yi.lm \
+ langclass/LM/yo.lm \
+ langclass/LM/zh-Hans.lm \
+ langclass/LM/zh-Hant.lm \
+ langclass/LM/zu.lm \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,exttextcat))
+
+$(eval $(call gb_ExternalProject_register_targets,exttextcat,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,exttextcat,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-shared --with-pic \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUG_CFLAGS) $(gb_COMPILEROPTFLAGS) \
+ $(if $(filter AIX,$(OS)),-D_LINUX_SOURCE_COMPAT)" \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libexttextcat))
+
+$(eval $(call gb_Module_add_targets,libexttextcat,\
+ ExternalPackage_fingerprint \
+ UnpackedTarball_exttextcat \
+))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_targets,libexttextcat,\
+ StaticLibrary_exttextcat \
+))
+else
+$(eval $(call gb_Module_add_targets,libexttextcat,\
+ ExternalProject_exttextcat \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+N-Gram-Based Text Categorization library
+
+This guesses the language that input text is written in. Fundamentally
+an adaption of of wiseguys libtextcat extended to be UTF-8 aware.
+
+It is hosted at: [http://cgit.freedesktop.org/libreoffice/libexttextcat/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,exttextcat))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,exttextcat,exttextcat))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,exttextcat))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,exttextcat,\
+ UnpackedTarball/exttextcat/src/common \
+ UnpackedTarball/exttextcat/src/fingerprint \
+ UnpackedTarball/exttextcat/src/textcat \
+ UnpackedTarball/exttextcat/src/wg_mempool \
+ UnpackedTarball/exttextcat/src/utf8misc \
+))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,exttextcat))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,exttextcat,$(LIBEXTTEXTCAT_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,exttextcat,\
+ external/libexttextcat/exttextcat-msvc-stdint.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- foo/foo/src/common.h
++++ foo/foo/src/common.h
+@@ -45,18 +45,7 @@
+ {
+ #endif
+
+-#ifdef _MSC_VER
+- typedef __int8 int8_t;
+- typedef unsigned __int8 uint8_t;
+- typedef __int16 int16_t;
+- typedef unsigned __int16 uint16_t;
+- typedef __int32 int32_t;
+- typedef unsigned __int32 uint32_t;
+- typedef __int64 int64_t;
+- typedef unsigned __int64 uint64_t;
+-#else
+ # include <stdint.h>
+-#endif
+
+ typedef uint32_t uint4;
+ typedef uint16_t uint2;
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libfreehand))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libfreehand,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libfreehand,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libfreehand,\
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libfreehand,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libfreehand))
+
+$(eval $(call gb_Module_add_targets,libfreehand,\
+ ExternalProject_libfreehand \
+ UnpackedTarball_libfreehand \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for import of FreeHand drawings.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libfreehand))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libfreehand,$(FREEHAND_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libgltf))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libgltf,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libgltf,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libgltf,\
+ boost_headers \
+ glew \
+ glm_headers \
+))
+
+
+ifeq ($(COM),MSC)
+
+libgltf_AdditionalIncludes :=
+
+ifeq ($(SYSTEM_BOOST),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,boost)"
+libgltf_AdditionalIncludes += "$(BUILDDIR)/config_$(gb_Side)"
+endif
+
+ifeq ($(SYSTEM_GLEW),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,glew)/include"
+endif
+
+ifeq ($(SYSTEM_GLM),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,glm)"
+endif
+
+$(call gb_ExternalProject_get_state_target,libgltf,build) :
+ $(call gb_ExternalProject_run,build,\
+ msbuild.exe libgltf.vcxproj \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) \
+ /p:VisualStudioVersion=11.0) \
+ $(if $(filter 100,$(VCVER)),/p:PlatformToolset=v100 \
+ /p:VisualStudioVersion=10.0) \
+ '/p:AdditionalIncludeDirectories=$(subst $(WHITESPACE),;,$(subst /,\,$(strip $(libgltf_AdditionalIncludes))))' \
+ /p:AdditionalLibraryDirectories=$(if $(SYSTEM_GLEW),,"$(subst /,\,$(call gb_UnpackedTarball_get_dir,glew))\lib\$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)\Win32") \
+ ,build/win32)
+
+else
+
+libgltf_CPPFLAGS :=
+ifneq (,$(gb_ENABLE_DBGUTIL))
+ libgltf_CPPFLAGS += -D_GLIBCXX_DEBUG
+endif
+
+$(call gb_ExternalProject_get_state_target,libgltf,build) :
+ $(call gb_ExternalProject_run,build,\
+ export CPPFLAGS='$(libgltf_CPPFLAGS)' \
+ && export PKG_CONFIG="" \
+ && ./configure \
+ --disable-shared \
+ --enable-static \
+ --with-pic \
+ --disable-debug \
+ --disable-werror \
+ BOOST_CFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) -I$(BUILDDIR)/config_$(gb_Side)" \
+ GLEW_CFLAGS="$(if $(SYSTEM_GLEW),$(GLEW_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glew)/include)" \
+ GLM_CFLAGS="$(if $(SYSTEM_GLM),$(GLM_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glm))" \
+ && $(MAKE) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libgltf))
+
+$(eval $(call gb_Module_add_targets,libgltf,\
+ ExternalProject_libgltf \
+ UnpackedTarball_libgltf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Render glTF 3D models.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libgltf))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libgltf,$(LIBGLTF_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchflags,libgltf,--binary))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,liblangtag_data,langtag))
+
+$(eval $(call gb_ExternalPackage_use_external_project,liblangtag_data,langtag))
+
+$(eval $(call gb_ExternalPackage_add_files,liblangtag_data,$(LIBO_SHARE_FOLDER)/liblangtag,\
+ data/language-subtag-registry.xml \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,liblangtag_data,$(LIBO_SHARE_FOLDER)/liblangtag/common/bcp47,\
+ data/common/bcp47/calendar.xml \
+ data/common/bcp47/collation.xml \
+ data/common/bcp47/currency.xml \
+ data/common/bcp47/number.xml \
+ data/common/bcp47/timezone.xml \
+ data/common/bcp47/transform.xml \
+ data/common/bcp47/transform_ime.xml \
+ data/common/bcp47/transform_keyboard.xml \
+ data/common/bcp47/transform_mt.xml \
+ data/common/bcp47/transform_private_use.xml \
+ data/common/bcp47/variant.xml \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,liblangtag_data,$(LIBO_SHARE_FOLDER)/liblangtag/common/supplemental,\
+ data/common/supplemental/likelySubtags.xml \
+))
+
+# vim: set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,langtag))
+
+$(eval $(call gb_ExternalProject_use_external,langtag,libxml2))
+
+$(eval $(call gb_ExternalProject_use_autoconf,langtag,build))
+
+$(eval $(call gb_ExternalProject_register_targets,langtag,\
+ build \
+))
+
+# disable ccache on windows, as it doesn't cope with the quoted defines
+# liblangtag uses (-DBUILDDIR="\"$(abs_top_builddir)\"" and similar).
+# Results in "cl : Command line error D8003 : missing source filename"
+$(call gb_ExternalProject_get_state_target,langtag,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-modules --disable-test --disable-introspection --disable-shared --enable-static --with-pic \
+ $(if $(filter TRUE,$(HAVE_GCC_BUILTIN_ATOMIC)),"lt_cv_has_atomic=yes","lt_cv_has_atomic=no") \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) "ac_cv_va_copy=no") \
+ LIBXML2_CFLAGS="$(LIBXML_CFLAGS)" \
+ LIBXML2_LIBS="$(if $(filter WNTMSC,$(OS)$(COM)),-L$(call gb_UnpackedTarball_get_dir,xml2)/win32/bin.msvc -llibxml2,$(LIBXML_LIBS))" \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ $(if $(filter-out LINUX FREEBSD,$(OS)),,LDFLAGS="-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath,\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib) \
+ $(if $(filter-out SOLARIS,$(OS)),,LDFLAGS="-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-R$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib) \
+ $(if $(filter-out WNTGCC,$(OS)$(COM)),,LDFLAGS="-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2") \
+ && $(if $(filter WNTMSC,$(OS)$(COM)),\
+ REAL_CC="$(shell cygpath -w $(lastword $(filter-out -%,$(CC))))" \
+ REAL_CC_FLAGS="$(filter -%,$(CC))") \
+ $(if $(VERBOSE)$(verbose),V=1) \
+ $(gb_Helper_set_ld_path) \
+ $(MAKE) \
+ )
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,liblangtag))
+
+$(eval $(call gb_Module_add_targets,liblangtag,\
+ UnpackedTarball_langtag \
+ ExternalProject_langtag \
+ ExternalPackage_liblangtag_data \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://tagoh.bitbucket.org/liblangtag/]. An interface for BCP47 language tags.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,langtag))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,langtag,$(LIBLANGTAG_TARBALL),,liblangtag))
+
+$(eval $(call gb_UnpackedTarball_set_pre_action,langtag,\
+ $(GNUTAR) -x -j -f $(gb_UnpackedTarget_TARFILE_LOCATION)/$(LANGTAGREG_TARBALL) \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,langtag,\
+ external/liblangtag/liblangtag-0.5.1-msvc-warning.patch \
+ external/liblangtag/liblangtag-0.5.1-vsnprintf.patch \
+ external/liblangtag/liblangtag-0.5.1-msvc-ssize_t.patch \
+ external/liblangtag/liblangtag-0.5.1-msvc-snprintf.patch \
+ external/liblangtag/liblangtag-0.5.1-msvc-strtoull.patch \
+ external/liblangtag/liblangtag-0.5.1-scope-declaration.patch \
+ external/liblangtag/liblangtag-0.5.1-redefinition-of-typedef.patch \
+ external/liblangtag/liblangtag-0.5.1-undefined-have-sys-param-h.patch \
+ external/liblangtag/liblangtag-0.5.1-windows-do-not-prepend-dir-separator.patch \
+ external/liblangtag/liblangtag-0.5.1-unistd.patch \
+ external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch \
+))
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_UnpackedTarball_add_patches,langtag,\
+ external/liblangtag/liblangtag-0.5.1-mingw.patch \
+))
+endif
+endif
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Upstream 6564b87c2f6dac2482e530bc43b038a3e93a0e07
+resolves #6, include last record in language-subtag-registry.xml
+
+The '%%' in language-subtag-registry is a record delimiter, not record
+end marker, it is not present on the last record at file end.
+
+(cherry picked from commit 4fff73a834f94a7ca256c086d99ea0a654a6c287)
+
+diff --git a/data/reg2xml.c b/data/reg2xml.c
+--- UnpackedTarball/langtag.orig/data/reg2xml.c
++++ UnpackedTarball/langtag/data/reg2xml.c
+@@ -48,6 +48,7 @@ _parse(const char *filename,
+ FILE *fp;
+ char buffer[1024], *range = NULL, *begin = NULL, *end = NULL;
+ lt_bool_t in_entry = FALSE;
++ lt_bool_t file_end = FALSE;
+ xmlNodePtr ent = NULL;
+
+ if ((fp = fopen(filename, "rb")) == NULL) {
+@@ -56,10 +57,13 @@ _parse(const char *filename,
+ }
+ while (1) {
+ fgets(buffer, 1024, fp);
+- if (feof(fp))
+- break;
++ if (feof(fp)) {
++ if (!in_entry)
++ break;
++ file_end = TRUE;
++ }
+ _drop_crlf(buffer);
+- if (lt_strcmp0(buffer, "%%") == 0) {
++ if (lt_strcmp0(buffer, "%%") == 0 || file_end) {
+ if (in_entry) {
+ if (ent) {
+ if (range) {
+@@ -102,7 +106,7 @@ _parse(const char *filename,
+ ent = NULL;
+ range = NULL;
+ }
+- in_entry = TRUE;
++ in_entry = !file_end;
+ } else {
+ if (!in_entry) {
+ /* ignore it */
+
+--------------erAck-patch-parts--
+
+
--- /dev/null
+--- misc/liblangtag-0.4.0/liblangtag/lt-ext-module.c 2013-06-14 15:06:13.629182430 +0100
++++ misc/liblangtag-0.4.0/liblangtag/lt-ext-module.c 2013-06-14 15:06:43.537534204 +0100
+@@ -608,8 +608,8 @@
+ size_t len;
+
+ while (1) {
+- if (readdir_r(dir, &dent, &dresult) || dresult == NULL)
+- break;
++/* if (readdir_r(dir, &dent, &dresult) || dresult == NULL)
++ break;*/ abort(); /* we do not use liblangtag-gobject anyway */
+
+ len = strlen(dent.d_name);
+ if (len > suffix_len &&
+--- misc/liblangtag-0.4.0/liblangtag/Makefile.am 2013-06-14 15:06:13.636182512 +0100
++++ misc/liblangtag-0.4.0/liblangtag/Makefile.am 2013-06-14 15:08:53.556063464 +0100
+@@ -211,6 +211,7 @@
+ liblangtag_la_LDFLAGS = \
+ $(LDFLAGS) \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
++ -no-undefined \
+ $(NULL)
+
+ -include $(top_srcdir)/git.mk
+--- misc/liblangtag-0.4.0/liblangtag/Makefile.in 2013-06-14 15:06:13.636182512 +0100
++++ misc/liblangtag-0.4.0/liblangtag/Makefile.in 2013-06-14 15:09:07.204223994 +0100
+@@ -576,6 +576,7 @@
+ liblangtag_la_LDFLAGS = \
+ $(LDFLAGS) \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
++ -no-undefined \
+ $(NULL)
+
+ all: $(BUILT_SOURCES)
+--- misc/liblangtag-0.4.0/liblangtag-gobject/Makefile.am 2013-06-14 15:06:13.648182653 +0100
++++ misc/liblangtag-0.4.0/liblangtag-gobject/Makefile.am 2013-06-14 15:09:27.122458271 +0100
+@@ -149,6 +149,7 @@
+ liblangtag_gobject_la_LDFLAGS = \
+ $(LDFLAGS) \
+ -version-info $(LT_G_CURRENT):$(LT_G_REVISION):$(LT_G_AGE) \
++ -no-undefined \
+ $(NULL)
+ #
+ if HAVE_INTROSPECTION
+--- misc/liblangtag-0.4.0/liblangtag-gobject/Makefile.in 2013-06-14 15:06:13.648182653 +0100
++++ misc/liblangtag-0.4.0/liblangtag-gobject/Makefile.in 2013-06-14 15:09:33.099528574 +0100
+@@ -476,6 +476,7 @@
+ liblangtag_gobject_la_LDFLAGS = \
+ $(LDFLAGS) \
+ -version-info $(LT_G_CURRENT):$(LT_G_REVISION):$(LT_G_AGE) \
++ -no-undefined \
+ $(NULL)
+
+ #
+--- misc/liblangtag-0.4.0/Makefile.am 2013-06-14 15:06:13.652182700 +0100
++++ misc/liblangtag-0.4.0/Makefile.am 2013-06-14 15:06:43.539534228 +0100
+@@ -6,7 +6,7 @@
+ SUBDIRS += liblangtag-gobject
+ endif
+ #SUBDIRS += docs tests
+-SUBDIRS += tests
++#SUBDIRS += tests
+
+ ACLOCAL_AMFLAGS = -I m4macros
+
--- /dev/null
+diff -ru langtag.orig/liblangtag/lt-messages.c langtag/liblangtag/lt-messages.c
+--- UnpackedTarball/langtag.orig/liblangtag/lt-messages.c 2013-04-22 10:06:57.000000000 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-messages.c 2013-04-30 11:38:04.116532065 +0200
+@@ -85,13 +85,21 @@
+ clen = strlen(cs);
+ if (clen > 0) {
+ catstring = malloc(sizeof (char) * (clen + 6));
++#ifdef _WIN32
++ _snprintf(catstring, clen + 6, "[%s]: ", cs);
++#else
+ snprintf(catstring, clen + 6, "[%s]: ", cs);
++#endif
+ clen = strlen(catstring);
+ }
+ len = tlen + clen + 1;
+ retval = malloc(sizeof (char) * len);
+ if (retval) {
++#ifdef _WIN32
++ _snprintf(retval, len, "%s%s ", ts, catstring ? catstring : "");
++#else
+ snprintf(retval, len, "%s%s ", ts, catstring ? catstring : "");
++#endif
+ }
+ if (catstring)
+ free(catstring);
--- /dev/null
+diff -ru UnpackedTarball/langtag.orig/liblangtag/lt-macros.h UnpackedTarball/langtag/liblangtag/lt-macros.h
+--- UnpackedTarball/langtag.orig/liblangtag/lt-macros.h 2013-04-22 10:06:57.000000000 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-macros.h 2013-04-30 16:07:00.619638050 +0200
+@@ -261,7 +261,7 @@
+
+ LT_BEGIN_DECLS
+
+-#ifdef _MSC_VER
++#if defined(_MSC_VER) && !defined(ssize_t)
+ # ifdef _M_AMD64
+ typedef signed long long ssize_t;
+ # else
--- /dev/null
+diff -ru langtag.orig/extensions/lt-ext-ldml-u.c langtag/extensions/lt-ext-ldml-u.c
+--- UnpackedTarball/langtag.orig/extensions/lt-ext-ldml-u.c 2013-04-22 10:06:56.000000000 +0200
++++ UnpackedTarball/langtag/extensions/lt-ext-ldml-u.c 2013-04-30 12:56:19.557490167 +0200
+@@ -137,7 +137,11 @@
+ if (!strchr(hexdigit, subtag[j]))
+ goto bail2;
+ }
++#ifdef _WIN32
++ x = _strtoui64(subtag, &p, 16);
++#else
+ x = strtoull(subtag, &p, 16);
++#endif
+ if (p && p[0] == 0 && x <= 0x10ffff) {
+ retval = TRUE;
+ xmlFree(name);
--- /dev/null
+--- misc/liblangtag-0.4.0/liblangtag/lt-ext-module.h 2012-02-02 06:02:45.000000000 +0100
++++ misc/build/liblangtag-0.4.0/liblangtag/lt-ext-module.h 2012-08-08 08:46:57.810860044 +0200
+@@ -143,12 +143,12 @@
+ * and #lt_ext_module_t and extend features.
+ */
+ struct _lt_ext_module_funcs_t {
+- const lt_ext_module_singleton_func_t get_singleton;
+- const lt_ext_module_data_new_func_t create_data;
+- const lt_ext_module_precheck_func_t precheck_tag;
+- const lt_ext_module_parse_func_t parse_tag;
+- const lt_ext_module_get_tag_func_t get_tag;
+- const lt_ext_module_validate_func_t validate_tag;
++ lt_ext_module_singleton_func_t get_singleton;
++ lt_ext_module_data_new_func_t create_data;
++ lt_ext_module_precheck_func_t precheck_tag;
++ lt_ext_module_parse_func_t parse_tag;
++ lt_ext_module_get_tag_func_t get_tag;
++ lt_ext_module_validate_func_t validate_tag;
+ };
+
+
--- /dev/null
+diff -ru langtag.orig/liblangtag/lt-trie.c langtag/liblangtag/lt-trie.c
+--- UnpackedTarball/langtag.orig/liblangtag/lt-trie.c 2013-04-30 04:37:30.000000000 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-trie.c 2013-04-30 14:57:50.777932196 +0200
+@@ -33,11 +33,6 @@
+ lt_iter_tmpl_t parent;
+ lt_trie_node_t *root;
+ };
+-typedef struct _lt_trie_iter_t {
+- lt_iter_t parent;
+- lt_list_t *stack;
+- lt_string_t *pos_str;
+-} lt_trie_iter_t;
+
+ /*< private >*/
+ static lt_trie_node_t *
+diff -ru langtag.orig/liblangtag/lt-trie.h langtag/liblangtag/lt-trie.h
+--- UnpackedTarball/langtag.orig/liblangtag/lt-trie.h 2013-04-30 04:44:36.000000000 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-trie.h 2013-04-30 14:57:57.746969291 +0200
+@@ -21,7 +21,11 @@
+ LT_BEGIN_DECLS
+
+ typedef struct _lt_trie_t lt_trie_t;
+-typedef struct _lt_trie_iter_t lt_trie_iter_t;
++typedef struct _lt_trie_iter_t {
++ lt_iter_t parent;
++ lt_list_t *stack;
++ lt_string_t *pos_str;
++} lt_trie_iter_t;
+
+ lt_trie_t *lt_trie_new (void);
+ lt_trie_t *lt_trie_ref (lt_trie_t *trie);
--- /dev/null
+diff -ru langtag.orig/tests/variant-db.c langtag/tests/variant-db.c
+--- UnpackedTarball/langtag.orig/tests/variant-db.c 2013-04-22 10:06:57.000000000 +0200
++++ UnpackedTarball/langtag/tests/variant-db.c 2013-04-30 14:12:18.399306545 +0200
+@@ -53,8 +53,8 @@
+ }
+ lt_iter_finish(iter);
+ } else if (lt_strcmp0(argv[1], "lookup") == 0) {
+- variant = lt_variant_db_lookup(variantdb, argv[2]);
+ const lt_list_t *prefix, *l;
++ variant = lt_variant_db_lookup(variantdb, argv[2]);
+
+ if (variant) {
+ printf("desc: %s\n", lt_variant_get_name(variant));
--- /dev/null
+# liblangtag/lt-macros.h:17:5: error: "HAVE_SYS_PARAM_H" is not defined [-Werror=undef]
+
+diff -ru UnpackedTarball/langtag.orig/liblangtag/lt-macros.h UnpackedTarball/langtag/liblangtag/lt-macros.h
+--- UnpackedTarball/langtag.orig/liblangtag/lt-macros.h 2013-04-30 16:09:19.362392416 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-macros.h 2013-04-30 18:01:13.275188759 +0200
+@@ -14,7 +14,7 @@
+ #error "Only <liblangtag/langtag.h> can be included directly."
+ #endif
+
+-#if HAVE_SYS_PARAM_H
++#if defined(HAVE_SYS_PARAM_H) && HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+
--- /dev/null
+--- UnpackedTarball/langtag/liblangtag/lt-utils.c 2013-05-10 14:36:54.445200000 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-utils.c 2013-05-10 14:38:31.446000000 +0200
+@@ -23,7 +23,9 @@
+ #if HAVE_STRING_H
+ #include <string.h>
+ #endif
++#if HAVE_UNISTD_H
+ #include <unistd.h>
++#endif
+ #include <sys/types.h>
+ #include "lt-messages.h"
+ #include "lt-utils.h"
--- /dev/null
+diff -ru UnpackedTarball/orig.langtag/liblangtag/lt-utils.c UnpackedTarball/langtag/liblangtag/lt-utils.c
+--- UnpackedTarball/orig.langtag/liblangtag/lt-utils.c 2013-07-19 16:47:20.310734230 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-utils.c 2013-07-19 16:53:10.839914271 +0200
+@@ -173,9 +173,11 @@
+
+ va_end(ap);
+
+- retval = malloc(sizeof (char) * size);
+- if (retval) {
+- vsprintf(retval, format, args);
++ if (size > 0) {
++ retval = malloc(sizeof (char) * size);
++ if (retval) {
++ vsprintf(retval, format, args);
++ }
+ }
+ } LT_STMT_END;
+ #elif HAVE_VSNPRINTF
--- /dev/null
+diff -ru UnpackedTarball/langtag.orig/liblangtag/lt-string.c UnpackedTarball/langtag/liblangtag/lt-string.c
+--- UnpackedTarball/langtag.orig/liblangtag/lt-string.c 2013-04-22 10:35:07.000000000 +0200
++++ UnpackedTarball/langtag/liblangtag/lt-string.c 2013-04-30 18:34:14.422037274 +0200
+@@ -308,8 +308,12 @@
+ lt_return_val_if_fail (string != NULL, NULL);
+ lt_return_val_if_fail (path != NULL, string);
+
++#ifdef _WIN32
++ /* This simply does not work on Windows with "D:\..." */
++#else
+ if (lt_string_length(string) == 0 && path[0] != LT_DIR_SEPARATOR)
+ lt_string_append(string, LT_DIR_SEPARATOR_S);
++#endif
+
+ va_start(ap, path);
+ p = path;
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libmariadb))
+
+$(eval $(call gb_Module_add_targets,libmariadb,\
+ StaticLibrary_mariadb \
+ UnpackedTarball_mariadb \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Update to new upstream bzr snapshot:
+
+Don't use 'bzr diff', it will not put renames in the diff in a way
+that patch understands.
+
+bzr -Ossl.cert_reqs=none branch lp:mariadb-native-client
+mv mariadb-native-client mariadb-native-client.trunk
+cp -R mariadb-native-client.trunk mariadb-native-client.release
+cd mariadb-native-client.release
+bzr revert -r mariadb-native-client-1.0.0
+cd ..
+diff -x .bzr -u --recursive -N mariadb-native-client.release/ mariadb-native-client.trunk/ > /path/to/libreoffice_tree/libmariadb/mariadb-trunk-NNN.patch
+sed -i -e 's@^\([+-]\{3\} \)mariadb-native-client.\(trunk\|release\)/@\1mariadb/@' /path/to/libreoffice_tree/libmariadb/mariadb-trunk-NNN.patch
+dos2unix -f /path/to/libreoffice_tree/libmariadb/mariadb-trunk-NNN.patch
+
+regenerate configs
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,mariadblib))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,mariadblib))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,mariadblib,mariadb))
+
+$(eval $(call gb_StaticLibrary_set_include,mariadblib,\
+ $$(INCLUDE) \
+ -I$(call gb_UnpackedTarball_get_dir,mariadb)/include \
+))
+
+# This is needed for MSVC 2008: it somehow finds a dlopen somewhere
+# but the static library then contains unreferenced symbols.
+# This macro enables a re-definition to native Win32 APIs in my_global.h.
+## TODO missing enable: -DHAVE_OPENSSL -D HAVE_COMPRESS
+## (but then need to add "-lssl -lcrypto -lz" to mysqlcppconn linking)
+$(eval $(call gb_StaticLibrary_add_cflags,mariadblib,-DHAVE_DLOPEN -D ENABLED_LOCAL_INFILE -D LIBMARIADB -D THREAD -DSQLITE_ENABLE_COLUMN_METADATA=1))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,mariadblib,\
+ UnpackedTarball/mariadb/libmariadb/array \
+ UnpackedTarball/mariadb/libmariadb/ma_dyncol \
+ UnpackedTarball/mariadb/libmariadb/bchange \
+ UnpackedTarball/mariadb/libmariadb/bmove \
+ UnpackedTarball/mariadb/libmariadb/bmove_upp \
+ UnpackedTarball/mariadb/libmariadb/my_charset \
+ UnpackedTarball/mariadb/libmariadb/hash \
+ UnpackedTarball/mariadb/libmariadb/violite \
+ UnpackedTarball/mariadb/libmariadb/net \
+ UnpackedTarball/mariadb/libmariadb/charset \
+ UnpackedTarball/mariadb/libmariadb/ma_time \
+ UnpackedTarball/mariadb/libmariadb/dbug \
+ UnpackedTarball/mariadb/libmariadb/default \
+ UnpackedTarball/mariadb/libmariadb/errmsg \
+ UnpackedTarball/mariadb/libmariadb/my_vsnprintf \
+ UnpackedTarball/mariadb/libmariadb/errors \
+ UnpackedTarball/mariadb/libmariadb/getopt1 \
+ UnpackedTarball/mariadb/libmariadb/getopt \
+ UnpackedTarball/mariadb/libmariadb/get_password \
+ UnpackedTarball/mariadb/libmariadb/int2str \
+ UnpackedTarball/mariadb/libmariadb/is_prefix \
+ UnpackedTarball/mariadb/libmariadb/libmariadb \
+ UnpackedTarball/mariadb/libmariadb/list \
+ UnpackedTarball/mariadb/libmariadb/llstr \
+ UnpackedTarball/mariadb/libmariadb/longlong2str \
+ UnpackedTarball/mariadb/libmariadb/mf_dirname \
+ UnpackedTarball/mariadb/libmariadb/mf_fn_ext \
+ UnpackedTarball/mariadb/libmariadb/mf_format \
+ UnpackedTarball/mariadb/libmariadb/mf_loadpath \
+ UnpackedTarball/mariadb/libmariadb/mf_pack \
+ UnpackedTarball/mariadb/libmariadb/mf_path \
+ UnpackedTarball/mariadb/libmariadb/mf_unixpath \
+ UnpackedTarball/mariadb/libmariadb/mf_wcomp \
+ UnpackedTarball/mariadb/libmariadb/mulalloc \
+ UnpackedTarball/mariadb/libmariadb/my_alloc \
+ UnpackedTarball/mariadb/libmariadb/my_compress \
+ UnpackedTarball/mariadb/libmariadb/my_div \
+ UnpackedTarball/mariadb/libmariadb/my_error \
+ UnpackedTarball/mariadb/libmariadb/my_fopen \
+ UnpackedTarball/mariadb/libmariadb/my_fstream \
+ UnpackedTarball/mariadb/libmariadb/my_getwd \
+ UnpackedTarball/mariadb/libmariadb/my_init \
+ UnpackedTarball/mariadb/libmariadb/my_lib \
+ UnpackedTarball/mariadb/libmariadb/my_malloc \
+ UnpackedTarball/mariadb/libmariadb/my_messnc \
+ UnpackedTarball/mariadb/libmariadb/my_net \
+ UnpackedTarball/mariadb/libmariadb/my_once \
+ UnpackedTarball/mariadb/libmariadb/my_open \
+ UnpackedTarball/mariadb/libmariadb/my_port \
+ UnpackedTarball/mariadb/libmariadb/my_pthread \
+ UnpackedTarball/mariadb/libmariadb/my_read \
+ UnpackedTarball/mariadb/libmariadb/my_realloc \
+ UnpackedTarball/mariadb/libmariadb/my_seek \
+ UnpackedTarball/mariadb/libmariadb/my_static \
+ UnpackedTarball/mariadb/libmariadb/my_symlink \
+ UnpackedTarball/mariadb/libmariadb/my_thr_init \
+ UnpackedTarball/mariadb/libmariadb/my_write \
+ UnpackedTarball/mariadb/libmariadb/password \
+ UnpackedTarball/mariadb/libmariadb/str2int \
+ UnpackedTarball/mariadb/libmariadb/strcend \
+ UnpackedTarball/mariadb/libmariadb/strcont \
+ UnpackedTarball/mariadb/libmariadb/strend \
+ UnpackedTarball/mariadb/libmariadb/strfill \
+ UnpackedTarball/mariadb/libmariadb/string \
+ UnpackedTarball/mariadb/libmariadb/strinstr \
+ UnpackedTarball/mariadb/libmariadb/strmake \
+ UnpackedTarball/mariadb/libmariadb/strmov \
+ UnpackedTarball/mariadb/libmariadb/strnmov \
+ UnpackedTarball/mariadb/libmariadb/strtoll \
+ UnpackedTarball/mariadb/libmariadb/strtoull \
+ UnpackedTarball/mariadb/libmariadb/strxmov \
+ UnpackedTarball/mariadb/libmariadb/strxnmov \
+ UnpackedTarball/mariadb/libmariadb/thr_mutex \
+ UnpackedTarball/mariadb/libmariadb/typelib \
+ UnpackedTarball/mariadb/libmariadb/sha1 \
+ UnpackedTarball/mariadb/libmariadb/my_stmt \
+ UnpackedTarball/mariadb/libmariadb/my_loaddata \
+ UnpackedTarball/mariadb/libmariadb/my_stmt_codec \
+ UnpackedTarball/mariadb/libmariadb/client_plugin \
+ UnpackedTarball/mariadb/libmariadb/my_auth \
+ UnpackedTarball/mariadb/libmariadb/ma_secure \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,mariadb))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,mariadb,$(MARIADB_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/mysql_version.h,external/libmariadb/configs/mysql_version.h))
+
+ifneq ($(OS),WNT)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/my_config.h,external/libmariadb/configs/mac_my_config.h))
+else
+$(eval $(call gb_UnpackedTarball_add_file,mariadb,include/my_config.h,external/libmariadb/configs/linux_my_config.h))
+endif
+endif # $(OS),WNT
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,mariadb,1))
+
+# libmariadb/mariadb-static-inline.patch upstream at
+# <https://mariadb.atlassian.net/browse/CONC-18> "no external definition of
+# non-static inline local_thr_alarm in libmariadb/net.c":
+$(eval $(call gb_UnpackedTarball_add_patches,mariadb,\
+ external/libmariadb/mariadb-swap.patch \
+ external/libmariadb/mariadb-trunk-101.patch \
+ external/libmariadb/mariadb-msvc.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+
+/*
+ * Include file constants (processed in LibmysqlIncludeFiles.txt 1
+ */
+#define HAVE_ALLOCA_H 1
+#define HAVE_ARPA_INET_H 1
+#define HAVE_CRYPT_H 1
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_EXECINFO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FENV_H 1
+#define HAVE_FLOAT_H 1
+/* #undef HAVE_FPU_CONTROL_H */
+#define HAVE_GRP_H 1
+/* #undef HAVE_IEEEFP_H */
+#define HAVE_LIMITS_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_NETINET_IN_H 1
+#define HAVE_PATHS_H 1
+#define HAVE_PWD_H 1
+#define HAVE_SCHED_H 1
+/* #undef HAVE_SELECT_H */
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+/* #undef HAVE_SYNCH_H */
+/* #undef HAVE_SYS_FPU_H */
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_IPC_H 1
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_PRCTL_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SHM_H 1
+#define HAVE_SYS_SOCKET_H 1
+#define HAVE_SYS_STAT_H 1
+/* #undef HAVE_SYS_STREAM_H */
+#define HAVE_SYS_TIMEB_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_UN_H 1
+/* #undef HAVE_SYSENT_H */
+#define HAVE_TERMIO_H 1
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME_H 1
+
+/*
+ * function definitions - processed in LibmysqlFunctions.txt
+ */
+#define HAVE_ACCESS 1
+/* #undef HAVE_AIOWAIT */
+#define HAVE_ALARM 1
+/* #undef HAVE_ALLOCA */
+#define HAVE_BCMP 1
+/* #undef HAVE_BFILL */
+/* #undef HAVE_BMOVE */
+#define HAVE_BZERO 1
+#define HAVE_CLOCK_GETTIME 1
+/* #undef HAVE_COMPRESS */
+/* #undef HAVE_CRYPT */
+#define HAVE_DLERROR 1
+#define HAVE_DLOPEN 1
+#define HAVE_FCHMOD 1
+#define HAVE_FCNTL 1
+/* #undef HAVE_FCONVERT */
+#define HAVE_FDATASYNC 1
+#define HAVE_FESETROUND 1
+#define HAVE_FINITE 1
+#define HAVE_FSEEKO 1
+#define HAVE_FSYNC 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETCWD 1
+#define HAVE_GETHOSTBYADDR_R 1
+#define HAVE_GETHOSTBYNAME_R 1
+/* #undef HAVE_GETHRTIME */
+#define HAVE_GETNAMEINFO 1
+#define HAVE_GETPAGESIZE 1
+#define HAVE_GETPASS 1
+/* #undef HAVE_GETPASSPHRASE */
+#define HAVE_GETPWNAM 1
+#define HAVE_GETPWUID 1
+#define HAVE_GETRLIMIT 1
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETWD 1
+#define HAVE_GMTIME_R 1
+#define HAVE_INITGROUPS 1
+#define HAVE_LDIV 1
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LOG2 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MADVISE 1
+#define HAVE_MALLINFO 1
+#define HAVE_MEMALIGN 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MLOCK 1
+#define HAVE_MLOCKALL 1
+#define HAVE_MMAP 1
+#define HAVE_MMAP64 1
+#define HAVE_PERROR 1
+#define HAVE_POLL 1
+#define HAVE_PREAD 1
+/* #undef HAVE_PTHREAD_ATTR_CREATE */
+#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
+/* #undef HAVE_PTHREAD_ATTR_SETPRIO */
+#define HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
+#define HAVE_PTHREAD_ATTR_SETSCOPE 1
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
+/* #undef HAVE_PTHREAD_INIT */
+#define HAVE_PTHREAD_KEY_DELETE 1
+#define HAVE_PTHREAD_KILL 1
+#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
+/* #undef HAVE_PTHREAD_SETPRIO_NP */
+#define HAVE_PTHREAD_SETSCHEDPARAM 1
+#define HAVE_PTHREAD_SIGMASK 1
+/* #undef HAVE_PTHREAD_THREADMASK */
+/* #undef HAVE_PTHREAD_YIELD_NP */
+#define HAVE_READDIR_R 1
+#define HAVE_READLINK 1
+#define HAVE_REALPATH 1
+#define HAVE_RENAME 1
+#define HAVE_SCHED_YIELD 1
+#define HAVE_SELECT 1
+/* #undef HAVE_SETFD */
+/* #undef HAVE_SETFILEPOINTER */
+#define HAVE_SIGNAL 1
+#define HAVE_SIGACTION 1
+/* #undef HAVE_SIGTHREADMASK */
+#define HAVE_SIGWAIT 1
+#define HAVE_SLEEP 1
+#define HAVE_SNPRINTF 1
+/* #undef HAVE_SQLITE */
+#define HAVE_STPCPY 1
+#define HAVE_STRERROR 1
+/* #undef HAVE_STRLCPY */
+#define HAVE_STRNLEN 1
+#define HAVE_STRPBRK 1
+#define HAVE_STRSEP 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOULL 1
+/* #undef HAVE_TELL */
+/* #undef HAVE_THR_SETCONCURRENCY */
+/* #undef HAVE_THR_YIELD */
+#define HAVE_VASPRINTF 1
+#define HAVE_VSNPRINTF 1
+
+/*
+ * types and sizes
+ */
+/* Types we may use */
+#define SIZEOF_CHAR 1
+#if SIZEOF_CHAR
+# define HAVE_CHAR 1
+#endif
+
+#define SIZEOF_CHARP 8
+#if SIZEOF_CHARP
+# define HAVE_CHARP 1
+#endif
+
+#define SIZEOF_SHORT 2
+#if SIZEOF_SHORT
+# define HAVE_SHORT 1
+#endif
+
+#define SIZEOF_INT 4
+#if SIZEOF_INT
+# define HAVE_INT 1
+#endif
+
+#define SIZEOF_LONG 8
+#if SIZEOF_LONG
+# define HAVE_LONG 1
+#endif
+
+#define SIZEOF_LONG_LONG 8
+#if SIZEOF_LONG_LONG
+# define HAVE_LONG_LONG 1
+#endif
+
+#define SIZEOF_OFF_T 8
+#if SIZEOF_OFF_T
+# define HAVE_OFF_T 1
+#endif
+
+#define SIZEOF_SIGSET_T 128
+#if SIZEOF_SIGSET_T
+# define HAVE_SIGSET_T 1
+#endif
+
+#define SIZEOF_SIZE_T 8
+#if SIZEOF_SIZE_T
+# define HAVE_SIZE_T 1
+#endif
+
+/* #undef SIZEOF_UCHAR */
+#if SIZEOF_UCHAR
+# define HAVE_UCHAR 1
+#endif
+
+#define SIZEOF_UINT 4
+#if SIZEOF_UINT
+# define HAVE_UINT 1
+#endif
+
+#define SIZEOF_ULONG 8
+#if SIZEOF_ULONG
+# define HAVE_ULONG 1
+#endif
+
+/* #undef SIZEOF_INT8 */
+#if SIZEOF_INT8
+# define HAVE_INT8 1
+#endif
+/* #undef SIZEOF_UINT8 */
+#if SIZEOF_UINT8
+# define HAVE_UINT8 1
+#endif
+
+/* #undef SIZEOF_INT16 */
+#if SIZEOF_INT16
+# define HAVE_INT16 1
+#endif
+/* #undef SIZEOF_UINT16 */
+#if SIZEOF_UINT16
+# define HAVE_UINT16 1
+#endif
+
+/* #undef SIZEOF_INT32 */
+#if SIZEOF_INT32
+# define HAVE_INT32 1
+#endif
+/* #undef SIZEOF_UINT32 */
+#if SIZEOF_UINT32
+# define HAVE_UINT32 1
+#endif
+/* #undef SIZEOF_U_INT32_T */
+#if SIZEOF_U_INT32_T
+# define HAVE_U_INT32_T 1
+#endif
+
+/* #undef SIZEOF_INT64 */
+#if SIZEOF_INT64
+# define HAVE_INT64 1
+#endif
+/* #undef SIZEOF_UINT64 */
+#if SIZEOF_UINT64
+# define HAVE_UINT64 1
+#endif
+
+/* #undef SIZEOF_SOCKLEN_T */
+#if SIZEOF_SOCKLEN_T
+# define HAVE_SOCKLEN_T 1
+#endif
+
+#define SOCKET_SIZE_TYPE socklen_t
+
+#define RETSIGTYPE void
+#define RETQSORTTYPE void
+
+/*
+ * various other defines
+ */
+/* #undef HAVE_THREADS */
+#define SHAREDIR "share"
+#define DEFAULT_CHARSET_HOME "/usr/local"
+#define PLUGINDIR "/usr/local/lib/plugin"
+
--- /dev/null
+
+#define HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1
+
+/*
+ * Include file constants (processed in LibmysqlIncludeFiles.txt 1
+ */
+#define HAVE_ALLOCA_H 1
+#define HAVE_ARPA_INET_H 1
+/* #undef HAVE_CRYPT_H */
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_EXECINFO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FENV_H 1
+#define HAVE_FLOAT_H 1
+/* #undef HAVE_FPU_CONTROL_H */
+#define HAVE_GRP_H 1
+/* #undef HAVE_IEEEFP_H */
+#define HAVE_LIMITS_H 1
+/* #undef HAVE_MALLOC_H */
+#define HAVE_MEMORY_H 1
+#define HAVE_NETINET_IN_H 1
+#define HAVE_PATHS_H 1
+#define HAVE_PWD_H 1
+#define HAVE_SCHED_H 1
+/* #undef HAVE_SELECT_H */
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+/* #undef HAVE_SYNCH_H */
+/* #undef HAVE_SYS_FPU_H */
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_IPC_H 1
+#define HAVE_SYS_MMAN_H 1
+/* #undef HAVE_SYS_PRCTL_H */
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SHM_H 1
+#define HAVE_SYS_SOCKET_H 1
+#define HAVE_SYS_STAT_H 1
+/* #undef HAVE_SYS_STREAM_H */
+#define HAVE_SYS_TIMEB_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_UN_H 1
+/* #undef HAVE_SYSENT_H */
+/* #undef HAVE_TERMIO_H */
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME_H 1
+
+/*
+ * function definitions - processed in LibmysqlFunctions.txt
+ */
+#define HAVE_ACCESS 1
+/* #undef HAVE_AIOWAIT */
+#define HAVE_ALARM 1
+/* #undef HAVE_ALLOCA */
+#define HAVE_BCMP 1
+/* #undef HAVE_BFILL */
+/* #undef HAVE_BMOVE */
+#define HAVE_BZERO 1
+/* #undef HAVE_CLOCK_GETTIME */
+/* #undef HAVE_COMPRESS */
+#define HAVE_CRYPT 1
+#define HAVE_DLERROR 1
+#define HAVE_DLOPEN 1
+#define HAVE_FCHMOD 1
+#define HAVE_FCNTL 1
+/* #undef HAVE_FCONVERT */
+/* #undef HAVE_FDATASYNC */
+#define HAVE_FESETROUND 1
+#define HAVE_FINITE 1
+#define HAVE_FSEEKO 1
+#define HAVE_FSYNC 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETCWD 1
+/* #undef HAVE_GETHOSTBYADDR_R */
+/* #undef HAVE_GETHOSTBYNAME_R */
+/* #undef HAVE_GETHRTIME */
+#define HAVE_GETNAMEINFO 1
+#define HAVE_GETPAGESIZE 1
+#define HAVE_GETPASS 1
+/* #undef HAVE_GETPASSPHRASE */
+#define HAVE_GETPWNAM 1
+#define HAVE_GETPWUID 1
+#define HAVE_GETRLIMIT 1
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETWD 1
+#define HAVE_GMTIME_R 1
+#define HAVE_INITGROUPS 1
+#define HAVE_LDIV 1
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LOG2 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MADVISE 1
+/* #undef HAVE_MALLINFO */
+/* #undef HAVE_MEMALIGN */
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MLOCK 1
+#define HAVE_MLOCKALL 1
+#define HAVE_MMAP 1
+/* #undef HAVE_MMAP64 */
+#define HAVE_PERROR 1
+#define HAVE_POLL 1
+#define HAVE_PREAD 1
+/* #undef HAVE_PTHREAD_ATTR_CREATE */
+#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
+/* #undef HAVE_PTHREAD_ATTR_SETPRIO */
+#define HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
+#define HAVE_PTHREAD_ATTR_SETSCOPE 1
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
+/* #undef HAVE_PTHREAD_INIT */
+#define HAVE_PTHREAD_KEY_DELETE 1
+#define HAVE_PTHREAD_KILL 1
+#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
+/* #undef HAVE_PTHREAD_SETPRIO_NP */
+#define HAVE_PTHREAD_SETSCHEDPARAM 1
+#define HAVE_PTHREAD_SIGMASK 1
+/* #undef HAVE_PTHREAD_THREADMASK */
+#define HAVE_PTHREAD_YIELD_NP 1
+#define HAVE_READDIR_R 1
+#define HAVE_READLINK 1
+#define HAVE_REALPATH 1
+#define HAVE_RENAME 1
+#define HAVE_SCHED_YIELD 1
+#define HAVE_SELECT 1
+/* #undef HAVE_SETFD */
+/* #undef HAVE_SETFILEPOINTER */
+#define HAVE_SIGNAL 1
+#define HAVE_SIGACTION 1
+/* #undef HAVE_SIGTHREADMASK */
+#define HAVE_SIGWAIT 1
+#define HAVE_SLEEP 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STPCPY 1
+#define HAVE_STRERROR 1
+#define HAVE_STRLCPY 1
+#if MACOSX_SDK_VERSION >= 1070
+#define HAVE_STRNLEN 1
+#endif
+#define HAVE_STRPBRK 1
+#define HAVE_STRSEP 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOULL 1
+/* #undef HAVE_TELL */
+/* #undef HAVE_THR_SETCONCURRENCY */
+/* #undef HAVE_THR_YIELD */
+#define HAVE_VASPRINTF 1
+#define HAVE_VSNPRINTF 1
+
+/*
+ * types and sizes
+ */
+/* Types we may use */
+#define SIZEOF_CHAR 1
+#ifdef SIZEOF_CHAR
+# define HAVE_CHAR 1
+#endif
+
+#define SIZEOF_CHARP 4
+#ifdef SIZEOF_CHARP
+# define HAVE_CHARP 1
+#endif
+
+#define SIZEOF_SHORT 2
+#ifdef SIZEOF_SHORT
+# define HAVE_SHORT 1
+#endif
+
+#define SIZEOF_INT 4
+#ifdef SIZEOF_INT
+# define HAVE_INT 1
+#endif
+
+#define SIZEOF_LONG 4
+#ifdef SIZEOF_LONG
+# define HAVE_LONG 1
+#endif
+
+#define SIZEOF_LONG_LONG 8
+#ifdef SIZEOF_LONG_LONG
+# define HAVE_LONG_LONG 1
+#endif
+
+#define SIZEOF_OFF_T 8
+#ifdef SIZEOF_OFF_T
+# define HAVE_OFF_T 1
+#endif
+
+#define SIZEOF_SIGSET_T 4
+#ifdef SIZEOF_SIGSET_T
+# define HAVE_SIGSET_T 1
+#endif
+
+#define SIZEOF_SIZE_T 4
+#ifdef SIZEOF_SIZE_T
+# define HAVE_SIZE_T 1
+#endif
+
+/* #undef SIZEOF_UCHAR */
+#ifdef SIZEOF_UCHAR
+# define HAVE_UCHAR 1
+#endif
+
+#define SIZEOF_UINT 4
+#ifdef SIZEOF_UINT
+# define HAVE_UINT 1
+#endif
+
+/* #undef SIZEOF_ULONG */
+#ifdef SIZEOF_ULONG
+# define HAVE_ULONG 1
+#endif
+
+/* #undef SIZEOF_INT8 */
+#ifdef SIZEOF_INT8
+# define HAVE_INT8 1
+#endif
+/* #undef SIZEOF_UINT8 */
+#ifdef SIZEOF_UINT8
+# define HAVE_UINT8 1
+#endif
+
+/* #undef SIZEOF_INT16 */
+#ifdef SIZEOF_INT16
+# define HAVE_INT16 1
+#endif
+/* #undef SIZEOF_UINT16 */
+#ifdef SIZEOF_UINT16
+# define HAVE_UINT16 1
+#endif
+
+/* #undef SIZEOF_INT32 */
+#ifdef SIZEOF_INT32
+# define HAVE_INT32 1
+#endif
+/* #undef SIZEOF_UINT32 */
+#ifdef SIZEOF_UINT32
+# define HAVE_UINT32 1
+#endif
+/* #undef SIZEOF_U_INT32_T */
+#ifdef SIZEOF_U_INT32_T
+# define HAVE_U_INT32_T 1
+#endif
+
+/* #undef SIZEOF_INT64 */
+#ifdef SIZEOF_INT64
+# define HAVE_INT64 1
+#endif
+/* #undef SIZEOF_UINT64 */
+#ifdef SIZEOF_UINT64
+# define HAVE_UINT64 1
+#endif
+
+/* #undef SIZEOF_SOCKLEN_T */
+#ifdef SIZEOF_SOCKLEN_T
+# define HAVE_SOCKLEN_T 1
+#endif
+
+#define SOCKET_SIZE_TYPE socklen_t
+
+#define RETSIGTYPE void
+#define RETQSORTTYPE void
+
+/*
+ * various other defines
+ */
+/* #undef HAVE_THREADS */
+#define SHAREDIR "share"
+#define DEFAULT_CHARSET_HOME "/usr/local"
--- /dev/null
+/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
+ This file is public domain and comes with NO WARRANTY of any kind */
+
+/* Version numbers for protocol & mysqld */
+
+#ifdef _CUSTOMCONFIG_
+#include <custom_conf.h>
+#else
+#define PROTOCOL_VERSION 10
+#define MYSQL_CLIENT_VERSION "5.5.0"
+#define MYSQL_SERVER_VERSION "5.5.0"
+#define MYSQL_SERVER_SUFFIX ""
+#define FRM_VER
+#define MYSQL_VERSION_ID 50500
+#define MYSQL_PORT 3306
+#define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
+#define MYSQL_CONFIG_NAME "my"
+
+#define MARIADB_PACKAGE_VERSION "1.1.2"
+#define MARIADB_SYSTEM_TYPE "Linux"
+#define MARIADB_MACHINE_TYPE "x86_64"
+
+/* mysqld compile time options */
+#ifndef MYSQL_CHARSET
+#define MYSQL_CHARSET ""
+#endif
+#endif
+
--- /dev/null
+--- mariadb/libmariadb/my_pthread.c.orig 2013-04-17 15:45:52.025896770 +0200
++++ mariadb/libmariadb/my_pthread.c 2013-04-17 15:47:32.292895908 +0200
+@@ -28,6 +28,10 @@
+
+ #ifdef _WIN32
+
++#ifndef ETIMEDOUT /* does not exist MSVC 2008 but was added in MSVC 2010 */
++#define ETIMEDOUT 145
++#endif
++
+ int
+ pthread_cond_init (pthread_cond_t *cv, const pthread_condattr_t *attr)
+ {
--- /dev/null
+--- mariadb/include/global.h 2013-03-06 17:06:42.545906061 +0100
++++ mariadb/include/global.h 2013-03-07 14:45:03.811128674 +0100
+@@ -247,7 +247,9 @@
+ #endif
+
+ #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
++#ifndef __cplusplus
+ #define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; }
++#endif
+ #define test(a) ((a) ? 1 : 0)
+ #define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); }
+ #define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); }
+--- mariadb/include/my_global.h 2013-03-06 17:06:42.546906037 +0100
++++ mariadb/include/my_global.h 2013-03-07 14:44:47.032529753 +0100
+@@ -278,7 +278,9 @@
+ #endif
+
+ #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
++#ifndef __cplusplus
+ #define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; }
++#endif
+ #define test(a) ((a) ? 1 : 0)
+ #define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); }
+ #define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); }
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libmspub))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libmspub,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libmspub,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libmspub,\
+ boost_headers \
+ icu \
+ revenge \
+))
+
+$(call gb_ExternalProject_get_state_target,libmspub,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libmspub))
+
+$(eval $(call gb_Module_add_targets,libmspub,\
+ ExternalProject_libmspub \
+ UnpackedTarball_libmspub \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library parsing the Microsoft Publisher documents.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libmspub))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libmspub,$(MSPUB_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From 7b7cf183a7ad454706aa0f1657c851c578ec476e Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Sun, 25 May 2014 15:51:54 +0200
+Subject: [PATCH] librevenge-stream is optional: don't depend on it
+
+---
+ src/lib/MWAWStringStream.cxx | 153 +++++++++++++++++++++++++++++++++++++++++++
+ src/lib/MWAWStringStream.hxx | 50 ++++++++++++++
+ src/lib/Makefile.am | 2 +
+ src/lib/WingzParser.cxx | 3 +-
+ 4 files changed, 207 insertions(+), 1 deletion(-)
+ create mode 100644 src/lib/MWAWStringStream.cxx
+ create mode 100644 src/lib/MWAWStringStream.hxx
+
+diff --git a/src/lib/MWAWStringStream.cxx b/src/lib/MWAWStringStream.cxx
+new file mode 100644
+index 0000000..efea071
+--- /dev/null
++++ b/src/lib/MWAWStringStream.cxx
+@@ -0,0 +1,153 @@
++/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
++
++/* libmwaw
++* Version: MPL 2.0 / LGPLv2+
++*
++* The contents of this file are subject to the Mozilla Public License Version
++* 2.0 (the "License"); you may not use this file except in compliance with
++* the License or as specified alternatively below. You may obtain a copy of
++* the License at http://www.mozilla.org/MPL/
++*
++* Software distributed under the License is distributed on an "AS IS" basis,
++* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++* for the specific language governing rights and limitations under the
++* License.
++*
++* Alternatively, the contents of this file may be used under the terms of
++* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
++* in which case the provisions of the LGPLv2+ are applicable
++* instead of those above.
++*/
++
++#include <cstring>
++#include <vector>
++
++#include <librevenge-stream/librevenge-stream.h>
++
++#include "MWAWStringStream.hxx"
++
++class MWAWStringStreamPrivate
++{
++public:
++ MWAWStringStreamPrivate(const unsigned char *data, unsigned dataSize);
++ ~MWAWStringStreamPrivate();
++ std::vector<unsigned char> buffer;
++ long offset;
++private:
++ MWAWStringStreamPrivate(const MWAWStringStreamPrivate &);
++ MWAWStringStreamPrivate &operator=(const MWAWStringStreamPrivate &);
++};
++
++MWAWStringStreamPrivate::MWAWStringStreamPrivate(const unsigned char *data, unsigned dataSize) :
++ buffer(dataSize),
++ offset(0)
++{
++ std::memcpy(&buffer[0], data, dataSize);
++}
++
++MWAWStringStreamPrivate::~MWAWStringStreamPrivate()
++{
++}
++
++MWAWStringStream::MWAWStringStream(const unsigned char *data, const unsigned int dataSize) :
++ librevenge::RVNGInputStream(),
++ d(new MWAWStringStreamPrivate(data, dataSize))
++{
++}
++
++MWAWStringStream::~MWAWStringStream()
++{
++ delete d;
++}
++
++const unsigned char *MWAWStringStream::read(unsigned long numBytes, unsigned long &numBytesRead)
++{
++ numBytesRead = 0;
++
++ if (numBytes == 0)
++ return 0;
++
++ long numBytesToRead;
++
++ if ((unsigned long)d->offset+numBytes < d->buffer.size())
++ numBytesToRead = (long) numBytes;
++ else
++ numBytesToRead = (long) d->buffer.size() - d->offset;
++
++ numBytesRead = (unsigned long) numBytesToRead; // about as paranoid as we can be..
++
++ if (numBytesToRead == 0)
++ return 0;
++
++ long oldOffset = d->offset;
++ d->offset += numBytesToRead;
++
++ return &d->buffer[size_t(oldOffset)];
++
++}
++
++long MWAWStringStream::tell()
++{
++ return d->offset;
++}
++
++int MWAWStringStream::seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
++{
++ if (seekType == librevenge::RVNG_SEEK_CUR)
++ d->offset += offset;
++ else if (seekType == librevenge::RVNG_SEEK_SET)
++ d->offset = offset;
++ else if (seekType == librevenge::RVNG_SEEK_END)
++ d->offset += d->buffer.size();
++
++ if (d->offset < 0) {
++ d->offset = 0;
++ return 1;
++ }
++ if ((long)d->offset > (long)d->buffer.size()) {
++ d->offset = (long) d->buffer.size();
++ return 1;
++ }
++
++ return 0;
++}
++
++bool MWAWStringStream::isEnd()
++{
++ if ((long)d->offset >= (long)d->buffer.size())
++ return true;
++
++ return false;
++}
++
++bool MWAWStringStream::isStructured()
++{
++ return false;
++}
++
++unsigned MWAWStringStream::subStreamCount()
++{
++ return 0;
++}
++
++const char *MWAWStringStream::subStreamName(unsigned)
++{
++ return 0;
++}
++
++bool MWAWStringStream::existsSubStream(const char *)
++{
++ return false;
++}
++
++librevenge::RVNGInputStream *MWAWStringStream::getSubStreamById(unsigned)
++{
++ return 0;
++}
++
++librevenge::RVNGInputStream *MWAWStringStream::getSubStreamByName(const char *)
++{
++ return 0;
++}
++
++// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
+diff --git a/src/lib/MWAWStringStream.hxx b/src/lib/MWAWStringStream.hxx
+new file mode 100644
+index 0000000..9a6aa02
+--- /dev/null
++++ b/src/lib/MWAWStringStream.hxx
+@@ -0,0 +1,50 @@
++/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
++
++/* libmwaw
++* Version: MPL 2.0 / LGPLv2+
++*
++* The contents of this file are subject to the Mozilla Public License Version
++* 2.0 (the "License"); you may not use this file except in compliance with
++* the License or as specified alternatively below. You may obtain a copy of
++* the License at http://www.mozilla.org/MPL/
++*
++* Software distributed under the License is distributed on an "AS IS" basis,
++* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++* for the specific language governing rights and limitations under the
++* License.
++*
++* Alternatively, the contents of this file may be used under the terms of
++* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
++* in which case the provisions of the LGPLv2+ are applicable
++* instead of those above.
++*/
++
++#include <librevenge-stream/librevenge-stream.h>
++
++class MWAWStringStreamPrivate;
++
++class MWAWStringStream: public librevenge::RVNGInputStream
++{
++public:
++ MWAWStringStream(const unsigned char *data, const unsigned int dataSize);
++ ~MWAWStringStream();
++
++ const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
++ long tell();
++ int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
++ bool isEnd();
++
++ bool isStructured();
++ unsigned subStreamCount();
++ const char *subStreamName(unsigned);
++ bool existsSubStream(const char *name);
++ librevenge::RVNGInputStream *getSubStreamByName(const char *name);
++ librevenge::RVNGInputStream *getSubStreamById(unsigned);
++
++private:
++ MWAWStringStreamPrivate *d;
++ MWAWStringStream(const MWAWStringStream &); // copy is not allowed
++ MWAWStringStream &operator=(const MWAWStringStream &); // assignment is not allowed
++};
++
++// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
+diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
+index eb17bad..f7934b4 100644
+--- a/src/lib/Makefile.in
++++ b/src/lib/Makefile.in
+@@ -162,12 +162,12 @@ am_libmwaw_@MWAW_MAJOR_VERSION@_@MWAW_MI
+ MWAWPrinter.lo MWAWPropertyHandler.lo MWAWRSRCParser.lo \
+ MWAWSection.lo MWAWSpreadsheetDecoder.lo \
+ MWAWSpreadsheetEncoder.lo MWAWSpreadsheetListener.lo \
+- MWAWSubDocument.lo MWAWTable.lo MWAWTextListener.lo \
+- NisusWrtGraph.lo NisusWrtParser.lo NisusWrtStruct.lo \
+- NisusWrtText.lo RagTimeParser.lo RagTimeSpreadsheet.lo \
+- RagTimeText.lo SuperPaintParser.lo TeachTxtParser.lo \
+- WingzParser.lo WriteNowParser.lo WriteNowText.lo \
+- WriterPlsParser.lo ZWrtParser.lo ZWrtText.lo
++ MWAWStringStream.lo MWAWSubDocument.lo MWAWTable.lo \
++ MWAWTextListener.lo NisusWrtGraph.lo NisusWrtParser.lo \
++ NisusWrtStruct.lo NisusWrtText.lo RagTimeParser.lo \
++ RagTimeSpreadsheet.lo RagTimeText.lo SuperPaintParser.lo \
++ TeachTxtParser.lo WingzParser.lo WriteNowParser.lo \
++ WriteNowText.lo WriterPlsParser.lo ZWrtParser.lo ZWrtText.lo
+ libmwaw_@MWAW_MAJOR_VERSION@_@MWAW_MINOR_VERSION@_la_OBJECTS = $(am_libmwaw_@MWAW_MAJOR_VERSION@_@MWAW_MINOR_VERSION@_la_OBJECTS)
+ AM_V_lt = $(am__v_lt_@AM_V@)
+ am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+@@ -610,6 +610,8 @@ libmwaw_@MWAW_MAJOR_VERSION@_@MWAW_MINOR
+ MWAWSpreadsheetEncoder.hxx \
+ MWAWSpreadsheetListener.cxx \
+ MWAWSpreadsheetListener.hxx \
++ MWAWStringStream.cxx \
++ MWAWStringStream.hxx \
+ MWAWSubDocument.cxx \
+ MWAWSubDocument.hxx \
+ MWAWTable.cxx \
+@@ -812,6 +814,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWSpreadsheetDecoder.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWSpreadsheetEncoder.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWSpreadsheetListener.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWStringStream.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWSubDocument.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWTable.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MWAWTextListener.Plo@am__quote@
+diff --git a/src/lib/WingzParser.cxx b/src/lib/WingzParser.cxx
+index 4813816..93dde7d 100644
+--- a/src/lib/WingzParser.cxx
++++ b/src/lib/WingzParser.cxx
+@@ -49,6 +49,7 @@
+ #include "MWAWPictMac.hxx"
+ #include "MWAWPrinter.hxx"
+ #include "MWAWSpreadsheetListener.hxx"
++#include "MWAWStringStream.hxx"
+ #include "MWAWSubDocument.hxx"
+
+ #include "WingzParser.hxx"
+@@ -2496,7 +2497,7 @@ bool WingzParser::decodeEncrypted()
+
+ // finally replace the actual input with a new input
+ shared_ptr<librevenge::RVNGInputStream> newInput
+- (new librevenge::RVNGStringStream(buffer, (unsigned int)length));
++ (new MWAWStringStream(buffer, (unsigned int)length));
+ delete [] buffer;
+ getParserState()->m_input.reset(new MWAWInputStream(newInput, false));
+ return true;
+--
+1.9.0
+
--- /dev/null
+From ead2223f2d3d4742df84f37c6cea9c73b71257c5 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Sun, 25 May 2014 16:07:21 +0200
+Subject: [PATCH] librevenge-stream is optional: don't depend on it
+
+---
+ src/lib/MWAWInputStream.cxx | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/lib/MWAWInputStream.cxx b/src/lib/MWAWInputStream.cxx
+index 91b713b..0d60f67 100644
+--- a/src/lib/MWAWInputStream.cxx
++++ b/src/lib/MWAWInputStream.cxx
+@@ -43,6 +43,7 @@
+ #include "MWAWDebug.hxx"
+
+ #include "MWAWInputStream.hxx"
++#include "MWAWStringStream.hxx"
+
+ MWAWInputStream::MWAWInputStream(shared_ptr<librevenge::RVNGInputStream> inp, bool inverted)
+ : m_stream(inp), m_streamSize(0), m_inverseRead(inverted), m_readLimit(-1), m_prevLimits(),
+@@ -517,7 +518,7 @@ bool MWAWInputStream::unBinHex()
+ MWAW_DEBUG_MSG(("MWAWInputStream::unBinHex: can not read the resource fork\n"));
+ }
+ else {
+- shared_ptr<librevenge::RVNGInputStream> rsrc(new librevenge::RVNGStringStream(data, (unsigned int)numBytesRead));
++ shared_ptr<librevenge::RVNGInputStream> rsrc(new MWAWStringStream(data, (unsigned int)numBytesRead));
+ m_resourceFork.reset(new MWAWInputStream(rsrc,false));
+ }
+ }
+@@ -532,7 +533,7 @@ bool MWAWInputStream::unBinHex()
+ MWAW_DEBUG_MSG(("MWAWInputStream::unBinHex: can not read the data fork\n"));
+ return false;
+ }
+- m_stream.reset(new librevenge::RVNGStringStream(data, (unsigned int)numBytesRead));
++ m_stream.reset(new MWAWStringStream(data, (unsigned int)numBytesRead));
+ }
+
+ return true;
+@@ -692,9 +693,9 @@ bool MWAWInputStream::unMacMIME(MWAWInputStream *inp,
+ return false;
+ }
+ if (wh==1)
+- dataInput.reset(new librevenge::RVNGStringStream(data, (unsigned int)numBytesRead));
++ dataInput.reset(new MWAWStringStream(data, (unsigned int)numBytesRead));
+ else if (wh==2)
+- rsrcInput.reset(new librevenge::RVNGStringStream(data, (unsigned int)numBytesRead));
++ rsrcInput.reset(new MWAWStringStream(data, (unsigned int)numBytesRead));
+ else { // the finder info
+ if (entrySize < 8) {
+ MWAW_DEBUG_MSG(("MWAWInputStream::unMacMIME: finder info size is odd\n"));
+--
+1.9.0
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libmwaw,libmwaw))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libmwaw,libmwaw))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,libmwaw,$(LIBO_LIB_FOLDER)/libmwaw-0.3.3.dylib,src/lib/.libs/libmwaw-0.3.3.dylib))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,libmwaw,$(LIBO_LIB_FOLDER)/libmwaw-0.3.dll,src/lib/.libs/libmwaw-0.3.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,libmwaw,$(LIBO_LIB_FOLDER)/libmwaw-0.3.so.3,src/lib/.libs/libmwaw-0.3.so.3.0.1))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libmwaw))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libmwaw,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libmwaw,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libmwaw,\
+ boost_headers \
+ revenge \
+))
+
+$(call gb_ExternalProject_get_state_target,libmwaw,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ $(if $(DISABLE_DYNLOADING), \
+ --enable-static --disable-shared \
+ , \
+ --enable-shared --disable-static \
+ ) \
+ --without-docs \
+ --disable-tools \
+ --disable-zip \
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug,--disable-debug) \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ --disable-werror \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && (cd $(EXTERNAL_WORKDIR)/src/lib && \
+ $(MAKE)) \
+ $(if $(filter MACOSX,$(OS)),\
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(EXTERNAL_WORKDIR)/src/lib/.libs/libmwaw-0.3.3.dylib \
+ ) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,mwaw))
+
+$(eval $(call gb_Library_use_unpacked,mwaw,libmwaw))
+
+$(eval $(call gb_Library_use_externals,mwaw,\
+ boost_headers \
+ revenge \
+))
+
+$(eval $(call gb_Library_set_warnings_not_errors,mwaw))
+
+$(eval $(call gb_Library_set_include,mwaw,\
+ -I$(call gb_UnpackedTarball_get_dir,libmwaw)/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,mwaw,\
+ -DBOOST_ALL_NO_LIB \
+ -DBUILD_MWAW \
+ -DNDEBUG \
+ -D_WINDLL \
+))
+
+$(eval $(call gb_Library_add_generated_exception_objects,mwaw,\
+ UnpackedTarball/libmwaw/src/lib/ActaParser \
+ UnpackedTarball/libmwaw/src/lib/ActaText \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksBMParser \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksDBParser \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksDRParser \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksParser \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksSSParser \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksStructManager \
+ UnpackedTarball/libmwaw/src/lib/BeagleWksText \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksBMParser \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksDatabase \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksDbaseContent \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksDocument \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksGraph \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksParser \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksPresentation \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksSSParser \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksSpreadsheet \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksStruct \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksStyleManager \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksTable \
+ UnpackedTarball/libmwaw/src/lib/ClarisWksText \
+ UnpackedTarball/libmwaw/src/lib/DocMkrParser \
+ UnpackedTarball/libmwaw/src/lib/DocMkrText \
+ UnpackedTarball/libmwaw/src/lib/EDocParser \
+ UnpackedTarball/libmwaw/src/lib/FullWrtGraph \
+ UnpackedTarball/libmwaw/src/lib/FullWrtParser \
+ UnpackedTarball/libmwaw/src/lib/FullWrtStruct \
+ UnpackedTarball/libmwaw/src/lib/FullWrtText \
+ UnpackedTarball/libmwaw/src/lib/GreatWksBMParser \
+ UnpackedTarball/libmwaw/src/lib/GreatWksDBParser \
+ UnpackedTarball/libmwaw/src/lib/GreatWksDRParser \
+ UnpackedTarball/libmwaw/src/lib/GreatWksDocument \
+ UnpackedTarball/libmwaw/src/lib/GreatWksGraph \
+ UnpackedTarball/libmwaw/src/lib/GreatWksParser \
+ UnpackedTarball/libmwaw/src/lib/GreatWksSSParser \
+ UnpackedTarball/libmwaw/src/lib/GreatWksText \
+ UnpackedTarball/libmwaw/src/lib/HanMacWrdJGraph \
+ UnpackedTarball/libmwaw/src/lib/HanMacWrdJParser \
+ UnpackedTarball/libmwaw/src/lib/HanMacWrdJText \
+ UnpackedTarball/libmwaw/src/lib/HanMacWrdKGraph \
+ UnpackedTarball/libmwaw/src/lib/HanMacWrdKParser \
+ UnpackedTarball/libmwaw/src/lib/HanMacWrdKText \
+ UnpackedTarball/libmwaw/src/lib/LightWayTxtGraph \
+ UnpackedTarball/libmwaw/src/lib/LightWayTxtParser \
+ UnpackedTarball/libmwaw/src/lib/LightWayTxtText \
+ UnpackedTarball/libmwaw/src/lib/MWAWCell \
+ UnpackedTarball/libmwaw/src/lib/MWAWChart \
+ UnpackedTarball/libmwaw/src/lib/MWAWDebug \
+ UnpackedTarball/libmwaw/src/lib/MWAWDocument \
+ UnpackedTarball/libmwaw/src/lib/MWAWFont \
+ UnpackedTarball/libmwaw/src/lib/MWAWFontConverter \
+ UnpackedTarball/libmwaw/src/lib/MWAWFontSJISConverter \
+ UnpackedTarball/libmwaw/src/lib/MWAWGraphicDecoder \
+ UnpackedTarball/libmwaw/src/lib/MWAWGraphicEncoder \
+ UnpackedTarball/libmwaw/src/lib/MWAWGraphicListener \
+ UnpackedTarball/libmwaw/src/lib/MWAWGraphicShape \
+ UnpackedTarball/libmwaw/src/lib/MWAWGraphicStyle \
+ UnpackedTarball/libmwaw/src/lib/MWAWHeader \
+ UnpackedTarball/libmwaw/src/lib/MWAWInputStream \
+ UnpackedTarball/libmwaw/src/lib/MWAWList \
+ UnpackedTarball/libmwaw/src/lib/MWAWOLEParser \
+ UnpackedTarball/libmwaw/src/lib/MWAWPageSpan \
+ UnpackedTarball/libmwaw/src/lib/MWAWParagraph \
+ UnpackedTarball/libmwaw/src/lib/MWAWParser \
+ UnpackedTarball/libmwaw/src/lib/MWAWPictBitmap \
+ UnpackedTarball/libmwaw/src/lib/MWAWPictData \
+ UnpackedTarball/libmwaw/src/lib/MWAWPictMac \
+ UnpackedTarball/libmwaw/src/lib/MWAWPrinter \
+ UnpackedTarball/libmwaw/src/lib/MWAWPropertyHandler \
+ UnpackedTarball/libmwaw/src/lib/MWAWRSRCParser \
+ UnpackedTarball/libmwaw/src/lib/MWAWSection \
+ UnpackedTarball/libmwaw/src/lib/MWAWSpreadsheetDecoder \
+ UnpackedTarball/libmwaw/src/lib/MWAWSpreadsheetEncoder \
+ UnpackedTarball/libmwaw/src/lib/MWAWSpreadsheetListener \
+ UnpackedTarball/libmwaw/src/lib/MWAWStringStream \
+ UnpackedTarball/libmwaw/src/lib/MWAWSubDocument \
+ UnpackedTarball/libmwaw/src/lib/MWAWTable \
+ UnpackedTarball/libmwaw/src/lib/MWAWTextListener \
+ UnpackedTarball/libmwaw/src/lib/MacDocParser \
+ UnpackedTarball/libmwaw/src/lib/MacPaintParser \
+ UnpackedTarball/libmwaw/src/lib/MacWrtParser \
+ UnpackedTarball/libmwaw/src/lib/MacWrtProParser \
+ UnpackedTarball/libmwaw/src/lib/MacWrtProStructures \
+ UnpackedTarball/libmwaw/src/lib/MarinerWrtGraph \
+ UnpackedTarball/libmwaw/src/lib/MarinerWrtParser \
+ UnpackedTarball/libmwaw/src/lib/MarinerWrtText \
+ UnpackedTarball/libmwaw/src/lib/MindWrtParser \
+ UnpackedTarball/libmwaw/src/lib/MoreParser \
+ UnpackedTarball/libmwaw/src/lib/MoreText \
+ UnpackedTarball/libmwaw/src/lib/MsWks3Text \
+ UnpackedTarball/libmwaw/src/lib/MsWks4Text \
+ UnpackedTarball/libmwaw/src/lib/MsWks4Zone \
+ UnpackedTarball/libmwaw/src/lib/MsWksDBParser \
+ UnpackedTarball/libmwaw/src/lib/MsWksDRParser \
+ UnpackedTarball/libmwaw/src/lib/MsWksDocument \
+ UnpackedTarball/libmwaw/src/lib/MsWksGraph \
+ UnpackedTarball/libmwaw/src/lib/MsWksParser \
+ UnpackedTarball/libmwaw/src/lib/MsWksSSParser \
+ UnpackedTarball/libmwaw/src/lib/MsWksTable \
+ UnpackedTarball/libmwaw/src/lib/MsWrd1Parser \
+ UnpackedTarball/libmwaw/src/lib/MsWrdParser \
+ UnpackedTarball/libmwaw/src/lib/MsWrdStruct \
+ UnpackedTarball/libmwaw/src/lib/MsWrdText \
+ UnpackedTarball/libmwaw/src/lib/MsWrdTextStyles \
+ UnpackedTarball/libmwaw/src/lib/NisusWrtGraph \
+ UnpackedTarball/libmwaw/src/lib/NisusWrtParser \
+ UnpackedTarball/libmwaw/src/lib/NisusWrtStruct \
+ UnpackedTarball/libmwaw/src/lib/NisusWrtText \
+ UnpackedTarball/libmwaw/src/lib/RagTimeParser \
+ UnpackedTarball/libmwaw/src/lib/RagTimeSpreadsheet \
+ UnpackedTarball/libmwaw/src/lib/RagTimeText \
+ UnpackedTarball/libmwaw/src/lib/SuperPaintParser \
+ UnpackedTarball/libmwaw/src/lib/TeachTxtParser \
+ UnpackedTarball/libmwaw/src/lib/WingzParser \
+ UnpackedTarball/libmwaw/src/lib/WriteNowParser \
+ UnpackedTarball/libmwaw/src/lib/WriteNowText \
+ UnpackedTarball/libmwaw/src/lib/WriterPlsParser \
+ UnpackedTarball/libmwaw/src/lib/ZWrtParser \
+ UnpackedTarball/libmwaw/src/lib/ZWrtText \
+ UnpackedTarball/libmwaw/src/lib/libmwaw_internal \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libmwaw))
+
+$(eval $(call gb_Module_add_targets,libmwaw,\
+ UnpackedTarball_libmwaw \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,libmwaw,\
+ Library_mwaw \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,libmwaw,\
+ ExternalPackage_libmwaw \
+ ExternalProject_libmwaw \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library parsing different document file formats used on old Mac OS.
+
+https://sourceforge.net/projects/libmwaw/
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libmwaw))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libmwaw,$(MWAW_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libmwaw,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libmwaw,\
+ external/libmwaw/0001-librevenge-stream-is-optional-don-t-depend-on-it.patch \
+ external/libmwaw/0002-librevenge-stream-is-optional-don-t-depend-on-it.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libodfgen,libodfgen))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libodfgen,libodfgen))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,libodfgen,$(LIBO_LIB_FOLDER)/libodfgen-0.1.1.dylib,src/.libs/libodfgen-0.1.1.dylib))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,libodfgen,$(LIBO_LIB_FOLDER)/libodfgen-0.1.dll,src/.libs/libodfgen-0.1.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,libodfgen,$(LIBO_LIB_FOLDER)/libodfgen-0.1.so.1,src/.libs/libodfgen-0.1.so.1.0.1))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libodfgen))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libodfgen,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libodfgen,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libodfgen,\
+ boost_headers \
+ revenge \
+))
+
+$(call gb_ExternalProject_get_state_target,libodfgen,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-shared \
+ --disable-static \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ --without-docs \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),\
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(EXTERNAL_WORKDIR)/src/.libs/libodfgen-0.1.1.dylib \
+ ) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,odfgen))
+
+$(eval $(call gb_Library_use_unpacked,odfgen,libodfgen))
+
+$(eval $(call gb_Library_use_externals,odfgen,\
+ boost_headers \
+ revenge \
+))
+
+$(eval $(call gb_Library_set_warnings_not_errors,odfgen))
+
+$(eval $(call gb_Library_set_include,odfgen,\
+ -I$(call gb_UnpackedTarball_get_dir,libodfgen)/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,odfgen,\
+ -DBOOST_ALL_NO_LIB \
+ -DDLL_EXPORT \
+ -DLIBODFGEN_BUILD \
+ -DNDEBUG \
+))
+
+$(eval $(call gb_Library_add_generated_exception_objects,odfgen,\
+ UnpackedTarball/libodfgen/src/DocumentElement \
+ UnpackedTarball/libodfgen/src/FilterInternal \
+ UnpackedTarball/libodfgen/src/FontStyle \
+ UnpackedTarball/libodfgen/src/GraphicFunctions \
+ UnpackedTarball/libodfgen/src/GraphicStyle \
+ UnpackedTarball/libodfgen/src/InternalHandler \
+ UnpackedTarball/libodfgen/src/ListStyle \
+ UnpackedTarball/libodfgen/src/OdcGenerator \
+ UnpackedTarball/libodfgen/src/OdfGenerator \
+ UnpackedTarball/libodfgen/src/OdgGenerator \
+ UnpackedTarball/libodfgen/src/OdpGenerator \
+ UnpackedTarball/libodfgen/src/OdsGenerator \
+ UnpackedTarball/libodfgen/src/OdtGenerator \
+ UnpackedTarball/libodfgen/src/PageSpan \
+ UnpackedTarball/libodfgen/src/SectionStyle \
+ UnpackedTarball/libodfgen/src/SheetStyle \
+ UnpackedTarball/libodfgen/src/TableStyle \
+ UnpackedTarball/libodfgen/src/TextRunStyle \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libodfgen))
+
+$(eval $(call gb_Module_add_targets,libodfgen,\
+ UnpackedTarball_libodfgen \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,libodfgen,\
+ Library_odfgen \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,libodfgen,\
+ ExternalPackage_libodfgen \
+ ExternalProject_libodfgen \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://libwpg.sourceforge.net/]. Library to generate ODT and ODG documents from libwpd and libwpg API calls.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libodfgen))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libodfgen,$(ODFGEN_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libodfgen,1))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,liborcus))
+
+$(eval $(call gb_ExternalProject_use_autoconf,liborcus,build))
+
+$(eval $(call gb_ExternalProject_use_externals,liborcus, \
+ boost_headers \
+ boost_iostreams \
+ boost_system \
+ mdds_headers \
+ zlib \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,liborcus,\
+ build \
+))
+
+# Must be built with debug GNU C++ library if --enable-dbgutil has
+# caused the LO code to be built thusly.
+
+# The LIBS setting for Android is needed to get the orcus-xml-dump
+# executable to build successfully. We obviously don't actually need
+# that executable on Android, but we don't want to bother with
+# patching out building it for Android.
+
+#$(if $(filter MSC,$(COM)),CPPFLAGS+="-DBOOST_ALL_NO_LIB") CXXFLAGS+="$(BOOST_CXXFLAGS))
+
+liborcus_LIBS=
+ifneq ($(SYSTEM_ZLIB),)
+liborcus_LIBS+=-lz
+endif
+ifneq ($(SYSTEM_BOOST),)
+liborcus_LIBS+=$(BOOST_SYSTEM_LIB) $(BOOST_IOSTREAMS_LIB)
+else
+liborcus_LIBS+=-L$(gb_StaticLibrary_WORKDIR) -lboost_system -lboost_iostreams
+endif
+ifeq ($(OS),ANDROID)
+liborcus_LIBS+=-lgnustl_shared -lm
+endif
+
+liborcus_CPPCLAGS=$(CPPFLAGS)
+ifeq ($(COM),MSC)
+liborcus_CPPFLAGS+=-DBOOST_ALL_NO_LIB
+endif
+ifeq ($(SYSTEM_ZLIB),)
+liborcus_CPPFLAGS+=$(ZLIB_CFLAGS)
+endif
+# patched boost needs to find config_global.h
+ifeq ($(SYSTEM_BOOST),)
+liborcus_CPPFLAGS += -I$(BUILDDIR)/config_$(gb_Side)
+endif
+#
+# OSes that use the GNU C++ library need to use -D_GLIBCXX_DEBUG in
+# sync with the rest of LibreOffice, i.e. depending on
+# --enable-dbgutil. Note that although Android doesn't use the GNU C
+# library (glibc), the NDK does offer the GNU C++ library as one of
+# the C++ libraries available, and we use it.
+#
+ifneq (,$(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)))
+ifneq (,$(gb_ENABLE_DBGUTIL))
+liborcus_CPPFLAGS+=-D_GLIBCXX_DEBUG
+endif
+endif
+
+liborcus_CXXFLAGS=$(CXXFLAGS)
+liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS)
+ifeq ($(COM),MSC)
+liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS)
+endif
+ifeq ($(SYSTEM_BOOST),)
+liborcus_CXXFLAGS+=-I$(WORKDIR)/UnpackedTarball/boost
+else
+liborcus_LDFLAGS+=$(BOOST_LDFLAGS)
+endif
+ifneq (,$(PTHREAD_LIBS))
+liborcus_LDFLAGS+=$(PTHREAD_LIBS)
+endif
+
+$(call gb_ExternalProject_get_state_target,liborcus,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(if $(liborcus_LIBS),LIBS='$(liborcus_LIBS)') \
+ $(if $(liborcus_CXXFLAGS),CXXFLAGS='$(liborcus_CXXFLAGS)') \
+ $(if $(liborcus_CPPFLAGS),CPPFLAGS='$(liborcus_CPPFLAGS)') \
+ $(if $(liborcus_LDFLAGS),LDFLAGS='$(liborcus_LDFLAGS)') \
+ MDDS_CFLAGS='$(MDDS_CFLAGS)' \
+ MDDS_LIBS=' ' \
+ ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ $(if $(filter TRUE,$(ENABLE_DEBUG)),--enable-debug,--disable-debug) \
+ --disable-spreadsheet-model \
+ --without-tools \
+ --disable-werror \
+ $(if $(SYSTEM_BOOST),,--with-boost=$(WORKDIR)/UnpackedTarball/boost) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(if $(VERBOSE)$(verbose),V=1) \
+ $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,liborcus))
+
+$(eval $(call gb_Module_add_targets,liborcus,\
+ ExternalProject_liborcus \
+ UnpackedTarball_liborcus \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,liborcus))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,liborcus,$(ORCUS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,liborcus,0))
+
+liborcus_patches :=
+
+# make config.sub recognize arm-linux-androideabi
+# liborcus_patches += liborcus_0.1.0-configure.patch
+
+# don't use dllimport
+liborcus_patches += liborcus_0.1.0-dllimport.patch
+
+ifneq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE)
+liborcus_patches += visibility.patch
+endif
+
+# <https://gitorious.org/orcus/orcus/merge_requests/2#
+# f60d6eecee72349993a392a9a63ddf3383d3b8c8-
+# f60d6eecee72349993a392a9a63ddf3383d3b8c8@2>:
+
+$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
+ $(foreach patch,$(liborcus_patches),external/liborcus/$(patch)) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- config.sub
++++ config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1275,7 +1275,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+--- include/orcus/env.hpp
++++ include/orcus/env.hpp
+@@ -35,14 +35,8 @@
+ #else
+ #define ORCUS_DLLPUBLIC __declspec(dllexport)
+ #endif
+- #elif defined __ORCUS_STATIC_LIB
++ #else
+ #define ORCUS_DLLPUBLIC
+- #else
+- #ifdef __GNUC__
+- #define ORCUS_DLLPUBLIC __attribute__ ((dllimport))
+- #else
+- #define ORCUS_DLLPUBLIC __declspec(dllimport)
+- #endif
+ #endif
+ #define ORCUS_DLLLOCAL
+ #else
--- /dev/null
+--- configure
++++ configure
+@@ -3211,7 +3211,7 @@
+ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+-CXXFLAGS="$CXXFLAGS -O2 -fvisibility=hidden -Wall"
++CXXFLAGS="$CXXFLAGS -O2 -Wall"
+
+ # ===========================
+ # Find required base packages
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libpng))
+
+ifeq ($(SYSTEM_LIBPNG),)
+
+$(eval $(call gb_Module_add_targets,libpng,\
+ StaticLibrary_png \
+ UnpackedTarball_png \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+libpng is the official PNG reference library, from [http://www.libpng.org/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,png))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,png))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,png,png))
+
+$(eval $(call gb_StaticLibrary_use_externals,png,\
+ zlib \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,png,\
+ UnpackedTarball/png/png \
+ UnpackedTarball/png/pngerror \
+ UnpackedTarball/png/pngget \
+ UnpackedTarball/png/pngmem \
+ UnpackedTarball/png/pngpread \
+ UnpackedTarball/png/pngread \
+ UnpackedTarball/png/pngrio \
+ UnpackedTarball/png/pngrtran \
+ UnpackedTarball/png/pngrutil \
+ UnpackedTarball/png/pngset \
+ UnpackedTarball/png/pngtrans \
+ UnpackedTarball/png/pngwio \
+ UnpackedTarball/png/pngwrite \
+ UnpackedTarball/png/pngwtran \
+ UnpackedTarball/png/pngwutil \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,png))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,png,$(PNG_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_files,png,.,\
+ external/libpng/configs/pnglibconf.h \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+/* 1.5.18 STANDARD API DEFINITION */
+/* pnglibconf.h - library build configuration */
+
+/* libpng version 1.5.18 - February 6, 2014 */
+
+/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
+
+/* This code is released under the libpng license. */
+/* For conditions of distribution and use, see the disclaimer */
+/* and license in png.h */
+
+/* pnglibconf.h */
+/* Machine generated file: DO NOT EDIT */
+/* Derived from: scripts/pnglibconf.dfa */
+#ifndef PNGLCONF_H
+#define PNGLCONF_H
+/* options */
+#define PNG_16BIT_SUPPORTED
+#define PNG_ALIGNED_MEMORY_SUPPORTED
+/*#undef PNG_ARM_NEON_API_SUPPORTED*/
+/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
+#define PNG_BENIGN_ERRORS_SUPPORTED
+#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
+#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_CHECK_cHRM_SUPPORTED
+#define PNG_CONSOLE_IO_SUPPORTED
+#define PNG_CONVERT_tIME_SUPPORTED
+#define PNG_EASY_ACCESS_SUPPORTED
+/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
+#define PNG_ERROR_TEXT_SUPPORTED
+#define PNG_FIXED_POINT_SUPPORTED
+#define PNG_FLOATING_ARITHMETIC_SUPPORTED
+#define PNG_FLOATING_POINT_SUPPORTED
+#define PNG_GET_PALETTE_MAX_SUPPORTED
+#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+#define PNG_INCH_CONVERSIONS_SUPPORTED
+#define PNG_INFO_IMAGE_SUPPORTED
+#define PNG_IO_STATE_SUPPORTED
+#define PNG_MNG_FEATURES_SUPPORTED
+#define PNG_POINTER_INDEXING_SUPPORTED
+#define PNG_PROGRESSIVE_READ_SUPPORTED
+#define PNG_READ_16BIT_SUPPORTED
+#define PNG_READ_ALPHA_MODE_SUPPORTED
+#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_READ_BACKGROUND_SUPPORTED
+#define PNG_READ_BGR_SUPPORTED
+#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
+#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
+#define PNG_READ_EXPAND_16_SUPPORTED
+#define PNG_READ_EXPAND_SUPPORTED
+#define PNG_READ_FILLER_SUPPORTED
+#define PNG_READ_GAMMA_SUPPORTED
+#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
+#define PNG_READ_GRAY_TO_RGB_SUPPORTED
+#define PNG_READ_INTERLACING_SUPPORTED
+#define PNG_READ_INT_FUNCTIONS_SUPPORTED
+#define PNG_READ_INVERT_ALPHA_SUPPORTED
+#define PNG_READ_INVERT_SUPPORTED
+#define PNG_READ_OPT_PLTE_SUPPORTED
+#define PNG_READ_PACKSWAP_SUPPORTED
+#define PNG_READ_PACK_SUPPORTED
+#define PNG_READ_QUANTIZE_SUPPORTED
+#define PNG_READ_RGB_TO_GRAY_SUPPORTED
+#define PNG_READ_SCALE_16_TO_8_SUPPORTED
+#define PNG_READ_SHIFT_SUPPORTED
+#define PNG_READ_STRIP_16_TO_8_SUPPORTED
+#define PNG_READ_STRIP_ALPHA_SUPPORTED
+#define PNG_READ_SUPPORTED
+#define PNG_READ_SWAP_ALPHA_SUPPORTED
+#define PNG_READ_SWAP_SUPPORTED
+#define PNG_READ_TEXT_SUPPORTED
+#define PNG_READ_TRANSFORMS_SUPPORTED
+#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_READ_USER_CHUNKS_SUPPORTED
+#define PNG_READ_USER_TRANSFORM_SUPPORTED
+#define PNG_READ_bKGD_SUPPORTED
+#define PNG_READ_cHRM_SUPPORTED
+#define PNG_READ_gAMA_SUPPORTED
+#define PNG_READ_hIST_SUPPORTED
+#define PNG_READ_iCCP_SUPPORTED
+#define PNG_READ_iTXt_SUPPORTED
+#define PNG_READ_oFFs_SUPPORTED
+#define PNG_READ_pCAL_SUPPORTED
+#define PNG_READ_pHYs_SUPPORTED
+#define PNG_READ_sBIT_SUPPORTED
+#define PNG_READ_sCAL_SUPPORTED
+#define PNG_READ_sPLT_SUPPORTED
+#define PNG_READ_sRGB_SUPPORTED
+#define PNG_READ_tEXt_SUPPORTED
+#define PNG_READ_tIME_SUPPORTED
+#define PNG_READ_tRNS_SUPPORTED
+#define PNG_READ_zTXt_SUPPORTED
+/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
+#define PNG_SAVE_INT_32_SUPPORTED
+#define PNG_SEQUENTIAL_READ_SUPPORTED
+#define PNG_SETJMP_SUPPORTED
+#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
+#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
+/*#undef PNG_SET_OPTION_SUPPORTED*/
+#define PNG_SET_USER_LIMITS_SUPPORTED
+#define PNG_STDIO_SUPPORTED
+#define PNG_TEXT_SUPPORTED
+#define PNG_TIME_RFC1123_SUPPORTED
+#define PNG_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_USER_CHUNKS_SUPPORTED
+#define PNG_USER_LIMITS_SUPPORTED
+#define PNG_USER_MEM_SUPPORTED
+#define PNG_USER_TRANSFORM_INFO_SUPPORTED
+#define PNG_USER_TRANSFORM_PTR_SUPPORTED
+#define PNG_WARNINGS_SUPPORTED
+#define PNG_WRITE_16BIT_SUPPORTED
+#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_WRITE_BGR_SUPPORTED
+#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
+#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
+#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
+#define PNG_WRITE_FILLER_SUPPORTED
+#define PNG_WRITE_FILTER_SUPPORTED
+#define PNG_WRITE_FLUSH_SUPPORTED
+#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
+#define PNG_WRITE_INTERLACING_SUPPORTED
+#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
+#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
+#define PNG_WRITE_INVERT_SUPPORTED
+#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
+#define PNG_WRITE_PACKSWAP_SUPPORTED
+#define PNG_WRITE_PACK_SUPPORTED
+#define PNG_WRITE_SHIFT_SUPPORTED
+#define PNG_WRITE_SUPPORTED
+#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
+#define PNG_WRITE_SWAP_SUPPORTED
+#define PNG_WRITE_TEXT_SUPPORTED
+#define PNG_WRITE_TRANSFORMS_SUPPORTED
+#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
+#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
+#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
+#define PNG_WRITE_bKGD_SUPPORTED
+#define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_WRITE_gAMA_SUPPORTED
+#define PNG_WRITE_hIST_SUPPORTED
+#define PNG_WRITE_iCCP_SUPPORTED
+#define PNG_WRITE_iTXt_SUPPORTED
+#define PNG_WRITE_oFFs_SUPPORTED
+#define PNG_WRITE_pCAL_SUPPORTED
+#define PNG_WRITE_pHYs_SUPPORTED
+#define PNG_WRITE_sBIT_SUPPORTED
+#define PNG_WRITE_sCAL_SUPPORTED
+#define PNG_WRITE_sPLT_SUPPORTED
+#define PNG_WRITE_sRGB_SUPPORTED
+#define PNG_WRITE_tEXt_SUPPORTED
+#define PNG_WRITE_tIME_SUPPORTED
+#define PNG_WRITE_tRNS_SUPPORTED
+#define PNG_WRITE_zTXt_SUPPORTED
+#define PNG_bKGD_SUPPORTED
+#define PNG_cHRM_SUPPORTED
+#define PNG_gAMA_SUPPORTED
+#define PNG_hIST_SUPPORTED
+#define PNG_iCCP_SUPPORTED
+#define PNG_iTXt_SUPPORTED
+#define PNG_oFFs_SUPPORTED
+#define PNG_pCAL_SUPPORTED
+#define PNG_pHYs_SUPPORTED
+#define PNG_sBIT_SUPPORTED
+#define PNG_sCAL_SUPPORTED
+#define PNG_sPLT_SUPPORTED
+#define PNG_sRGB_SUPPORTED
+#define PNG_tEXt_SUPPORTED
+#define PNG_tIME_SUPPORTED
+#define PNG_tRNS_SUPPORTED
+#define PNG_zTXt_SUPPORTED
+/* end of options */
+/* settings */
+#define PNG_API_RULE 0
+#define PNG_CALLOC_SUPPORTED
+#define PNG_COST_SHIFT 3
+#define PNG_DEFAULT_READ_MACROS 1
+#define PNG_GAMMA_THRESHOLD_FIXED 5000
+#define PNG_MAX_GAMMA_8 11
+#define PNG_QUANTIZE_BLUE_BITS 5
+#define PNG_QUANTIZE_GREEN_BITS 5
+#define PNG_QUANTIZE_RED_BITS 5
+#define PNG_WEIGHT_SHIFT 8
+#define PNG_ZBUF_SIZE 8192
+#define PNG_sCAL_PRECISION 5
+/* end of settings */
+#endif /* PNGLCONF_H */
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,librevenge,librevenge))
+
+$(eval $(call gb_ExternalPackage_use_external_project,librevenge,librevenge))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,librevenge,$(LIBO_LIB_FOLDER)/librevenge-0.0.0.dylib,src/lib/.libs/librevenge-0.0.0.dylib))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,librevenge,$(LIBO_LIB_FOLDER)/librevenge-0.0.dll,src/lib/.libs/librevenge-0.0.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,librevenge,$(LIBO_LIB_FOLDER)/librevenge-0.0.so.0,src/lib/.libs/librevenge-0.0.so.0.0.1))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,librevenge))
+
+$(eval $(call gb_ExternalProject_use_autoconf,librevenge,build))
+
+$(eval $(call gb_ExternalProject_register_targets,librevenge,\
+ build \
+))
+
+# TODO: test for zlib is unconditional in configure by mistake. Remove on the next release.
+$(eval $(call gb_ExternalProject_use_externals,librevenge,\
+ boost_headers \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,librevenge,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-shared \
+ --disable-static \
+ --disable-debug \
+ --disable-werror \
+ --disable-weffc \
+ --disable-streams \
+ --disable-generators \
+ --without-docs \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),\
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(EXTERNAL_WORKDIR)/src/lib/.libs/librevenge-0.0.0.dylib \
+ ) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,revenge))
+
+$(eval $(call gb_Library_use_unpacked,revenge,librevenge))
+
+$(eval $(call gb_Library_use_externals,revenge,\
+ boost_headers \
+))
+
+$(eval $(call gb_Library_set_warnings_not_errors,revenge))
+
+$(eval $(call gb_Library_set_include,revenge,\
+ -I$(call gb_UnpackedTarball_get_dir,librevenge)/inc \
+ $$(INCLUDE) \
+))
+
+# -DLIBREVENGE_STREAM_BUILD is present so that linker does not complain
+# about unresolved external symbol RVNGStream::~RVNGStream
+$(eval $(call gb_Library_add_defs,revenge,\
+ -DBOOST_ALL_NO_LIB \
+ -DDLL_EXPORT \
+ -DLIBREVENGE_BUILD \
+ -DLIBREVENGE_STREAM_BUILD \
+ -DNDEBUG \
+))
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,revenge,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,revenge,\
+ UnpackedTarball/librevenge/src/lib/RVNGBinaryData \
+ UnpackedTarball/librevenge/src/lib/RVNGMemoryStream \
+ UnpackedTarball/librevenge/src/lib/RVNGProperty \
+ UnpackedTarball/librevenge/src/lib/RVNGPropertyList \
+ UnpackedTarball/librevenge/src/lib/RVNGPropertyListVector \
+ UnpackedTarball/librevenge/src/lib/RVNGString \
+ UnpackedTarball/librevenge/src/lib/RVNGStringVector \
+ UnpackedTarball/librevenge/src/lib/RVNGSVGDrawingGenerator \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,librevenge))
+
+$(eval $(call gb_Module_add_targets,librevenge,\
+ UnpackedTarball_librevenge \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,librevenge,\
+ Library_revenge \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,librevenge,\
+ ExternalPackage_librevenge \
+ ExternalProject_librevenge \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://sourceforge.net/p/libwpd/wiki/librevenge/]. A base library
+for writing document import filters. It has interfaces for text documents,
+vector graphics, spreadsheets and presentations.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,librevenge))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,librevenge,$(REVENGE_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,librevenge,1))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libvisio))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libvisio,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libvisio,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libvisio,\
+ boost_headers \
+ icu \
+ libxml2 \
+ revenge \
+ zlib \
+))
+
+$(call gb_ExternalProject_get_state_target,libvisio,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libvisio))
+
+$(eval $(call gb_Module_add_targets,libvisio,\
+ ExternalProject_libvisio \
+ UnpackedTarball_libvisio \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Libvisio is library providing ability to interpret and import visio diagrams into various applications.
+
+See also:
+[http://www.freedesktop.org/wiki/Software/libvisio]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libvisio))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libvisio,$(VISIO_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libwpd))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libwpd,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libwpd,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libwpd,\
+ revenge \
+))
+
+$(call gb_ExternalProject_get_state_target,libwpd,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ $(if $(filter MACOSX,$(OS)),--disable-werror) \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)") \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libwpd))
+
+$(eval $(call gb_Module_add_targets,libwpd,\
+ ExternalProject_libwpd \
+ UnpackedTarball_libwpd \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://libwpd.sourceforge.net/]. Not modified. WordPerfect filter - SAX api - emits callbacks when things happen.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libwpd))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libwpd,$(WPD_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libwpg))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libwpg,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libwpg,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libwpg,\
+ revenge \
+ wpd \
+))
+
+$(call gb_ExternalProject_get_state_target,libwpg,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libwpg))
+
+$(eval $(call gb_Module_add_targets,libwpg,\
+ ExternalProject_libwpg \
+ UnpackedTarball_libwpg \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://libwpg.sourceforge.net/]. WordPerfect graphics filter.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libwpg))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libwpg,$(WPG_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libwps,libwps))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libwps,libwps))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.3.3.dylib,src/lib/.libs/libwps-0.3.3.dylib))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.3.dll,src/lib/.libs/libwps-0.3.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,libwps,$(LIBO_LIB_FOLDER)/libwps-0.3.so.3,src/lib/.libs/libwps-0.3.so.3.0.0))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libwps))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libwps,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libwps,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libwps,\
+ boost_headers \
+ revenge \
+))
+
+$(call gb_ExternalProject_get_state_target,libwps,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ $(if $(DISABLE_DYNLOADING), \
+ --enable-static --disable-shared \
+ , \
+ --enable-shared --disable-static \
+ ) \
+ --without-docs \
+ --disable-tools \
+ --disable-debug \
+ --disable-werror \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost) -I$(BUILDDIR)/config_$(gb_Side))" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),\
+ && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(EXTERNAL_WORKDIR)/src/lib/.libs/libwps-0.3.3.dylib \
+ ) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,wps))
+
+$(eval $(call gb_Library_use_unpacked,wps,libwps))
+
+$(eval $(call gb_Library_use_externals,wps,\
+ boost_headers \
+ revenge \
+))
+
+$(eval $(call gb_Library_set_warnings_not_errors,wps))
+
+$(eval $(call gb_Library_set_include,wps,\
+ -I$(call gb_UnpackedTarball_get_dir,libwps)/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_defs,wps,\
+ -DBOOST_ALL_NO_LIB \
+ -DBUILD_WPS\
+ -DDLL_EXPORT \
+ -DNDEBUG \
+))
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,wps,cpp))
+
+$(eval $(call gb_Library_add_generated_exception_objects,wps,\
+ UnpackedTarball/libwps/src/lib/WKS4 \
+ UnpackedTarball/libwps/src/lib/WKS4Spreadsheet \
+ UnpackedTarball/libwps/src/lib/WKSContentListener \
+ UnpackedTarball/libwps/src/lib/WKSParser \
+ UnpackedTarball/libwps/src/lib/WKSSubDocument \
+ UnpackedTarball/libwps/src/lib/WPS4 \
+ UnpackedTarball/libwps/src/lib/WPS4Graph \
+ UnpackedTarball/libwps/src/lib/WPS4Text \
+ UnpackedTarball/libwps/src/lib/WPS8 \
+ UnpackedTarball/libwps/src/lib/WPS8Graph \
+ UnpackedTarball/libwps/src/lib/WPS8Struct \
+ UnpackedTarball/libwps/src/lib/WPS8Table \
+ UnpackedTarball/libwps/src/lib/WPS8Text \
+ UnpackedTarball/libwps/src/lib/WPS8TextStyle \
+ UnpackedTarball/libwps/src/lib/WPSCell \
+ UnpackedTarball/libwps/src/lib/WPSContentListener \
+ UnpackedTarball/libwps/src/lib/WPSDebug \
+ UnpackedTarball/libwps/src/lib/WPSDocument \
+ UnpackedTarball/libwps/src/lib/WPSFont \
+ UnpackedTarball/libwps/src/lib/WPSHeader \
+ UnpackedTarball/libwps/src/lib/WPSList \
+ UnpackedTarball/libwps/src/lib/WPSOLEParser \
+ UnpackedTarball/libwps/src/lib/WPSPageSpan \
+ UnpackedTarball/libwps/src/lib/WPSParagraph \
+ UnpackedTarball/libwps/src/lib/WPSParser \
+ UnpackedTarball/libwps/src/lib/WPSSubDocument \
+ UnpackedTarball/libwps/src/lib/WPSTable \
+ UnpackedTarball/libwps/src/lib/WPSTextParser \
+ UnpackedTarball/libwps/src/lib/WPSTextSubDocument \
+ UnpackedTarball/libwps/src/lib/libwps_internal \
+ UnpackedTarball/libwps/src/lib/libwps_tools_win \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libwps))
+
+$(eval $(call gb_Module_add_targets,libwps,\
+ UnpackedTarball_libwps \
+))
+
+ifeq ($(COM),MSC)
+
+$(eval $(call gb_Module_add_targets,libwps,\
+ Library_wps \
+))
+
+else
+
+$(eval $(call gb_Module_add_targets,libwps,\
+ ExternalPackage_libwps \
+ ExternalProject_libwps \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Microsoft Works file word processor format import library from [http://libwps.sourceforge.net/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libwps))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libwps,$(WPS_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,xml2,xml2))
+
+$(eval $(call gb_ExternalPackage_use_external_project,xml2,xml2))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,xml2,$(LIBO_URE_LIB_FOLDER)/libxml2.2.dylib,.libs/libxml2.2.dylib))
+else ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_file,xml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,.libs/libxml2.dll))
+else # COM=MSC
+$(eval $(call gb_ExternalPackage_add_file,xml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll))
+endif
+else # OS!=WNT
+$(eval $(call gb_ExternalPackage_add_file,xml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.9.1))
+endif
+endif # DISABLE_DYNLOADING
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,xml2_win32,xml2))
+
+$(eval $(call gb_ExternalPackage_use_external_project,xml2_win32,xml2))
+
+# duplicate copy next to executables due to stupid Win32 DLL search order
+# where a libxml2.dll in C:\Windows is loaded before one in URE lib dir
+# see 5a5dab5167d136c315e81448ea8eca59e60067da
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_file,xml2_win32,$(LIBO_LIB_FOLDER)/libxml2.dll,.libs/libxml2.dll))
+else # COM=MSC
+$(eval $(call gb_ExternalPackage_add_file,xml2_win32,$(LIBO_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll))
+endif
+endif # OS=WNT
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,xml2))
+
+$(eval $(call gb_ExternalProject_register_targets,xml2,\
+ build \
+))
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(call gb_ExternalProject_get_state_target,xml2,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-ipv6 --without-python --without-zlib \
+ --without-lzma \
+ --disable-static --without-debug lt_cv_cc_dll_switch="-shared" \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ LIBS="-lws2_32 $(if $(MINGW_SHARED_GXXLIB),$(MINGW_SHARED_LIBSTDCPP))" \
+ LDFLAGS="-Wl$(COMMA)--no-undefined -Wl$(COMMA)--enable-runtime-pseudo-reloc-v2" \
+ OBJDUMP=objdump \
+ && $(MAKE) \
+ )
+else # COM=MSC
+$(call gb_ExternalProject_use_external_project,xml2,icu)
+
+$(call gb_ExternalProject_get_state_target,xml2,build):
+ $(call gb_ExternalProject_run,build,\
+ cscript configure.js \
+ iconv=no icu=yes sax1=yes $(if $(MSVC_USE_DEBUG_RUNTIME),run_debug=yes cruntime=/MDd) \
+ && unset MAKEFLAGS \
+ && LIB="$(ILIB)" nmake \
+ ,win32)
+endif
+else # OS!=WNT
+$(call gb_ExternalProject_get_state_target,xml2,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-ipv6 --without-python --without-zlib --with-sax1 \
+ --without-lzma \
+ $(if $(debug),--with-run-debug) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________URELIB) \
+ LDFLAGS="$(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \
+ CFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(if $(debug),-g)" \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
+ && $(MAKE) \
+ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libxml2))
+
+$(eval $(call gb_Module_add_targets,libxml2,\
+ ExternalPackage_xml2 \
+ ExternalPackage_xml2_win32 \
+ ExternalProject_xml2 \
+ UnpackedTarball_xml2 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Gnome xml parser library written in C, from [http://xmlsoft.org/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,xml2))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,xml2,$(LIBXML_TARBALL),,libxml2))
+
+$(eval $(call gb_UnpackedTarball_add_patches,xml2,\
+ external/libxml2/libxml2-config.patch.1 \
+ external/libxml2/libxml2-freebsd.patch.1 \
+ external/libxml2/libxml2-global-symbols.patch \
+ external/libxml2/libxml2-vc10.patch \
+ $(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \
+ external/libxml2/libxml2-icu.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/libxml2-2.7.6/ltmain.sh
++++ misc/build/libxml2-2.7.6/ltmain.sh
+@@ -3228,6 +3228,12 @@
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
++ # Force no versioning suffix for Android thanks to silly
++ # apkbuilder which doesn't add extra native libs unless their
++ # name ends with .so
++
++ version_type=none
++
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+--- misc/libxml2-2.7.6/trionan.c
++++ misc/build/libxml2-2.7.6/trionan.c
+@@ -327,7 +327,7 @@
+
+ if (result == 0.0) {
+
+-#if defined(TRIO_COMPILER_SUPPORTS_C99)
++#if defined(TRIO_COMPILER_SUPPORTS_C99) && !(defined(__ANDROID__) && defined(__clang__))
+ result = nan("");
+
+ #elif defined(NAN) && defined(__STDC_IEC_559__)
+
+--- misc/libxml2-2.7.6/Makefile.in
++++ misc/build/libxml2-2.7.6/Makefile.in
+@@ -1635,7 +1635,7 @@
+ check-am: all-am
+ check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \
++all-am: Makefile $(LTLIBRARIES) \
+ config.h
+ install-binPROGRAMS: install-libLTLIBRARIES
+
--- /dev/null
+Hack the xml2-config to return paths into WORKDIR.
+
+--- a/xml2-config.in 2009-12-17 11:45:20.000000000 +0000
++++ b/xml2-config.in 2009-12-17 11:45:36.000000000 +0000
+@@ -1,9 +1,14 @@
+ #! /bin/sh
+
+-prefix=@prefix@
+-exec_prefix=@exec_prefix@
+-includedir=@includedir@
+-libdir=@libdir@
++#prefix=@prefix@
++#exec_prefix=@exec_prefix@
++#includedir=@includedir@
++#libdir=@libdir@
++
++prefix=${WORKDIR}/UnpackedTarball/xml2
++exec_prefix=${WORKDIR}/UnpackedTarball/xml2
++includedir=${WORKDIR}/UnpackedTarball/xml2/include
++libdir=${WORKDIR}/UnpackedTarball/xml2/.libs
+
+ usage()
+ {
+@@ -67,7 +72,8 @@
+ ;;
+
+ --cflags)
+- echo @XML_INCLUDEDIR@ @XML_CFLAGS@
++ echo -I${includedir}
++# echo @XML_INCLUDEDIR@ @XML_CFLAGS@
+ ;;
+
+ --libtool-libs)
+@@ -82,19 +88,24 @@
+ ;;
+
+ --libs)
+- if [ "`uname`" = "Linux" ]
+- then
+- if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ]
+- then
+- echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@
+- else
+- echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@
+- fi
+- else
+- echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@
+- fi
++ echo -L${libdir} -lxml2 -lm
++# if [ "`uname`" = "Linux" ]
++# then
++# if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ]
++# then
++# echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@
++# else
++# echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@
++# fi
++# else
++# echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ @WIN32_EXTRA_LIBADD@
++# fi
+ ;;
+
++ print) # ugly configure hack
++ exit 0
++ ;;
++
+ *)
+ usage
+ exit 1
--- /dev/null
+Usual patch to produce Linux-like .so files on FreeBSD
+
+--- a/ltmain.sh 2009-10-06 17:39:54.000000000 +0100
++++ b/ltmain.sh 2009-12-17 11:43:56.000000000 +0000
+@@ -6271,8 +6271,8 @@
+ ;;
+
+ freebsd-elf)
+- major=".$current"
+- versuffix=".$current"
++ major=.`expr $current - $age`
++ versuffix=".$major.$age.$revision";
+ ;;
+
+ irix | nonstopux)
--- /dev/null
+--- misc/libxml2-2.7.6/libxml2.syms Tue Oct 6 18:31:35 2009
++++ misc/build/libxml2-2.7.6/libxml2.syms Wed Jul 7 15:43:17 2010
+@@ -2184,10 +2184,10 @@
+ } LIBXML2_2.6.27;
+
+ LIBXML2_2.6.29 {
+- global:
++# global:
+
+ # threads
+- xmlDllMain;
++#WIN32 only! xmlDllMain;
+ } LIBXML2_2.6.28;
+
+ LIBXML2_2.6.32 {
+@@ -2231,3 +2231,43 @@
+ xmlXPathSetContextNode;
+ } LIBXML2_2.9.0;
+
++# HACK: export global variable accessor functions (globals.h)
++LIBXML2_GLOBAL_VARIABLES {
++ global:
++# __xmlMalloc;
++# __xmlMallocAtomic;
++# __xmlRealloc;
++# __xmlFree;
++# __xmlMemStrdup;
++ __docbDefaultSAXHandler;
++ __htmlDefaultSAXHandler;
++ __xmlLastError;
++ __oldXMLWDcompatibility;
++ __xmlBufferAllocScheme;
++ __xmlDefaultBufferSize;
++ __xmlDefaultSAXHandler;
++ __xmlDefaultSAXLocator;
++ __xmlDoValidityCheckingDefaultValue;
++ __xmlGenericError;
++ __xmlStructuredError;
++ __xmlGenericErrorContext;
++ __xmlStructuredErrorContext;
++ __xmlGetWarningsDefaultValue;
++ __xmlIndentTreeOutput;
++ __xmlTreeIndentString;
++ __xmlKeepBlanksDefaultValue;
++ __xmlLineNumbersDefaultValue;
++ __xmlLoadExtDtdDefaultValue;
++ __xmlParserDebugEntities;
++ __xmlParserVersion;
++ __xmlPedanticParserDefaultValue;
++ __xmlSaveNoEmptyTags;
++ __xmlSubstituteEntitiesDefaultValue;
++ __xmlRegisterNodeDefaultValue;
++ __xmlDeregisterNodeDefaultValue;
++ __xmlParserInputBufferCreateFilenameValue;
++ __xmlOutputBufferCreateFilenameValue;
++# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local")
++ local:
++ *;
++} LIBXML2_2.7.4;
--- /dev/null
+diff -up win32/Makefile.msvc.dt win32/Makefile.msvc
+--- win32/Makefile.msvc.dt 2014-07-18 19:00:23.372103963 +0200
++++ win32/Makefile.msvc 2014-07-18 19:01:39.347982929 +0200
+@@ -45,6 +45,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
+ CC = cl.exe
+ CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_CONFIG_H" /D "NOLIBTOOL" /W1 $(CRUNTIME)
+ CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
++CFLAGS = $(CFLAGS) /I$(WORKDIR)/UnpackedTarball/icu/source/i18n /I$(WORKDIR)/UnpackedTarball/icu/source/common
+ !if "$(WITH_THREADS)" != "no"
+ CFLAGS = $(CFLAGS) /D "_REENTRANT"
+ !endif
+@@ -67,6 +68,7 @@ CFLAGS = $(CFLAGS) $(SOLARINC)
+ # The linker and its options.
+ LD = link.exe
+ LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
++LDFLAGS = $(LDFLAGS) /LIBPATH:$(WORKDIR)/UnpackedTarball/icu/source/lib
+ LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
+ LIBS =
+ !if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
+@@ -78,7 +78,11 @@ LIBS = $(LIBS) wsock32.lib ws2_32.lib
+ LIBS = $(LIBS) iconv.lib
+ !endif
+ !if "$(WITH_ICU)" == "1"
+-LIBS = $(LIBS) icu.lib
++!if "$(WITH_RUN_DEBUG)" == "1"
++LIBS = $(LIBS) icuind.lib icuucd.lib icudtd.lib
++!else
++LIBS = $(LIBS) icuin.lib icuuc.lib icudt.lib
++!endif
+ !endif
+ !if "$(WITH_ZLIB)" == "1"
+ # could be named differently zdll or zlib
--- /dev/null
+--- build/libxml2-2.7.6/win32/Makefile.msvc.old 2010-09-20 20:22:41.500000000 +0200
++++ build/libxml2-2.7.6/win32/Makefile.msvc 2010-09-20 20:23:00.250000000 +0200
+@@ -59,6 +59,7 @@
+ CFLAGS = $(CFLAGS) /D "HAVE_LZMA_H"
+ !endif
+ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
++CFLAGS = $(CFLAGS) $(SOLARINC)
+
+ # The linker and its options.
+ LD = link.exe
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,xmlsec,xmlsec))
+
+$(eval $(call gb_ExternalPackage_use_external_project,xmlsec,xmlsec))
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_file,xmlsec,$(LIBO_LIB_FOLDER)/libxmlsec1.dll,src/.libs/libxmlsec1.dll))
+$(eval $(call gb_ExternalPackage_add_file,xmlsec,$(LIBO_LIB_FOLDER)/libxmlsec1-nss.dll,src/nss/.libs/libxmlsec1-nss.dll))
+else
+$(eval $(call gb_ExternalPackage_add_file,xmlsec,$(LIBO_LIB_FOLDER)/libxmlsec-mscrypto.dll,win32/binaries/libxmlsec-mscrypto.dll))
+$(eval $(call gb_ExternalPackage_add_file,xmlsec,$(LIBO_LIB_FOLDER)/libxmlsec.dll,win32/binaries/libxmlsec.dll))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,xmlsec))
+
+$(eval $(call gb_ExternalProject_use_external,xmlsec,libxml2))
+
+$(eval $(call gb_ExternalProject_use_external,xmlsec,nss3))
+
+$(eval $(call gb_ExternalProject_use_external,xmlsec,openssl))
+
+$(eval $(call gb_ExternalProject_register_targets,xmlsec,\
+ build \
+))
+
+ifeq ($(OS),WNT)
+
+ifeq ($(COM),GCC)
+$(call gb_ExternalProject_get_state_target,xmlsec,build) :
+ $(call gb_ExternalProject_run,build,\
+ autoreconf \
+ && ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ --without-libxslt --without-openssl --without-gnutls --disable-crypto-dl \
+ $(if $(SYSTEM_NSS),,--disable-pkgconfig) \
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ LDFLAGS="-Wl$(COMMA)--no-undefined $(ILIB:;= -L)" \
+ LIBS="$(if $(MINGW_SHARED_GXXLIB),$(MINGW_SHARED__LIBSTDCPP))" \
+ lt_cv_deplibs_check_method=pass_all \
+ && $(MAKE) \
+ )
+
+else
+$(call gb_ExternalProject_get_state_target,xmlsec,build) :
+ $(call gb_ExternalProject_run,build,\
+ cscript configure.js crypto=mscrypto xslt=no iconv=no static=no \
+ lib=$(call gb_UnpackedTarball_get_dir,xml2)/win32/bin.msvc \
+ $(if $(filter TRUE,$(ENABLE_DBGUTIL)),debug=yes) \
+ && unset MAKEFLAGS \
+ && LIB="$(ILIB)" nmake \
+ ,win32)
+endif
+
+else
+
+$(call gb_ExternalProject_get_state_target,xmlsec,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(if $(filter MACOSX,$(OS)),ACLOCAL="aclocal -I $(SRCDIR)/m4/mac") \
+ $(if $(filter AIX,$(OS)),ACLOCAL="aclocal -I /opt/freeware/share/aclocal") \
+ autoreconf \
+ && ./configure \
+ --with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls \
+ $(if $(or $(filter-out ANDROID,$(OS)),$(DISABLE_OPENSSL)),--without-openssl,--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ $(if $(SYSTEM_NSS),,$(if $(filter MACOSX,$(OS)),--disable-pkgconfig)) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(SYSBASE),CFLAGS="-I$(SYSBASE)/usr/include" \
+ LDFLAGS="-L$(SYSBASE)/usr/lib $(if $(filter-out LINUX FREEBSD,$(OS)),,-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib)) \
+ && $(MAKE) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libxmlsec))
+
+ifneq ($(filter-out ANDROID IOS,$(OS)),)
+$(eval $(call gb_Module_add_targets,libxmlsec,\
+ UnpackedTarball_xmlsec \
+ ExternalPackage_xmlsec \
+ ExternalProject_xmlsec \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+XML signing, etc. From [http://www.aleksey.com/xmlsec/]. Heavily patched.
+
+The XML Security library has been modified, so that there is NO verification of
+the certificate during sign or verification operation. On Windows this was done
+in the function xmlSecMSCryptoX509StoreVerify (file src/mscrypto/x509vfy.c) and
+on UNIX in xmlSecNssX509StoreVerify (file src/nss/x509vfy.c).
+
+The implementation creates certificates from all of the X509Data children, such
+as X509IssuerSerial and X509Certificate and stores them in a certificate store
+(see xmlsec/src/mscrypto/x509.c:xmlSecMSCryptoX509DataNodeRead). It must then
+find the certificate containing the public key which is used for validation
+within that store. This is done in xmlSecMSCryptoX509StoreVerify. This function
+however only takes those certificates into account which can be validated. This
+was changed by the patch xmlsec1-noverify.patch, which prevents this certificate
+validation.
+
+xmlSecMSCryptoX509StoreVerify iterates over all certificates contained or
+referenced in the X509Data elements and selects one which is no issuer of any of
+the other certificates. This certificate is not necessarily the one which was
+used for signing but it must contain the proper validation key, which is
+sufficient to validate the signature. See
+http://www.w3.org/TR/xmldsig-core/#sec-X509Data
+for details.
+
+There is a flag XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS that can be set
+in a xmlSecKeyInfoCtx (see function xmlSecNssKeyDataX509XmlRead, in file
+src/nss/x509.c), which indicates that one can turn off the validation. However,
+setting it will cause that the validation key is not found. If the flag is set,
+then the key is not extracted from the certificate store which contains all the
+certificates of the X509Data elements. In other words, the certificates which
+are delivered within the XML signature are not used when looking for suitable
+validation key.
+
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,xmlsec,$(LIBXMLSEC_TARBALL),,libxmlsec))
+
+$(eval $(call gb_UnpackedTarball_add_patches,xmlsec,\
+ external/libxmlsec/xmlsec1-configure.patch \
+ external/libxmlsec/xmlsec1-configure-libxml-libxslt.patch \
+ external/libxmlsec/xmlsec1-olderlibxml2.patch \
+ external/libxmlsec/xmlsec1-oldlibtool.patch \
+ external/libxmlsec/xmlsec1-nssdisablecallbacks.patch \
+ external/libxmlsec/xmlsec1-nssmangleciphers.patch \
+ external/libxmlsec/xmlsec1-noverify.patch \
+ external/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch \
+ external/libxmlsec/xmlsec1-vc.patch \
+ external/libxmlsec/xmlsec1-1.2.14_fix_extern_c.patch \
+ external/libxmlsec/xmlsec1-android.patch \
+ external/libxmlsec/xmlsec1-1.2.14-ansi.patch \
+ external/libxmlsec/xmlsec1-customkeymanage.patch \
+ external/libxmlsec/xmlsec1-update-config.guess.patch.1 \
+))
+
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,include/xmlsec/mscrypto/akmngr.h,external/libxmlsec/include/akmngr_mscrypto.h))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,src/mscrypto/akmngr.c,external/libxmlsec/src/akmngr_mscrypto.c))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,include/xmlsec/nss/akmngr.h,external/libxmlsec/include/akmngr_nss.h))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,include/xmlsec/nss/ciphers.h,external/libxmlsec/include/ciphers.h))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,include/xmlsec/nss/tokens.h,external/libxmlsec/include/tokens.h))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,src/nss/akmngr.c,external/libxmlsec/src/akmngr_nss.c))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,src/nss/keywrapers.c,external/libxmlsec/src/keywrapers.c))
+$(eval $(call gb_UnpackedTarball_add_file,xmlsec,src/nss/tokens.c,external/libxmlsec/src/tokens.c))
+
+ifeq ($(OS)$(COM),WNTGCC)
+$(eval $(call gb_UnpackedTarball_add_patches,xmlsec,\
+ external/libxmlsec/xmlsec1-mingw32.patch \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright ..........................
+ */
+#ifndef __XMLSEC_MSCRYPTO_AKMNGR_H__
+#define __XMLSEC_MSCRYPTO_AKMNGR_H__
+
+#include <windows.h>
+#include <wincrypt.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/transforms.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+XMLSEC_CRYPTO_EXPORT xmlSecKeysMngrPtr
+xmlSecMSCryptoAppliedKeysMngrCreate(
+ HCERTSTORE keyStore ,
+ HCERTSTORE certStore
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecMSCryptoAppliedKeysMngrSymKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ HCRYPTKEY symKey
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecMSCryptoAppliedKeysMngrPubKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ HCRYPTKEY pubKey
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecMSCryptoAppliedKeysMngrPriKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ HCRYPTKEY priKey
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore (
+ xmlSecKeysMngrPtr mngr ,
+ HCERTSTORE keyStore
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore (
+ xmlSecKeysMngrPtr mngr ,
+ HCERTSTORE trustedStore
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore (
+ xmlSecKeysMngrPtr mngr ,
+ HCERTSTORE untrustedStore
+) ;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __XMLSEC_MSCRYPTO_AKMNGR_H__ */
+
+
+
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright ..........................
+ */
+#ifndef __XMLSEC_NSS_AKMNGR_H__
+#define __XMLSEC_NSS_AKMNGR_H__
+
+#include <nss.h>
+#include <nspr.h>
+#include <pk11func.h>
+#include <cert.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/transforms.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+XMLSEC_CRYPTO_EXPORT xmlSecKeysMngrPtr
+xmlSecNssAppliedKeysMngrCreate(
+ PK11SlotInfo** slots,
+ int cSlots,
+ CERTCertDBHandle* handler
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssAppliedKeysMngrSymKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ PK11SymKey* symKey
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssAppliedKeysMngrPubKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ SECKEYPublicKey* pubKey
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssAppliedKeysMngrPriKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ SECKEYPrivateKey* priKey
+) ;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __XMLSEC_NSS_AKMNGR_H__ */
+
+
+
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright ..........................
+ */
+#ifndef __XMLSEC_NSS_CIPHERS_H__
+#define __XMLSEC_NSS_CIPHERS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/transforms.h>
+
+
+XMLSEC_CRYPTO_EXPORT int xmlSecNssSymKeyDataAdoptKey( xmlSecKeyDataPtr data,
+ PK11SymKey* symkey ) ;
+
+XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssSymKeyDataKeyAdopt( PK11SymKey* symKey ) ;
+
+XMLSEC_CRYPTO_EXPORT PK11SymKey* xmlSecNssSymKeyDataGetKey(xmlSecKeyDataPtr data);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __XMLSEC_NSS_CIPHERS_H__ */
+
+
+
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright (c) 2003 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Contributor(s): _____________________________
+ *
+ */
+#ifndef __XMLSEC_NSS_TOKENS_H__
+#define __XMLSEC_NSS_TOKENS_H__
+
+#include <string.h>
+
+#include <nss.h>
+#include <pk11func.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/list.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * xmlSecNssKeySlotListId
+ *
+ * The crypto mechanism list klass
+ */
+#define xmlSecNssKeySlotListId xmlSecNssKeySlotListGetKlass()
+XMLSEC_CRYPTO_EXPORT xmlSecPtrListId xmlSecNssKeySlotListGetKlass( void ) ;
+
+/*******************************************
+ * KeySlot interfaces
+ *******************************************/
+/**
+ * Internal NSS key slot data
+ * @mechanismList: the mechanisms that the slot bound with.
+ * @slot: the pkcs slot
+ *
+ * This context is located after xmlSecPtrList
+ */
+typedef struct _xmlSecNssKeySlot xmlSecNssKeySlot ;
+typedef struct _xmlSecNssKeySlot* xmlSecNssKeySlotPtr ;
+
+struct _xmlSecNssKeySlot {
+ CK_MECHANISM_TYPE_PTR mechanismList ; /* mech. array, NULL ternimated */
+ PK11SlotInfo* slot ;
+} ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotSetMechList(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE_PTR mechanismList
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotEnableMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE mechanism
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotDisableMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE mechanism
+) ;
+
+XMLSEC_CRYPTO_EXPORT CK_MECHANISM_TYPE_PTR
+xmlSecNssKeySlotGetMechList(
+ xmlSecNssKeySlotPtr keySlot
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotSetSlot(
+ xmlSecNssKeySlotPtr keySlot ,
+ PK11SlotInfo* slot
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotInitialize(
+ xmlSecNssKeySlotPtr keySlot ,
+ PK11SlotInfo* slot
+) ;
+
+XMLSEC_CRYPTO_EXPORT void
+xmlSecNssKeySlotFinalize(
+ xmlSecNssKeySlotPtr keySlot
+) ;
+
+XMLSEC_CRYPTO_EXPORT PK11SlotInfo*
+xmlSecNssKeySlotGetSlot(
+ xmlSecNssKeySlotPtr keySlot
+) ;
+
+XMLSEC_CRYPTO_EXPORT xmlSecNssKeySlotPtr
+xmlSecNssKeySlotCreate() ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotCopy(
+ xmlSecNssKeySlotPtr newKeySlot ,
+ xmlSecNssKeySlotPtr keySlot
+) ;
+
+XMLSEC_CRYPTO_EXPORT xmlSecNssKeySlotPtr
+xmlSecNssKeySlotDuplicate(
+ xmlSecNssKeySlotPtr keySlot
+) ;
+
+XMLSEC_CRYPTO_EXPORT void
+xmlSecNssKeySlotDestroy(
+ xmlSecNssKeySlotPtr keySlot
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotBindMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE type
+) ;
+
+XMLSEC_CRYPTO_EXPORT int
+xmlSecNssKeySlotSupportMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE type
+) ;
+
+
+/************************************************************************
+ * PKCS#11 crypto token interfaces
+ *
+ * A PKCS#11 slot repository will be defined internally. From the
+ * repository, a user can specify a particular slot for a certain crypto
+ * mechanism.
+ *
+ * In some situation, some cryptographic operation should act in a user
+ * designated devices. The interfaces defined here provide the way. If
+ * the user do not initialize the repository distinctly, the interfaces
+ * use the default functions provided by NSS itself.
+ *
+ ************************************************************************/
+/**
+ * Initialize NSS pkcs#11 slot repository
+ *
+ * Returns 0 if success or -1 if an error occurs.
+ */
+XMLSEC_CRYPTO_EXPORT int xmlSecNssSlotInitialize( void ) ;
+
+/**
+ * Shutdown and destroy NSS pkcs#11 slot repository
+ */
+XMLSEC_CRYPTO_EXPORT void xmlSecNssSlotShutdown() ;
+
+/**
+ * Get PKCS#11 slot handler
+ * @type the mechanism that the slot must support.
+ *
+ * Returns a pointer to PKCS#11 slot or NULL if an error occurs.
+ *
+ * Notes: The returned handler must be destroied distinctly.
+ */
+XMLSEC_CRYPTO_EXPORT PK11SlotInfo* xmlSecNssSlotGet( CK_MECHANISM_TYPE type ) ;
+
+/**
+ * Adopt a pkcs#11 slot with a mechanism into the repository
+ * @slot: the pkcs#11 slot.
+ * @mech: the mechanism.
+ *
+ * If @mech is available( @mech != CKM_INVALID_MECHANISM ), every operation with
+ * this mechanism only can perform on the @slot.
+ *
+ * Returns 0 if success or -1 if an error occurs.
+ */
+XMLSEC_CRYPTO_EXPORT int xmlSecNssSlotAdopt( PK11SlotInfo* slot, CK_MECHANISM_TYPE mech ) ;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __XMLSEC_NSS_TOKENS_H__ */
+
+
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright.........................
+ */
+#include "globals.h"
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/keysmngr.h>
+#include <xmlsec/transforms.h>
+#include <xmlsec/errors.h>
+
+#include <xmlsec/mscrypto/crypto.h>
+#include <xmlsec/mscrypto/keysstore.h>
+#include <xmlsec/mscrypto/akmngr.h>
+#include <xmlsec/mscrypto/x509.h>
+
+/**
+ * xmlSecMSCryptoAppliedKeysMngrCreate:
+ * @hKeyStore: the pointer to key store.
+ * @hCertStore: the pointer to certificate database.
+ *
+ * Create and load key store and certificate database into keys manager
+ *
+ * Returns keys manager pointer on success or NULL otherwise.
+ */
+xmlSecKeysMngrPtr
+xmlSecMSCryptoAppliedKeysMngrCreate(
+ HCERTSTORE hKeyStore ,
+ HCERTSTORE hCertStore
+) {
+ xmlSecKeyDataStorePtr certStore = NULL ;
+ xmlSecKeysMngrPtr keyMngr = NULL ;
+ xmlSecKeyStorePtr keyStore = NULL ;
+
+ keyStore = xmlSecKeyStoreCreate( xmlSecMSCryptoKeysStoreId ) ;
+ if( keyStore == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeyStoreCreate" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return NULL ;
+ }
+
+ /*-
+ * At present, MS Crypto engine do not provide a way to setup a key store.
+ */
+ if( keyStore != NULL ) {
+ /*TODO: binding key store.*/
+ }
+
+ keyMngr = xmlSecKeysMngrCreate() ;
+ if( keyMngr == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrCreate" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ return NULL ;
+ }
+
+ /*-
+ * Add key store to manager, from now on keys manager destroys the store if
+ * needed
+ */
+ if( xmlSecKeysMngrAdoptKeysStore( keyMngr, keyStore ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecKeysMngrAdoptKeyStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ xmlSecKeysMngrDestroy( keyMngr ) ;
+ return NULL ;
+ }
+
+ /*-
+ * Initialize crypto library specific data in keys manager
+ */
+ if( xmlSecMSCryptoKeysMngrInit( keyMngr ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecMSCryptoKeysMngrInit" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeysMngrDestroy( keyMngr ) ;
+ return NULL ;
+ }
+
+ /*-
+ * Set certificate databse to X509 key data store
+ */
+ /*-
+ * At present, MS Crypto engine do not provide a way to setup a cert store.
+ */
+
+ /*-
+ * Set the getKey callback
+ */
+ keyMngr->getKey = xmlSecKeysMngrGetKey ;
+
+ return keyMngr ;
+}
+
+int
+xmlSecMSCryptoAppliedKeysMngrSymKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ HCRYPTKEY symKey
+) {
+ /*TODO: import the key into keys manager.*/
+ return(0) ;
+}
+
+int
+xmlSecMSCryptoAppliedKeysMngrPubKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ HCRYPTKEY pubKey
+) {
+ /*TODO: import the key into keys manager.*/
+ return(0) ;
+}
+
+int
+xmlSecMSCryptoAppliedKeysMngrPriKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ HCRYPTKEY priKey
+) {
+ /*TODO: import the key into keys manager.*/
+ return(0) ;
+}
+
+int
+xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore (
+ xmlSecKeysMngrPtr mngr ,
+ HCERTSTORE keyStore
+) {
+ xmlSecKeyDataStorePtr x509Store ;
+
+ xmlSecAssert2( mngr != NULL, -1 ) ;
+ xmlSecAssert2( keyStore != NULL, -1 ) ;
+
+ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ;
+ if( x509Store == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrGetDataStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 ) ;
+ }
+
+ if( xmlSecMSCryptoX509StoreAdoptKeyStore( x509Store, keyStore ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) ,
+ "xmlSecMSCryptoX509StoreAdoptKeyStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 ) ;
+ }
+
+ return( 0 ) ;
+}
+
+int
+xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore (
+ xmlSecKeysMngrPtr mngr ,
+ HCERTSTORE trustedStore
+) {
+ xmlSecKeyDataStorePtr x509Store ;
+
+ xmlSecAssert2( mngr != NULL, -1 ) ;
+ xmlSecAssert2( trustedStore != NULL, -1 ) ;
+
+ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ;
+ if( x509Store == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrGetDataStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 ) ;
+ }
+
+ if( xmlSecMSCryptoX509StoreAdoptTrustedStore( x509Store, trustedStore ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) ,
+ "xmlSecMSCryptoX509StoreAdoptKeyStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 ) ;
+ }
+
+ return( 0 ) ;
+}
+
+int
+xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore (
+ xmlSecKeysMngrPtr mngr ,
+ HCERTSTORE untrustedStore
+) {
+ xmlSecKeyDataStorePtr x509Store ;
+
+ xmlSecAssert2( mngr != NULL, -1 ) ;
+ xmlSecAssert2( untrustedStore != NULL, -1 ) ;
+
+ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ;
+ if( x509Store == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrGetDataStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 ) ;
+ }
+
+ if( xmlSecMSCryptoX509StoreAdoptUntrustedStore( x509Store, untrustedStore ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) ,
+ "xmlSecMSCryptoX509StoreAdoptKeyStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 ) ;
+ }
+
+ return( 0 ) ;
+}
+
+
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright.........................
+ */
+#include "globals.h"
+
+#include <nspr.h>
+#include <nss.h>
+#include <pk11func.h>
+#include <cert.h>
+#include <keyhi.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/transforms.h>
+#include <xmlsec/errors.h>
+
+#include <xmlsec/nss/crypto.h>
+#include <xmlsec/nss/tokens.h>
+#include <xmlsec/nss/akmngr.h>
+#include <xmlsec/nss/pkikeys.h>
+#include <xmlsec/nss/ciphers.h>
+#include <xmlsec/nss/keysstore.h>
+
+/**
+ * xmlSecNssAppliedKeysMngrCreate:
+ * @slot: array of pointers to NSS PKCS#11 slot information.
+ * @cSlots: number of slots in the array
+ * @handler: the pointer to NSS certificate database.
+ *
+ * Create and load NSS crypto slot and certificate database into keys manager
+ *
+ * Returns keys manager pointer on success or NULL otherwise.
+ */
+xmlSecKeysMngrPtr
+xmlSecNssAppliedKeysMngrCreate(
+ PK11SlotInfo** slots,
+ int cSlots,
+ CERTCertDBHandle* handler
+) {
+ xmlSecKeyDataStorePtr certStore = NULL ;
+ xmlSecKeysMngrPtr keyMngr = NULL ;
+ xmlSecKeyStorePtr keyStore = NULL ;
+ int islot = 0;
+ keyStore = xmlSecKeyStoreCreate( xmlSecNssKeysStoreId ) ;
+ if( keyStore == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeyStoreCreate" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return NULL ;
+ }
+
+ for (islot = 0; islot < cSlots; islot++)
+ {
+ xmlSecNssKeySlotPtr keySlot ;
+
+ /* Create a key slot */
+ keySlot = xmlSecNssKeySlotCreate() ;
+ if( keySlot == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecNssKeySlotCreate" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ return NULL ;
+ }
+
+ /* Set slot */
+ if( xmlSecNssKeySlotSetSlot( keySlot , slots[islot] ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecNssKeySlotSetSlot" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ xmlSecNssKeySlotDestroy( keySlot ) ;
+ return NULL ;
+ }
+
+ /* Adopt keySlot */
+ if( xmlSecNssKeysStoreAdoptKeySlot( keyStore , keySlot ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecNssKeysStoreAdoptKeySlot" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ xmlSecNssKeySlotDestroy( keySlot ) ;
+ return NULL ;
+ }
+ }
+
+ keyMngr = xmlSecKeysMngrCreate() ;
+ if( keyMngr == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrCreate" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ return NULL ;
+ }
+
+ /*-
+ * Add key store to manager, from now on keys manager destroys the store if
+ * needed
+ */
+ if( xmlSecKeysMngrAdoptKeysStore( keyMngr, keyStore ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecKeysMngrAdoptKeyStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeyStoreDestroy( keyStore ) ;
+ xmlSecKeysMngrDestroy( keyMngr ) ;
+ return NULL ;
+ }
+
+ /*-
+ * Initialize crypto library specific data in keys manager
+ */
+ if( xmlSecNssKeysMngrInit( keyMngr ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrCreate" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeysMngrDestroy( keyMngr ) ;
+ return NULL ;
+ }
+
+ /*-
+ * Set certificate databse to X509 key data store
+ */
+ /**
+ * Because Tej's implementation of certDB use the default DB, so I ignore
+ * the certDB handler at present. I'll modify the cert store sources to
+ * accept particular certDB instead of default ones.
+ certStore = xmlSecKeysMngrGetDataStore( keyMngr , xmlSecNssKeyDataStoreX509Id ) ;
+ if( certStore == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecKeysMngrGetDataStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeysMngrDestroy( keyMngr ) ;
+ return NULL ;
+ }
+
+ if( xmlSecNssKeyDataStoreX509SetCertDb( certStore , handler ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) ,
+ "xmlSecNssKeyDataStoreX509SetCertDb" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+
+ xmlSecKeysMngrDestroy( keyMngr ) ;
+ return NULL ;
+ }
+ */
+
+ /*-
+ * Set the getKey callback
+ */
+ keyMngr->getKey = xmlSecKeysMngrGetKey ;
+
+ return keyMngr ;
+}
+
+int
+xmlSecNssAppliedKeysMngrSymKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ PK11SymKey* symKey
+) {
+ xmlSecKeyPtr key ;
+ xmlSecKeyDataPtr data ;
+ xmlSecKeyStorePtr keyStore ;
+
+ xmlSecAssert2( mngr != NULL , -1 ) ;
+ xmlSecAssert2( symKey != NULL , -1 ) ;
+
+ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ;
+ if( keyStore == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrGetKeysStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1) ;
+ }
+ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ;
+
+ data = xmlSecNssSymKeyDataKeyAdopt( symKey ) ;
+ if( data == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1) ;
+ }
+
+ key = xmlSecKeyCreate() ;
+ if( key == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDataDestroy( data ) ;
+ return(-1) ;
+ }
+
+ if( xmlSecKeySetValue( key , data ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDataDestroy( data ) ;
+ return(-1) ;
+ }
+
+ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDestroy( key ) ;
+ return(-1) ;
+ }
+
+ return(0) ;
+}
+
+int
+xmlSecNssAppliedKeysMngrPubKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ SECKEYPublicKey* pubKey
+) {
+ xmlSecKeyPtr key ;
+ xmlSecKeyDataPtr data ;
+ xmlSecKeyStorePtr keyStore ;
+
+ xmlSecAssert2( mngr != NULL , -1 ) ;
+ xmlSecAssert2( pubKey != NULL , -1 ) ;
+
+ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ;
+ if( keyStore == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrGetKeysStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1) ;
+ }
+ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ;
+
+ data = xmlSecNssPKIAdoptKey( NULL, pubKey ) ;
+ if( data == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssPKIAdoptKey" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1) ;
+ }
+
+ key = xmlSecKeyCreate() ;
+ if( key == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDataDestroy( data ) ;
+ return(-1) ;
+ }
+
+ if( xmlSecKeySetValue( key , data ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDataDestroy( data ) ;
+ return(-1) ;
+ }
+
+ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDestroy( key ) ;
+ return(-1) ;
+ }
+
+ return(0) ;
+}
+
+int
+xmlSecNssAppliedKeysMngrPriKeyLoad(
+ xmlSecKeysMngrPtr mngr ,
+ SECKEYPrivateKey* priKey
+) {
+ xmlSecKeyPtr key ;
+ xmlSecKeyDataPtr data ;
+ xmlSecKeyStorePtr keyStore ;
+
+ xmlSecAssert2( mngr != NULL , -1 ) ;
+ xmlSecAssert2( priKey != NULL , -1 ) ;
+
+ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ;
+ if( keyStore == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecKeysMngrGetKeysStore" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1) ;
+ }
+ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ;
+
+ data = xmlSecNssPKIAdoptKey( priKey, NULL ) ;
+ if( data == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssPKIAdoptKey" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1) ;
+ }
+
+ key = xmlSecKeyCreate() ;
+ if( key == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDataDestroy( data ) ;
+ return(-1) ;
+ }
+
+ if( xmlSecKeySetValue( key , data ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDataDestroy( data ) ;
+ return(-1) ;
+ }
+
+ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssSymKeyDataKeyAdopt" ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecKeyDestroy( key ) ;
+ return(-1) ;
+ }
+
+ return(0) ;
+}
+
--- /dev/null
+/**
+ *
+ * XMLSec library
+ *
+ * AES Algorithm support
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright .................................
+ */
+#include "globals.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <nss.h>
+#include <pk11func.h>
+#include <hasht.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/xmltree.h>
+#include <xmlsec/keys.h>
+#include <xmlsec/transforms.h>
+#include <xmlsec/errors.h>
+
+#include <xmlsec/nss/crypto.h>
+#include <xmlsec/nss/ciphers.h>
+
+#define XMLSEC_NSS_AES128_KEY_SIZE 16
+#define XMLSEC_NSS_AES192_KEY_SIZE 24
+#define XMLSEC_NSS_AES256_KEY_SIZE 32
+#define XMLSEC_NSS_DES3_KEY_SIZE 24
+#define XMLSEC_NSS_DES3_KEY_LENGTH 24
+#define XMLSEC_NSS_DES3_IV_LENGTH 8
+#define XMLSEC_NSS_DES3_BLOCK_LENGTH 8
+
+static xmlSecByte xmlSecNssKWDes3Iv[XMLSEC_NSS_DES3_IV_LENGTH] = {
+ 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05
+};
+
+/*********************************************************************
+ *
+ * key wrap transforms
+ *
+ ********************************************************************/
+typedef struct _xmlSecNssKeyWrapCtx xmlSecNssKeyWrapCtx ;
+typedef struct _xmlSecNssKeyWrapCtx* xmlSecNssKeyWrapCtxPtr ;
+
+#define xmlSecNssKeyWrapSize \
+ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssKeyWrapCtx ) )
+
+#define xmlSecNssKeyWrapGetCtx( transform ) \
+ ( ( xmlSecNssKeyWrapCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) )
+
+struct _xmlSecNssKeyWrapCtx {
+ CK_MECHANISM_TYPE cipher ;
+ PK11SymKey* symkey ;
+ xmlSecKeyDataId keyId ;
+ xmlSecBufferPtr material ; /* to be encrypted/decrypted key material */
+} ;
+
+static int xmlSecNssKeyWrapInitialize(xmlSecTransformPtr transform);
+static void xmlSecNssKeyWrapFinalize(xmlSecTransformPtr transform);
+static int xmlSecNssKeyWrapSetKeyReq(xmlSecTransformPtr transform,
+ xmlSecKeyReqPtr keyReq);
+static int xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform,
+ xmlSecKeyPtr key);
+static int xmlSecNssKeyWrapExecute(xmlSecTransformPtr transform,
+ int last,
+ xmlSecTransformCtxPtr transformCtx);
+static xmlSecSize xmlSecNssKeyWrapGetKeySize(xmlSecTransformPtr transform);
+
+static int
+xmlSecNssKeyWrapCheckId(
+ xmlSecTransformPtr transform
+) {
+ #ifndef XMLSEC_NO_DES
+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWDes3Id ) ) {
+ return(1);
+ }
+ #endif /* XMLSEC_NO_DES */
+
+ #ifndef XMLSEC_NO_AES
+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes128Id ) ||
+ xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes192Id ) ||
+ xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes256Id ) ) {
+
+ return(1);
+ }
+ #endif /* XMLSEC_NO_AES */
+
+ return(0);
+}
+
+static xmlSecSize
+xmlSecNssKeyWrapGetKeySize(xmlSecTransformPtr transform) {
+#ifndef XMLSEC_NO_DES
+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWDes3Id ) ) {
+ return(XMLSEC_NSS_DES3_KEY_SIZE);
+ } else
+#endif /* XMLSEC_NO_DES */
+
+#ifndef XMLSEC_NO_AES
+ if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes128Id)) {
+ return(XMLSEC_NSS_AES128_KEY_SIZE);
+ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes192Id)) {
+ return(XMLSEC_NSS_AES192_KEY_SIZE);
+ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes256Id)) {
+ return(XMLSEC_NSS_AES256_KEY_SIZE);
+ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes256Id)) {
+ return(XMLSEC_NSS_AES256_KEY_SIZE);
+ } else
+#endif /* XMLSEC_NO_AES */
+
+ if(1)
+ return(0);
+}
+
+
+static int
+xmlSecNssKeyWrapInitialize(xmlSecTransformPtr transform) {
+ xmlSecNssKeyWrapCtxPtr context ;
+ int ret;
+
+ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1);
+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1);
+
+ context = xmlSecNssKeyWrapGetCtx( transform ) ;
+ xmlSecAssert2( context != NULL , -1 ) ;
+
+ #ifndef XMLSEC_NO_DES
+ if( transform->id == xmlSecNssTransformKWDes3Id ) {
+ context->cipher = CKM_DES3_CBC ;
+ context->keyId = xmlSecNssKeyDataDesId ;
+ } else
+ #endif /* XMLSEC_NO_DES */
+
+ #ifndef XMLSEC_NO_AES
+ if( transform->id == xmlSecNssTransformKWAes128Id ) {
+ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/
+ context->cipher = CKM_AES_CBC ;
+ context->keyId = xmlSecNssKeyDataAesId ;
+ } else
+ if( transform->id == xmlSecNssTransformKWAes192Id ) {
+ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/
+ context->cipher = CKM_AES_CBC ;
+ context->keyId = xmlSecNssKeyDataAesId ;
+ } else
+ if( transform->id == xmlSecNssTransformKWAes256Id ) {
+ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/
+ context->cipher = CKM_AES_CBC ;
+ context->keyId = xmlSecNssKeyDataAesId ;
+ } else
+ #endif /* XMLSEC_NO_AES */
+
+
+ if( 1 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+ NULL ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ context->symkey = NULL ;
+ context->material = NULL ;
+
+ return(0);
+}
+
+static void
+xmlSecNssKeyWrapFinalize(xmlSecTransformPtr transform) {
+ xmlSecNssKeyWrapCtxPtr context ;
+
+ xmlSecAssert(xmlSecNssKeyWrapCheckId(transform));
+ xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize));
+
+ context = xmlSecNssKeyWrapGetCtx( transform ) ;
+ xmlSecAssert( context != NULL ) ;
+
+ if( context->symkey != NULL ) {
+ PK11_FreeSymKey( context->symkey ) ;
+ context->symkey = NULL ;
+ }
+
+ if( context->material != NULL ) {
+ xmlSecBufferDestroy(context->material);
+ context->material = NULL ;
+ }
+}
+
+static int
+xmlSecNssKeyWrapSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) {
+ xmlSecNssKeyWrapCtxPtr context ;
+ xmlSecSize cipherSize = 0 ;
+
+
+ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1);
+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1);
+ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1);
+ xmlSecAssert2(keyReq != NULL, -1);
+
+ context = xmlSecNssKeyWrapGetCtx( transform ) ;
+ xmlSecAssert2( context != NULL , -1 ) ;
+
+ keyReq->keyId = context->keyId;
+ keyReq->keyType = xmlSecKeyDataTypeSymmetric;
+ if(transform->operation == xmlSecTransformOperationEncrypt) {
+ keyReq->keyUsage = xmlSecKeyUsageEncrypt;
+ } else {
+ keyReq->keyUsage = xmlSecKeyUsageDecrypt;
+ }
+
+ keyReq->keyBitsSize = xmlSecNssKeyWrapGetKeySize( transform ) ;
+
+ return(0);
+}
+
+static int
+xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) {
+ xmlSecNssKeyWrapCtxPtr context = NULL ;
+ xmlSecKeyDataPtr keyData = NULL ;
+ PK11SymKey* symkey = NULL ;
+
+ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1);
+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1);
+ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1);
+ xmlSecAssert2(key != NULL, -1);
+
+ context = xmlSecNssKeyWrapGetCtx( transform ) ;
+ if( context == NULL || context->keyId == NULL || context->symkey != NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ "xmlSecNssKeyWrapGetCtx" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ;
+
+ keyData = xmlSecKeyGetValue( key ) ;
+ if( keyData == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) ,
+ "xmlSecKeyGetValue" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ if( ( symkey = xmlSecNssSymKeyDataGetKey( keyData ) ) == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) ,
+ "xmlSecNssSymKeyDataGetKey" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ context->symkey = symkey ;
+
+ return(0) ;
+}
+
+/**
+ * key wrap transform
+ */
+static int
+xmlSecNssKeyWrapCtxInit(
+ xmlSecNssKeyWrapCtxPtr ctx ,
+ xmlSecBufferPtr in ,
+ xmlSecBufferPtr out ,
+ int encrypt ,
+ xmlSecTransformCtxPtr transformCtx
+) {
+ xmlSecSize blockSize ;
+
+ xmlSecAssert2( ctx != NULL , -1 ) ;
+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2( in != NULL , -1 ) ;
+ xmlSecAssert2( out != NULL , -1 ) ;
+ xmlSecAssert2( transformCtx != NULL , -1 ) ;
+
+ if( ctx->material != NULL ) {
+ xmlSecBufferDestroy( ctx->material ) ;
+ ctx->material = NULL ;
+ }
+
+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_GetBlockSize" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ ctx->material = xmlSecBufferCreate( blockSize ) ;
+ if( ctx->material == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferCreate" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ /* read raw key material into context */
+ if( xmlSecBufferSetData( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferSetData" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferRemoveHead" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ return(0);
+}
+
+/**
+ * key wrap transform update
+ */
+static int
+xmlSecNssKeyWrapCtxUpdate(
+ xmlSecNssKeyWrapCtxPtr ctx ,
+ xmlSecBufferPtr in ,
+ xmlSecBufferPtr out ,
+ int encrypt ,
+ xmlSecTransformCtxPtr transformCtx
+) {
+ xmlSecAssert2( ctx != NULL , -1 ) ;
+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2( ctx->material != NULL , -1 ) ;
+ xmlSecAssert2( in != NULL , -1 ) ;
+ xmlSecAssert2( out != NULL , -1 ) ;
+ xmlSecAssert2( transformCtx != NULL , -1 ) ;
+
+ /* read raw key material and append into context */
+ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferAppend" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferRemoveHead" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ return(0);
+}
+
+static int
+xmlSecNssKWDes3BufferReverse(xmlSecByte *buf, xmlSecSize size) {
+ xmlSecSize s;
+ xmlSecSize i;
+ xmlSecByte c;
+
+ xmlSecAssert2(buf != NULL, -1);
+
+ s = size / 2;
+ --size;
+ for(i = 0; i < s; ++i) {
+ c = buf[i];
+ buf[i] = buf[size - i];
+ buf[size - i] = c;
+ }
+ return(0);
+}
+
+static xmlSecByte *
+xmlSecNssComputeSHA1(const xmlSecByte *in, xmlSecSize inSize,
+ xmlSecByte *out, xmlSecSize outSize)
+{
+ PK11Context *context = NULL;
+ SECStatus s;
+ xmlSecByte *digest = NULL;
+ unsigned int len;
+
+ xmlSecAssert2(in != NULL, NULL);
+ xmlSecAssert2(out != NULL, NULL);
+ xmlSecAssert2(outSize >= SHA1_LENGTH, NULL);
+
+ /* Create a context for hashing (digesting) */
+ context = PK11_CreateDigestContext(SEC_OID_SHA1);
+ if (context == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_CreateDigestContext",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ s = PK11_DigestBegin(context);
+ if (s != SECSuccess) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_DigestBegin",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ s = PK11_DigestOp(context, in, inSize);
+ if (s != SECSuccess) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_DigestOp",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ s = PK11_DigestFinal(context, out, &len, outSize);
+ if (s != SECSuccess) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_DigestFinal",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "error code = %d", PORT_GetError());
+ goto done;
+ }
+ xmlSecAssert2(len == SHA1_LENGTH, NULL);
+
+ digest = out;
+
+done:
+ if (context != NULL) {
+ PK11_DestroyContext(context, PR_TRUE);
+ }
+ return (digest);
+}
+
+static int
+xmlSecNssKWDes3Encrypt(
+ PK11SymKey* symKey ,
+ CK_MECHANISM_TYPE cipherMech ,
+ const xmlSecByte* iv ,
+ xmlSecSize ivSize ,
+ const xmlSecByte* in ,
+ xmlSecSize inSize ,
+ xmlSecByte* out ,
+ xmlSecSize outSize ,
+ int enc
+) {
+ PK11Context* EncContext = NULL;
+ SECItem ivItem ;
+ SECItem* secParam = NULL ;
+ int tmp1_outlen;
+ unsigned int tmp2_outlen;
+ int result_len = -1;
+ SECStatus rv;
+
+ xmlSecAssert2( cipherMech != CKM_INVALID_MECHANISM , -1 ) ;
+ xmlSecAssert2( symKey != NULL , -1 ) ;
+ xmlSecAssert2(iv != NULL, -1);
+ xmlSecAssert2(ivSize == XMLSEC_NSS_DES3_IV_LENGTH, -1);
+ xmlSecAssert2(in != NULL, -1);
+ xmlSecAssert2(inSize > 0, -1);
+ xmlSecAssert2(out != NULL, -1);
+ xmlSecAssert2(outSize >= inSize, -1);
+
+ /* Prepare IV */
+ ivItem.data = ( unsigned char* )iv ;
+ ivItem.len = ivSize ;
+
+ secParam = PK11_ParamFromIV(cipherMech, &ivItem);
+ if (secParam == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_ParamFromIV",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "Error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ EncContext = PK11_CreateContextBySymKey(cipherMech,
+ enc ? CKA_ENCRYPT : CKA_DECRYPT,
+ symKey, secParam);
+ if (EncContext == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_CreateContextBySymKey",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "Error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ tmp1_outlen = tmp2_outlen = 0;
+ rv = PK11_CipherOp(EncContext, out, &tmp1_outlen, outSize,
+ (unsigned char *)in, inSize);
+ if (rv != SECSuccess) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_CipherOp",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "Error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ rv = PK11_DigestFinal(EncContext, out+tmp1_outlen,
+ &tmp2_outlen, outSize-tmp1_outlen);
+ if (rv != SECSuccess) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_DigestFinal",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "Error code = %d", PORT_GetError());
+ goto done;
+ }
+
+ result_len = tmp1_outlen + tmp2_outlen;
+
+done:
+ if (secParam) {
+ SECITEM_FreeItem(secParam, PR_TRUE);
+ }
+ if (EncContext) {
+ PK11_DestroyContext(EncContext, PR_TRUE);
+ }
+
+ return(result_len);
+}
+
+static int
+xmlSecNssKeyWrapDesOp(
+ xmlSecNssKeyWrapCtxPtr ctx ,
+ int encrypt ,
+ xmlSecBufferPtr result
+) {
+ xmlSecByte sha1[SHA1_LENGTH];
+ xmlSecByte iv[XMLSEC_NSS_DES3_IV_LENGTH];
+ xmlSecByte* in;
+ xmlSecSize inSize;
+ xmlSecByte* out;
+ xmlSecSize outSize;
+ xmlSecSize s;
+ int ret;
+ SECStatus status;
+
+ xmlSecAssert2( ctx != NULL , -1 ) ;
+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2( ctx->material != NULL , -1 ) ;
+ xmlSecAssert2( result != NULL , -1 ) ;
+
+ in = xmlSecBufferGetData(ctx->material);
+ inSize = xmlSecBufferGetSize(ctx->material) ;
+ out = xmlSecBufferGetData(result);
+ outSize = xmlSecBufferGetMaxSize(result) ;
+ if( encrypt ) {
+ /* step 2: calculate sha1 and CMS */
+ if(xmlSecNssComputeSHA1(in, inSize, sha1, SHA1_LENGTH) == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssComputeSHA1",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+ /* step 3: construct WKCKS */
+ memcpy(out, in, inSize);
+ memcpy(out + inSize, sha1, XMLSEC_NSS_DES3_BLOCK_LENGTH);
+
+ /* step 4: generate random iv */
+ status = PK11_GenerateRandom(iv, XMLSEC_NSS_DES3_IV_LENGTH);
+ if(status != SECSuccess) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PK11_GenerateRandom",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ "error code = %d", PORT_GetError());
+ return(-1);
+ }
+
+ /* step 5: first encryption, result is TEMP1 */
+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher,
+ iv, XMLSEC_NSS_DES3_IV_LENGTH,
+ out, inSize + XMLSEC_NSS_DES3_IV_LENGTH,
+ out, outSize, 1);
+ if(ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssKWDes3Encrypt",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+ /* step 6: construct TEMP2=IV || TEMP1 */
+ memmove(out + XMLSEC_NSS_DES3_IV_LENGTH, out,
+ inSize + XMLSEC_NSS_DES3_IV_LENGTH);
+ memcpy(out, iv, XMLSEC_NSS_DES3_IV_LENGTH);
+ s = ret + XMLSEC_NSS_DES3_IV_LENGTH;
+
+ /* step 7: reverse octets order, result is TEMP3 */
+ ret = xmlSecNssKWDes3BufferReverse(out, s);
+ if(ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssKWDes3BufferReverse",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+ /* step 8: second encryption with static IV */
+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher,
+ xmlSecNssKWDes3Iv, XMLSEC_NSS_DES3_IV_LENGTH,
+ out, s,
+ out, outSize, 1);
+ if(ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssKWDes3Encrypt",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ s = ret;
+
+ if( xmlSecBufferSetSize( result , s ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecBufferSetSize",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ } else {
+ /* step 2: first decryption with static IV, result is TEMP3 */
+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher,
+ xmlSecNssKWDes3Iv, XMLSEC_NSS_DES3_IV_LENGTH,
+ in, inSize,
+ out, outSize, 0);
+ if((ret < 0) || (ret < XMLSEC_NSS_DES3_IV_LENGTH)) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssKWDes3Encrypt",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ s = ret;
+
+ /* step 3: reverse octets order in TEMP3, result is TEMP2 */
+ ret = xmlSecNssKWDes3BufferReverse(out, s);
+ if(ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssKWDes3BufferReverse",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+ /* steps 4 and 5: get IV and decrypt second time, result is WKCKS */
+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher,
+ out, XMLSEC_NSS_DES3_IV_LENGTH,
+ out+XMLSEC_NSS_DES3_IV_LENGTH, s-XMLSEC_NSS_DES3_IV_LENGTH,
+ out, outSize, 0);
+ if((ret < 0) || (ret < XMLSEC_NSS_DES3_BLOCK_LENGTH)) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssKWDes3Encrypt",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ s = ret - XMLSEC_NSS_DES3_IV_LENGTH;
+
+ /* steps 6 and 7: calculate SHA1 and validate it */
+ if(xmlSecNssComputeSHA1(out, s, sha1, SHA1_LENGTH) == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecNssComputeSHA1",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+ if(memcmp(sha1, out + s, XMLSEC_NSS_DES3_BLOCK_LENGTH) != 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ NULL,
+ XMLSEC_ERRORS_R_INVALID_DATA,
+ "SHA1 does not match");
+ return(-1);
+ }
+
+ if( xmlSecBufferSetSize( result , s ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "xmlSecBufferSetSize",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ }
+
+ return(0);
+}
+
+static int
+xmlSecNssKeyWrapAesOp(
+ xmlSecNssKeyWrapCtxPtr ctx ,
+ int encrypt ,
+ xmlSecBufferPtr result
+) {
+ PK11Context* cipherCtx = NULL;
+ SECItem ivItem ;
+ SECItem* secParam = NULL ;
+ xmlSecSize inSize ;
+ xmlSecSize inBlocks ;
+ int blockSize ;
+ int midSize ;
+ int finSize ;
+ xmlSecByte* out ;
+ xmlSecSize outSize;
+
+ xmlSecAssert2( ctx != NULL , -1 ) ;
+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2( ctx->material != NULL , -1 ) ;
+ xmlSecAssert2( result != NULL , -1 ) ;
+
+ /* Do not set any IV */
+ memset(&ivItem, 0, sizeof(ivItem));
+
+ /* Get block size */
+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_GetBlockSize" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ inSize = xmlSecBufferGetSize( ctx->material ) ;
+ if( xmlSecBufferSetMaxSize( result , inSize + blockSize ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferSetMaxSize" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ /* Get Param for context initialization */
+ if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_ParamFromIV" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ cipherCtx = PK11_CreateContextBySymKey( ctx->cipher , encrypt ? CKA_ENCRYPT : CKA_DECRYPT , ctx->symkey , secParam ) ;
+ if( cipherCtx == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_CreateContextBySymKey" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ SECITEM_FreeItem( secParam , PR_TRUE ) ;
+ return(-1);
+ }
+
+ out = xmlSecBufferGetData(result) ;
+ outSize = xmlSecBufferGetMaxSize(result) ;
+ if( PK11_CipherOp( cipherCtx , out, &midSize , outSize , xmlSecBufferGetData( ctx->material ) , inSize ) != SECSuccess ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_CipherOp" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ if( PK11_DigestFinal( cipherCtx , out + midSize , &finSize , outSize - midSize ) != SECSuccess ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_DigestFinal" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ if( xmlSecBufferSetSize( result , midSize + finSize ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferSetSize" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ return 0 ;
+}
+
+/**
+ * Block cipher transform final
+ */
+static int
+xmlSecNssKeyWrapCtxFinal(
+ xmlSecNssKeyWrapCtxPtr ctx ,
+ xmlSecBufferPtr in ,
+ xmlSecBufferPtr out ,
+ int encrypt ,
+ xmlSecTransformCtxPtr transformCtx
+) {
+ PK11SymKey* targetKey ;
+ xmlSecSize blockSize ;
+ xmlSecBufferPtr result ;
+
+ xmlSecAssert2( ctx != NULL , -1 ) ;
+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2( ctx->material != NULL , -1 ) ;
+ xmlSecAssert2( in != NULL , -1 ) ;
+ xmlSecAssert2( out != NULL , -1 ) ;
+ xmlSecAssert2( transformCtx != NULL , -1 ) ;
+
+ /* read raw key material and append into context */
+ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferAppend" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferRemoveHead" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ /* Now we get all of the key materail */
+ /* from now on we will wrap or unwrap the key */
+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "PK11_GetBlockSize" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ result = xmlSecBufferCreate( blockSize ) ;
+ if( result == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferCreate" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ switch( ctx->cipher ) {
+ case CKM_DES3_CBC :
+ if( xmlSecNssKeyWrapDesOp(ctx, encrypt, result) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssKeyWrapDesOp" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecBufferDestroy(result);
+ return(-1);
+ }
+ break ;
+ /* case CKM_NETSCAPE_AES_KEY_WRAP :*/
+ case CKM_AES_CBC :
+ if( xmlSecNssKeyWrapAesOp(ctx, encrypt, result) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecNssKeyWrapAesOp" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecBufferDestroy(result);
+ return(-1);
+ }
+ break ;
+ }
+
+ /* Write output */
+ if( xmlSecBufferAppend( out, xmlSecBufferGetData(result), xmlSecBufferGetSize(result) ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ "xmlSecBufferAppend" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecBufferDestroy(result);
+ return(-1);
+ }
+ xmlSecBufferDestroy(result);
+
+ return(0);
+}
+
+static int
+xmlSecNssKeyWrapExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) {
+ xmlSecNssKeyWrapCtxPtr context = NULL ;
+ xmlSecBufferPtr inBuf, outBuf ;
+ int operation ;
+ int rtv ;
+
+ xmlSecAssert2( xmlSecNssKeyWrapCheckId( transform ), -1 ) ;
+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssKeyWrapSize ), -1 ) ;
+ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ;
+ xmlSecAssert2( transformCtx != NULL , -1 ) ;
+
+ context = xmlSecNssKeyWrapGetCtx( transform ) ;
+ if( context == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ "xmlSecNssKeyWrapGetCtx" ,
+ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ inBuf = &( transform->inBuf ) ;
+ outBuf = &( transform->outBuf ) ;
+
+ if( transform->status == xmlSecTransformStatusNone ) {
+ transform->status = xmlSecTransformStatusWorking ;
+ }
+
+ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ;
+ if( transform->status == xmlSecTransformStatusWorking ) {
+ if( context->material == NULL ) {
+ rtv = xmlSecNssKeyWrapCtxInit( context, inBuf , outBuf , operation , transformCtx ) ;
+ if( rtv < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ "xmlSecNssKeyWrapCtxInit" ,
+ XMLSEC_ERRORS_R_INVALID_STATUS ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+ }
+
+ if( context->material == NULL && last != 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ NULL ,
+ XMLSEC_ERRORS_R_INVALID_STATUS ,
+ "No enough data to intialize transform" ) ;
+ return(-1);
+ }
+
+ if( context->material != NULL ) {
+ rtv = xmlSecNssKeyWrapCtxUpdate( context, inBuf , outBuf , operation , transformCtx ) ;
+ if( rtv < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ "xmlSecNssKeyWrapCtxUpdate" ,
+ XMLSEC_ERRORS_R_INVALID_STATUS ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+ }
+
+ if( last ) {
+ rtv = xmlSecNssKeyWrapCtxFinal( context, inBuf , outBuf , operation , transformCtx ) ;
+ if( rtv < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ "xmlSecNssKeyWrapCtxFinal" ,
+ XMLSEC_ERRORS_R_INVALID_STATUS ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+ transform->status = xmlSecTransformStatusFinished ;
+ }
+ } else if( transform->status == xmlSecTransformStatusFinished ) {
+ if( xmlSecBufferGetSize( inBuf ) != 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ NULL ,
+ XMLSEC_ERRORS_R_INVALID_STATUS ,
+ "status=%d", transform->status ) ;
+ return(-1);
+ }
+ } else {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
+ NULL ,
+ XMLSEC_ERRORS_R_INVALID_STATUS ,
+ "status=%d", transform->status ) ;
+ return(-1);
+ }
+
+ return(0);
+}
+
+#ifndef XMLSEC_NO_AES
+
+
+#ifdef __MINGW32__ // for runtime-pseudo-reloc
+static struct _xmlSecTransformKlass xmlSecNssKWAes128Klass = {
+#else
+static xmlSecTransformKlass xmlSecNssKWAes128Klass = {
+#endif
+ /* klass/object sizes */
+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */
+
+ xmlSecNameKWAes128, /* const xmlChar* name; */
+ xmlSecHrefKWAes128, /* const xmlChar* href; */
+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */
+
+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */
+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */
+ NULL, /* xmlSecTransformNodeReadMethod readNode; */
+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */
+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */
+ NULL, /* xmlSecTransformValidateMethod validate; */
+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */
+ NULL, /* xmlSecTransformPopXmlMethod popXml; */
+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */
+
+ NULL, /* void* reserved0; */
+ NULL, /* void* reserved1; */
+};
+
+#ifdef __MINGW32__ // for runtime-pseudo-reloc
+static struct _xmlSecTransformKlass xmlSecNssKWAes192Klass = {
+#else
+static xmlSecTransformKlass xmlSecNssKWAes192Klass = {
+#endif
+ /* klass/object sizes */
+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */
+
+ xmlSecNameKWAes192, /* const xmlChar* name; */
+ xmlSecHrefKWAes192, /* const xmlChar* href; */
+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */
+
+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */
+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */
+ NULL, /* xmlSecTransformNodeReadMethod readNode; */
+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */
+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */
+ NULL, /* xmlSecTransformValidateMethod validate; */
+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */
+ NULL, /* xmlSecTransformPopXmlMethod popXml; */
+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */
+
+ NULL, /* void* reserved0; */
+ NULL, /* void* reserved1; */
+};
+
+#ifdef __MINGW32__ // for runtime-pseudo-reloc
+static struct _xmlSecTransformKlass xmlSecNssKWAes256Klass = {
+#else
+static xmlSecTransformKlass xmlSecNssKWAes256Klass = {
+#endif
+ /* klass/object sizes */
+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */
+
+ xmlSecNameKWAes256, /* const xmlChar* name; */
+ xmlSecHrefKWAes256, /* const xmlChar* href; */
+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */
+
+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */
+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */
+ NULL, /* xmlSecTransformNodeReadMethod readNode; */
+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */
+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */
+ NULL, /* xmlSecTransformValidateMethod validate; */
+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */
+ NULL, /* xmlSecTransformPopXmlMethod popXml; */
+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */
+
+ NULL, /* void* reserved0; */
+ NULL, /* void* reserved1; */
+};
+
+/**
+ * xmlSecNssTransformKWAes128GetKlass:
+ *
+ * The AES-128 key wrapper transform klass.
+ *
+ * Returns AES-128 key wrapper transform klass.
+ */
+xmlSecTransformId
+xmlSecNssTransformKWAes128GetKlass(void) {
+ return(&xmlSecNssKWAes128Klass);
+}
+
+/**
+ * xmlSecNssTransformKWAes192GetKlass:
+ *
+ * The AES-192 key wrapper transform klass.
+ *
+ * Returns AES-192 key wrapper transform klass.
+ */
+xmlSecTransformId
+xmlSecNssTransformKWAes192GetKlass(void) {
+ return(&xmlSecNssKWAes192Klass);
+}
+
+/**
+ *
+ * The AES-256 key wrapper transform klass.
+ *
+ * Returns AES-256 key wrapper transform klass.
+ */
+xmlSecTransformId
+xmlSecNssTransformKWAes256GetKlass(void) {
+ return(&xmlSecNssKWAes256Klass);
+}
+
+#endif /* XMLSEC_NO_AES */
+
+
+#ifndef XMLSEC_NO_DES
+
+#ifdef __MINGW32__ // for runtime-pseudo-reloc
+static struct _xmlSecTransformKlass xmlSecNssKWDes3Klass = {
+#else
+static xmlSecTransformKlass xmlSecNssKWDes3Klass = {
+#endif
+ /* klass/object sizes */
+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */
+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */
+
+ xmlSecNameKWDes3, /* const xmlChar* name; */
+ xmlSecHrefKWDes3, /* const xmlChar* href; */
+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */
+
+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */
+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */
+ NULL, /* xmlSecTransformNodeReadMethod readNode; */
+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */
+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */
+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */
+ NULL, /* xmlSecTransformValidateMethod validate; */
+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */
+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */
+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */
+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */
+ NULL, /* xmlSecTransformPopXmlMethod popXml; */
+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */
+
+ NULL, /* void* reserved0; */
+ NULL, /* void* reserved1; */
+};
+
+/**
+ * xmlSecNssTransformKWDes3GetKlass:
+ *
+ * The Triple DES key wrapper transform klass.
+ *
+ * Returns Triple DES key wrapper transform klass.
+ */
+xmlSecTransformId
+xmlSecNssTransformKWDes3GetKlass(void) {
+ return(&xmlSecNssKWDes3Klass);
+}
+
+#endif /* XMLSEC_NO_DES */
+
--- /dev/null
+/**
+ * XMLSec library
+ *
+ * This is free software; see Copyright file in the source
+ * distribution for preciese wording.
+ *
+ * Copyright..................................
+ *
+ * Contributor(s): _____________________________
+ *
+ */
+
+/**
+ * In order to ensure that particular crypto operation is performed on
+ * particular crypto device, a subclass of xmlSecList is used to store slot and
+ * mechanism information.
+ *
+ * In the list, a slot is bound with a mechanism. If the mechanism is available,
+ * this mechanism only can perform on the slot; otherwise, it can perform on
+ * every eligibl slot in the list.
+ *
+ * When try to find a slot for a particular mechanism, the slot bound with
+ * available mechanism will be looked up firstly.
+ */
+#include "globals.h"
+#include <string.h>
+
+#include <xmlsec/xmlsec.h>
+#include <xmlsec/errors.h>
+#include <xmlsec/list.h>
+
+#include <xmlsec/nss/tokens.h>
+
+int
+xmlSecNssKeySlotSetMechList(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE_PTR mechanismList
+) {
+ int counter ;
+
+ xmlSecAssert2( keySlot != NULL , -1 ) ;
+
+ if( keySlot->mechanismList != CK_NULL_PTR ) {
+ xmlFree( keySlot->mechanismList ) ;
+
+ for( counter = 0 ; *( mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ;
+ keySlot->mechanismList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ;
+ if( keySlot->mechanismList == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 );
+ }
+ for( ; counter >= 0 ; counter -- )
+ *( keySlot->mechanismList + counter ) = *( mechanismList + counter ) ;
+ }
+
+ return( 0 );
+}
+
+int
+xmlSecNssKeySlotEnableMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE mechanism
+) {
+ int counter ;
+ CK_MECHANISM_TYPE_PTR newList ;
+
+ xmlSecAssert2( keySlot != NULL , -1 ) ;
+
+ if( mechanism != CKM_INVALID_MECHANISM ) {
+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ;
+ newList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ;
+ if( newList == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 );
+ }
+ *( newList + counter + 1 ) = CKM_INVALID_MECHANISM ;
+ *( newList + counter ) = mechanism ;
+ for( counter -= 1 ; counter >= 0 ; counter -- )
+ *( newList + counter ) = *( keySlot->mechanismList + counter ) ;
+
+ xmlFree( keySlot->mechanismList ) ;
+ keySlot->mechanismList = newList ;
+ }
+
+ return(0);
+}
+
+int
+xmlSecNssKeySlotDisableMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE mechanism
+) {
+ int counter ;
+
+ xmlSecAssert2( keySlot != NULL , -1 ) ;
+
+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) {
+ if( *( keySlot->mechanismList + counter ) == mechanism ) {
+ for( ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) {
+ *( keySlot->mechanismList + counter ) = *( keySlot->mechanismList + counter + 1 ) ;
+ }
+
+ break ;
+ }
+ }
+
+ return(0);
+}
+
+CK_MECHANISM_TYPE_PTR
+xmlSecNssKeySlotGetMechList(
+ xmlSecNssKeySlotPtr keySlot
+) {
+ if( keySlot != NULL )
+ return keySlot->mechanismList ;
+ else
+ return NULL ;
+}
+
+int
+xmlSecNssKeySlotSetSlot(
+ xmlSecNssKeySlotPtr keySlot ,
+ PK11SlotInfo* slot
+) {
+ xmlSecAssert2( keySlot != NULL , -1 ) ;
+
+ if( slot != NULL && keySlot->slot != slot ) {
+ if( keySlot->slot != NULL )
+ PK11_FreeSlot( keySlot->slot ) ;
+
+ if( keySlot->mechanismList != NULL ) {
+ xmlFree( keySlot->mechanismList ) ;
+ keySlot->mechanismList = NULL ;
+ }
+
+ keySlot->slot = PK11_ReferenceSlot( slot ) ;
+ }
+
+ return(0);
+}
+
+int
+xmlSecNssKeySlotInitialize(
+ xmlSecNssKeySlotPtr keySlot ,
+ PK11SlotInfo* slot
+) {
+ xmlSecAssert2( keySlot != NULL , -1 ) ;
+ xmlSecAssert2( keySlot->slot == NULL , -1 ) ;
+ xmlSecAssert2( keySlot->mechanismList == NULL , -1 ) ;
+
+ if( slot != NULL ) {
+ keySlot->slot = PK11_ReferenceSlot( slot ) ;
+ }
+
+ return(0);
+}
+
+void
+xmlSecNssKeySlotFinalize(
+ xmlSecNssKeySlotPtr keySlot
+) {
+ xmlSecAssert( keySlot != NULL ) ;
+
+ if( keySlot->mechanismList != NULL ) {
+ xmlFree( keySlot->mechanismList ) ;
+ keySlot->mechanismList = NULL ;
+ }
+
+ if( keySlot->slot != NULL ) {
+ PK11_FreeSlot( keySlot->slot ) ;
+ keySlot->slot = NULL ;
+ }
+
+}
+
+PK11SlotInfo*
+xmlSecNssKeySlotGetSlot(
+ xmlSecNssKeySlotPtr keySlot
+) {
+ if( keySlot != NULL )
+ return keySlot->slot ;
+ else
+ return NULL ;
+}
+
+xmlSecNssKeySlotPtr
+xmlSecNssKeySlotCreate() {
+ xmlSecNssKeySlotPtr keySlot ;
+
+ /* Allocates a new xmlSecNssKeySlot and fill the fields */
+ keySlot = ( xmlSecNssKeySlotPtr )xmlMalloc( sizeof( xmlSecNssKeySlot ) ) ;
+ if( keySlot == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( NULL );
+ }
+ memset( keySlot, 0, sizeof( xmlSecNssKeySlot ) ) ;
+
+ return( keySlot ) ;
+}
+
+int
+xmlSecNssKeySlotCopy(
+ xmlSecNssKeySlotPtr newKeySlot ,
+ xmlSecNssKeySlotPtr keySlot
+) {
+ CK_MECHANISM_TYPE_PTR mech ;
+ int counter ;
+
+ xmlSecAssert2( newKeySlot != NULL , -1 ) ;
+ xmlSecAssert2( keySlot != NULL , -1 ) ;
+
+ if( keySlot->slot != NULL && newKeySlot->slot != keySlot->slot ) {
+ if( newKeySlot->slot != NULL )
+ PK11_FreeSlot( newKeySlot->slot ) ;
+
+ newKeySlot->slot = PK11_ReferenceSlot( keySlot->slot ) ;
+ }
+
+ if( keySlot->mechanismList != CK_NULL_PTR ) {
+ xmlFree( newKeySlot->mechanismList ) ;
+
+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ;
+ newKeySlot->mechanismList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ;
+ if( newKeySlot->mechanismList == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 );
+ }
+ for( ; counter >= 0 ; counter -- )
+ *( newKeySlot->mechanismList + counter ) = *( keySlot->mechanismList + counter ) ;
+ }
+
+ return( 0 );
+}
+
+xmlSecNssKeySlotPtr
+xmlSecNssKeySlotDuplicate(
+ xmlSecNssKeySlotPtr keySlot
+) {
+ xmlSecNssKeySlotPtr newKeySlot ;
+ int ret ;
+
+ xmlSecAssert2( keySlot != NULL , NULL ) ;
+
+ newKeySlot = xmlSecNssKeySlotCreate() ;
+ if( newKeySlot == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( NULL );
+ }
+
+ if( xmlSecNssKeySlotCopy( newKeySlot, keySlot ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( NULL );
+ }
+
+ return( newKeySlot );
+}
+
+void
+xmlSecNssKeySlotDestroy(
+ xmlSecNssKeySlotPtr keySlot
+) {
+ xmlSecAssert( keySlot != NULL ) ;
+
+ if( keySlot->mechanismList != NULL )
+ xmlFree( keySlot->mechanismList ) ;
+
+ if( keySlot->slot != NULL )
+ PK11_FreeSlot( keySlot->slot ) ;
+
+ xmlFree( keySlot ) ;
+}
+
+int
+xmlSecNssKeySlotBindMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE type
+) {
+ int counter ;
+
+ xmlSecAssert2( keySlot != NULL , 0 ) ;
+ xmlSecAssert2( keySlot->slot != NULL , 0 ) ;
+ xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ;
+
+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) {
+ if( *( keySlot->mechanismList + counter ) == type )
+ return(1) ;
+ }
+
+ return( 0 ) ;
+}
+
+int
+xmlSecNssKeySlotSupportMech(
+ xmlSecNssKeySlotPtr keySlot ,
+ CK_MECHANISM_TYPE type
+) {
+ xmlSecAssert2( keySlot != NULL , 0 ) ;
+ xmlSecAssert2( keySlot->slot != NULL , 0 ) ;
+ xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ;
+
+ if( PK11_DoesMechanism( keySlot->slot , type ) == PR_TRUE ) {
+ return(1);
+ } else
+ return(0);
+}
+
+void
+xmlSecNssKeySlotDebugDump(
+ xmlSecNssKeySlotPtr keySlot ,
+ FILE* output
+) {
+ xmlSecAssert( keySlot != NULL ) ;
+ xmlSecAssert( output != NULL ) ;
+
+ fprintf( output, "== KEY SLOT\n" );
+}
+
+void
+xmlSecNssKeySlotDebugXmlDump(
+ xmlSecNssKeySlotPtr keySlot ,
+ FILE* output
+) {
+}
+
+/**
+ * Key Slot List
+ */
+#ifdef __MINGW32__ // for runtime-pseudo-reloc
+static struct _xmlSecPtrListKlass xmlSecNssKeySlotPtrListKlass = {
+#else
+static xmlSecPtrListKlass xmlSecNssKeySlotPtrListKlass = {
+#endif
+ BAD_CAST "mechanism-list",
+ (xmlSecPtrDuplicateItemMethod)xmlSecNssKeySlotDuplicate,
+ (xmlSecPtrDestroyItemMethod)xmlSecNssKeySlotDestroy,
+ (xmlSecPtrDebugDumpItemMethod)xmlSecNssKeySlotDebugDump,
+ (xmlSecPtrDebugDumpItemMethod)xmlSecNssKeySlotDebugXmlDump,
+};
+
+xmlSecPtrListId
+xmlSecNssKeySlotListGetKlass(void) {
+ return(&xmlSecNssKeySlotPtrListKlass);
+}
+
+
+/*-
+ * Global PKCS#11 crypto token repository -- Key slot list
+ */
+static xmlSecPtrListPtr _xmlSecNssKeySlotList = NULL ;
+
+PK11SlotInfo*
+xmlSecNssSlotGet(
+ CK_MECHANISM_TYPE type
+) {
+ PK11SlotInfo* slot = NULL ;
+ xmlSecNssKeySlotPtr keySlot ;
+ xmlSecSize ksSize ;
+ xmlSecSize ksPos ;
+ char flag ;
+
+ if( _xmlSecNssKeySlotList == NULL ) {
+ slot = PK11_GetBestSlot( type , NULL ) ;
+ } else {
+ ksSize = xmlSecPtrListGetSize( _xmlSecNssKeySlotList ) ;
+
+ /*-
+ * Firstly, checking whether the mechanism is bound with a special slot.
+ * If no bound slot, we try to find the first eligible slot in the list.
+ */
+ for( flag = 0, ksPos = 0 ; ksPos < ksSize ; ksPos ++ ) {
+ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( _xmlSecNssKeySlotList, ksPos ) ;
+ if( keySlot != NULL && xmlSecNssKeySlotBindMech( keySlot, type ) ) {
+ slot = xmlSecNssKeySlotGetSlot( keySlot ) ;
+ flag = 2 ;
+ } else if( flag == 0 && xmlSecNssKeySlotSupportMech( keySlot, type ) ) {
+ slot = xmlSecNssKeySlotGetSlot( keySlot ) ;
+ flag = 1 ;
+ }
+
+ if( flag == 2 )
+ break ;
+ }
+ if( slot != NULL )
+ slot = PK11_ReferenceSlot( slot ) ;
+ }
+
+ if( slot != NULL && PK11_NeedLogin( slot ) ) {
+ if( PK11_Authenticate( slot , PR_TRUE , NULL ) != SECSuccess ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ PK11_FreeSlot( slot ) ;
+ return( NULL );
+ }
+ }
+
+ return slot ;
+}
+
+int
+xmlSecNssSlotInitialize(
+ void
+) {
+ if( _xmlSecNssKeySlotList != NULL ) {
+ xmlSecPtrListDestroy( _xmlSecNssKeySlotList ) ;
+ _xmlSecNssKeySlotList = NULL ;
+ }
+
+ _xmlSecNssKeySlotList = xmlSecPtrListCreate( xmlSecNssKeySlotListId ) ;
+ if( _xmlSecNssKeySlotList == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return( -1 );
+ }
+
+ return(0);
+}
+
+void
+xmlSecNssSlotShutdown(
+ void
+) {
+ if( _xmlSecNssKeySlotList != NULL ) {
+ xmlSecPtrListDestroy( _xmlSecNssKeySlotList ) ;
+ _xmlSecNssKeySlotList = NULL ;
+ }
+}
+
+int
+xmlSecNssSlotAdopt(
+ PK11SlotInfo* slot,
+ CK_MECHANISM_TYPE type
+) {
+ xmlSecNssKeySlotPtr keySlot ;
+ xmlSecSize ksSize ;
+ xmlSecSize ksPos ;
+ char flag ;
+
+ xmlSecAssert2( _xmlSecNssKeySlotList != NULL, -1 ) ;
+ xmlSecAssert2( slot != NULL, -1 ) ;
+
+ ksSize = xmlSecPtrListGetSize( _xmlSecNssKeySlotList ) ;
+
+ /*-
+ * Firstly, checking whether the slot is in the repository already.
+ */
+ flag = 0 ;
+ for( ksPos = 0 ; ksPos < ksSize ; ksPos ++ ) {
+ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( _xmlSecNssKeySlotList, ksPos ) ;
+ /* If find the slot in the list */
+ if( keySlot != NULL && xmlSecNssKeySlotGetSlot( keySlot ) == slot ) {
+ /* If mechnism type is valid, bind the slot with the mechanism */
+ if( type != CKM_INVALID_MECHANISM ) {
+ if( xmlSecNssKeySlotEnableMech( keySlot, type ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+ }
+
+ flag = 1 ;
+ }
+ }
+
+ /* If the slot do not in the list, add a new item to the list */
+ if( flag == 0 ) {
+ /* Create a new KeySlot */
+ keySlot = xmlSecNssKeySlotCreate() ;
+ if( keySlot == NULL ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ return(-1);
+ }
+
+ /* Initialize the keySlot with a slot */
+ if( xmlSecNssKeySlotInitialize( keySlot, slot ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecNssKeySlotDestroy( keySlot ) ;
+ return(-1);
+ }
+
+ /* If mechnism type is valid, bind the slot with the mechanism */
+ if( type != CKM_INVALID_MECHANISM ) {
+ if( xmlSecNssKeySlotEnableMech( keySlot, type ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecNssKeySlotDestroy( keySlot ) ;
+ return(-1);
+ }
+ }
+
+ /* Add keySlot into the list */
+ if( xmlSecPtrListAdd( _xmlSecNssKeySlotList, keySlot ) < 0 ) {
+ xmlSecError( XMLSEC_ERRORS_HERE ,
+ NULL ,
+ NULL ,
+ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
+ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ xmlSecNssKeySlotDestroy( keySlot ) ;
+ return(-1);
+ }
+ }
+
+ return(0);
+}
+
--- /dev/null
+--- misc/xmlsec1-1.2.14/configure.in 2012-08-29 22:44:51.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/configure.in 2012-08-29 22:46:23.000000000 +0200
+@@ -46,10 +46,6 @@
+ AC_PATH_PROG(HELP2MAN, help2man)
+ AC_PATH_PROG(MAN2HTML, man2html)
+
+-dnl Make sure we have an ANSI compiler
+-AM_C_PROTOTYPES
+-test "z$U" != "z" && AC_MSG_ERROR(Compiler not ANSI compliant)
+-
+ dnl Checks for header files.
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
--- /dev/null
+--- build/xmlsec1-1.2.14/include/xmlsec/xmlsec.h.ORIGINAL 2009-12-05 15:19:18.000000000 -0600
++++ build/xmlsec1-1.2.14/include/xmlsec/xmlsec.h 2011-02-13 03:09:42.917240245 -0600
+@@ -11,16 +11,16 @@
+ #ifndef __XMLSEC_H__
+ #define __XMLSEC_H__
+
+-#ifdef __cplusplus
+-extern "C" {
+-#endif /* __cplusplus */
+-
+ #include <libxml/tree.h>
+
+ #include <xmlsec/version.h>
+ #include <xmlsec/exports.h>
+ #include <xmlsec/strings.h>
+
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
+ /***********************************************************************
+ *
+ * Basic types to make ports to exotic platforms easier
--- /dev/null
+--- build/xmlsec1-1.2.14/config.sub
++++ build/xmlsec1-1.2.14/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1275,7 +1275,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+--- misc/xmlsec1-1.2.14/configure.in Wed Jun 30 11:55:37 2010
++++ misc/build/xmlsec1-1.2.14/configure.in Wed Jun 30 11:53:55 2010
+@@ -231,7 +231,7 @@
+ if test "z$LIBXML_FOUND" = "zno" ; then
+ if test "z$with_libxml" != "zyes" ; then
+ AC_PATH_PROG([LIBXML_CONFIG], [$LIBXML_CONFIG], [],
+- [$with_libxml/bin:$PATH])
++ [$with_libxml${with_libxml:+/bin:}$PATH])
+ fi
+ AC_MSG_CHECKING([libxml2 $LIBXML_CONFIG ])
+ if ! LIBXML_VERSION=`$LIBXML_CONFIG --version 2>/dev/null`; then
+@@ -296,7 +296,7 @@
+ if test "z$LIBXSLT_FOUND" = "zno" ; then
+ if test "z$with_libxslt" != "zyes" ; then
+ AC_PATH_PROG([LIBXSLT_CONFIG], [$LIBXSLT_CONFIG], [],
+- [$with_libxslt/bin:$PATH])
++ [$with_libxslt${with_libxslt:+/bin:}:$PATH])
+ fi
+ AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION)
+ if ! LIBXSLT_VERSION=`$LIBXSLT_CONFIG --version 2>/dev/null`; then
--- /dev/null
+--- misc/xmlsec1-1.2.14/Makefile.am
++++ misc/build/xmlsec1-1.2.14/Makefile.am
+@@ -1,8 +1,9 @@
+ NULL =
+
+ SAFE_VERSION = @XMLSEC_VERSION_SAFE@
+-SUBDIRS = include src apps man docs
+-TEST_APP = apps/xmlsec1$(EXEEXT)
++#Do not build xmlsec1 app. It is not needed. Also the libtool includes
++#a -L/path_to_lib_dir which may contain an incompatible lixbml2.
++SUBDIRS = include src man docs
+ DEFAULT_CRYPTO = @XMLSEC_CRYPTO@
+
+ bin_SCRIPTS = xmlsec1-config
+--- misc/xmlsec1-1.2.14/Makefile.in 2009-06-25 22:53:34.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/Makefile.in 2009-10-01 10:32:48.708515261 +0200
+@@ -341,8 +341,9 @@
+ top_srcdir = @top_srcdir@
+ NULL =
+ SAFE_VERSION = @XMLSEC_VERSION_SAFE@
+-SUBDIRS = include src apps man docs
+-TEST_APP = apps/xmlsec1$(EXEEXT)
++#Do not build xmlsec1 app. It is not needed. Also the libtool includes
++#a -L/path_to_lib_dir which may contain an incompatible lixbml2.
++SUBDIRS = include src man docs
+ DEFAULT_CRYPTO = @XMLSEC_CRYPTO@
+ bin_SCRIPTS = xmlsec1-config
+ pkgconfig_DATA = xmlsec1.pc @XMLSEC_CRYPTO_PC_FILES_LIST@
+--- misc/xmlsec1-1.2.14/configure.in 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/configure.in 2009-10-01 10:28:50.990755126 +0200
+@@ -192,8 +192,8 @@
+ dnl ==========================================================================
+ LIBXML_MIN_VERSION="2.7.4"
+ LIBXML_CONFIG="xml2-config"
+-LIBXML_CFLAGS=""
+-LIBXML_LIBS=""
++LIBXML_CFLAGS="$LIBXML_CFLAGS"
++LIBXML_LIBS="$LIBXML_LIBS"
+ LIBXML_FOUND="no"
+ AC_ARG_WITH(libxml,
+ [ --with-libxml=[PFX] libxml2 location]
+@@ -202,6 +202,8 @@
+ [ --with-libxml-src=[PFX] not installed yet libxml2 location]
+ )
+
++if test "z$LIBXML_CFLAGS" = "z" -o "z$LIBXML_LIBS" = "z"; then
++
+ if test "z$with_libxml" = "zno" -o "z$with_libxml_src" = "zno"; then
+ AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION)
+ AC_MSG_ERROR(libxml2 >= $LIBXML_MIN_VERSION is required for $XMLSEC_PACKAGE)
+@@ -245,6 +247,8 @@
+ fi
+ fi
+
++fi
++
+ AC_SUBST(LIBXML_CFLAGS)
+ AC_SUBST(LIBXML_LIBS)
+ AC_SUBST(LIBXML_CONFIG)
+@@ -555,12 +559,26 @@
+
+ XMLSEC_NO_NSS="1"
+ MOZILLA_MIN_VERSION="1.4"
++if test "z$MOZ_FLAVOUR" = "zfirefox" ; then
++ MOZILLA_MIN_VERSION="1.0"
++fi
+ NSS_MIN_VERSION="3.2"
+ NSPR_MIN_VERSION="4.0"
+ NSS_CFLAGS=""
+ NSS_LIBS=""
+-NSS_LIBS_LIST="-lnss3 -lsmime3"
+-NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4"
++
++case $host_os in
++cygwin* | mingw* | pw32*)
++ NSS_LIBS_LIST="-lnss3 -lsmime3"
++ NSPR_LIBS_LIST="-lnspr4"
++ ;;
++
++*)
++ NSS_LIBS_LIST="-lnss3 -lsmime3"
++ NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4"
++ ;;
++esac
++
+ NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss"
+ NSS_FOUND="no"
+ NSPR_PACKAGE=mozilla-nspr
+@@ -586,6 +604,16 @@
+ dnl We are going to try all options
+ dnl
+ if test "z$NSS_FOUND" = "zno" ; then
++ PKG_CHECK_MODULES(NSS, $MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION,
++ [NSS_FOUND=yes NSPR_PACKAGE=$MOZ_FLAVOUR-nspr NSS_PACKAGE=$MOZ_FLAVOUR-nss],
++ [NSS_FOUND=no])
++ fi
++ if test "z$NSS_FOUND" = "zno" ; then
++ PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8,
++ [NSS_FOUND=yes NSPR_PACKAGE=nspr NSS_PACKAGE=nss],
++ [NSS_FOUND=no])
++ fi
++ if test "z$NSS_FOUND" = "zno" ; then
+ PKG_CHECK_MODULES(NSS, mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION,
+ [NSS_FOUND=yes NSPR_PACKAGE=mozilla-nspr NSS_PACKAGE=mozilla-nss],
+ [NSS_FOUND=no])
+@@ -612,8 +640,8 @@
+ ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION
+ fi
+
+- ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name"
+- ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name"
++ ac_nss_lib_dir="${WORKDIR}/UnpackedTarball/nss/dist/out/lib"
++ ac_nss_inc_dir="${WORKDIR}/UnpackedTarball/nss/dist/out/include ${WORKDIR}/UnpackedTarball/nss/dist/public"
+
+ AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION)
+ NSPR_INCLUDES_FOUND="no"
+@@ -634,21 +662,21 @@
+ NSPR_PRINIT_H="$with_nspr/include/prinit.h"
+ else
+ for dir in $ac_nss_inc_dir ; do
+- if test -f $dir/nspr/prinit.h ; then
++ if test -f $dir/prinit.h ; then
+ dnl do not add -I/usr/include because compiler does it anyway
+ if test "z$dir" = "z/usr/include" ; then
+ NSPR_CFLAGS=""
+ else
+- NSPR_CFLAGS="-I$dir/nspr"
++ NSPR_CFLAGS="-I$dir"
+ fi
+ NSPR_INCLUDES_FOUND="yes"
+- NSPR_PRINIT_H="$dir/nspr/prinit.h"
++ NSPR_PRINIT_H="$dir/prinit.h"
+ break
+ fi
+ done
+
+ for dir in $ac_nss_lib_dir ; do
+- if test -f $dir/libnspr4$shrext ; then
++ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
+ dnl do not add -L/usr/lib because compiler does it anyway
+ if test "z$dir" = "z/usr/lib" ; then
+ NSPR_LIBS="$NSPR_LIBS_LIST"
+@@ -719,7 +747,7 @@
+ done
+
+ for dir in $ac_nss_lib_dir ; do
+- if test -f $dir/libnss3$shrext ; then
++ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
+ dnl do not add -L/usr/lib because compiler does it anyway
+ if test "z$dir" = "z/usr/lib" ; then
+ NSS_LIBS="$NSS_LIBS_LIST"
+@@ -738,7 +766,7 @@
+
+ if test "z$NSS_INCLUDES_FOUND" = "zyes" -a "z$NSS_LIBS_FOUND" = "zyes" ; then
+ OLD_CPPFLAGS=$CPPFLAGS
+- CPPFLAGS="$NSS_CFLAGS"
++ CPPFLAGS="$NSS_CFLAGS $NSPR_CFLAGS"
+ AC_EGREP_CPP(yes,[
+ #include <nss.h>
+ #if NSS_VMAJOR >= 3 && NSS_VMINOR >= 2
+--- misc/xmlsec1-1.2.14/win32/Makefile.msvc 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/win32/Makefile.msvc 2009-10-01 10:28:50.997747312 +0200
+@@ -376,7 +376,7 @@
+ XMLSEC_OPENSSL_SOLIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib
+ XMLSEC_OPENSSL_ALIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib
+
+-XMLSEC_NSS_SOLIBS = smime3.lib ssl3.lib nss3.lib libnspr4.lib libplds4.lib libplc4.lib kernel32.lib user32.lib gdi32.lib
++XMLSEC_NSS_SOLIBS = smime3.lib nss3.lib nspr4.lib kernel32.lib user32.lib gdi32.lib
+ XMLSEC_NSS_ALIBS = smime3.lib ssl3.lib nss3.lib libnspr4_s.lib libplds4_s.lib libplc4_s.lib kernel32.lib user32.lib gdi32.lib
+
+ XMLSEC_MSCRYPTO_SOLIBS = kernel32.lib user32.lib gdi32.lib Crypt32.lib Advapi32.lib
--- /dev/null
+--- misc/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.am 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.am 2009-09-21 14:02:48.563253008 +0200
+@@ -3,6 +3,7 @@
+ xmlsecmscryptoincdir = $(includedir)/xmlsec1/xmlsec/mscrypto
+
+ xmlsecmscryptoinc_HEADERS = \
++akmngr.h \
+ app.h \
+ certkeys.h \
+ crypto.h \
+--- misc/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.in 2009-06-25 22:53:30.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.in 2009-09-21 14:02:48.571021349 +0200
+@@ -281,6 +281,7 @@
+ NULL =
+ xmlsecmscryptoincdir = $(includedir)/xmlsec1/xmlsec/mscrypto
+ xmlsecmscryptoinc_HEADERS = \
++akmngr.h \
+ app.h \
+ certkeys.h \
+ crypto.h \
+--- misc/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.am 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.am 2009-09-21 14:02:48.577933031 +0200
+@@ -10,6 +10,9 @@
+ keysstore.h \
+ pkikeys.h \
+ x509.h \
++akmngr.h \
++tokens.h \
++ciphers.h \
+ $(NULL)
+
+ install-exec-hook:
+--- misc/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.in 2009-06-25 22:53:31.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.in 2009-09-21 14:02:48.585376325 +0200
+@@ -288,6 +288,9 @@
+ keysstore.h \
+ pkikeys.h \
+ x509.h \
++akmngr.h \
++tokens.h \
++ciphers.h \
+ $(NULL)
+
+ all: all-am
+--- misc/xmlsec1-1.2.14/include/xmlsec/nss/app.h 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/app.h 2009-09-21 14:02:48.612847068 +0200
+@@ -22,6 +22,9 @@
+ #include <xmlsec/keysmngr.h>
+ #include <xmlsec/transforms.h>
+
++#include <xmlsec/nss/tokens.h>
++#include <xmlsec/nss/akmngr.h>
++
+ /**
+ * Init/shutdown
+ */
+@@ -36,6 +39,8 @@
+ xmlSecKeyPtr key);
+ XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr,
+ const char* uri);
++XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrAdoptKeySlot(xmlSecKeysMngrPtr mngr,
++ xmlSecNssKeySlotPtr keySlot);
+ XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr,
+ const char* filename,
+ xmlSecKeyDataType type);
+--- misc/xmlsec1-1.2.14/include/xmlsec/nss/keysstore.h 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/keysstore.h 2009-09-21 14:02:48.626261748 +0200
+@@ -16,6 +16,8 @@
+ #endif /* __cplusplus */
+
+ #include <xmlsec/xmlsec.h>
++#include <xmlsec/keysmngr.h>
++#include <xmlsec/nss/tokens.h>
+
+ /****************************************************************************
+ *
+@@ -31,6 +33,8 @@
+ XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecNssKeysStoreGetKlass (void);
+ XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKey (xmlSecKeyStorePtr store,
+ xmlSecKeyPtr key);
++XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKeySlot(xmlSecKeyStorePtr store,
++ xmlSecNssKeySlotPtr keySlot);
+ XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreLoad (xmlSecKeyStorePtr store,
+ const char *uri,
+ xmlSecKeysMngrPtr keysMngr);
+--- misc/xmlsec1-1.2.14/src/nss/Makefile.am 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/Makefile.am 2009-09-21 14:02:48.591560472 +0200
+@@ -35,6 +35,9 @@
+ kw_des.c \
+ kw_aes.c \
+ globals.h \
++ akmngr.c \
++ keywrapers.c \
++ tokens.c \
+ $(NULL)
+
+ if SHAREDLIB_HACK
+--- misc/xmlsec1-1.2.14/src/nss/Makefile.in 2009-06-25 22:53:33.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/Makefile.in 2009-09-21 14:02:48.599339718 +0200
+@@ -72,7 +72,8 @@
+ am__libxmlsec1_nss_la_SOURCES_DIST = app.c bignum.c ciphers.c crypto.c \
+ digests.c hmac.c pkikeys.c signatures.c symkeys.c x509.c \
+ x509vfy.c keysstore.c keytrans.c kw_des.c kw_aes.c globals.h \
+- ../strings.c
++ ../strings.c \
++ akmngr.c keywrapers.c tokens.c
+ am__objects_1 =
+ @SHAREDLIB_HACK_TRUE@am__objects_2 = libxmlsec1_nss_la-strings.lo
+ am_libxmlsec1_nss_la_OBJECTS = libxmlsec1_nss_la-app.lo \
+@@ -83,6 +84,8 @@
+ libxmlsec1_nss_la-x509.lo libxmlsec1_nss_la-x509vfy.lo \
+ libxmlsec1_nss_la-keysstore.lo libxmlsec1_nss_la-keytrans.lo \
+ libxmlsec1_nss_la-kw_des.lo libxmlsec1_nss_la-kw_aes.lo \
++ libxmlsec1_nss_la-akmngr.lo libxmlsec1_nss_la-keywrapers.lo \
++ libxmlsec1_nss_la-tokens.lo \
+ $(am__objects_1) $(am__objects_2)
+ libxmlsec1_nss_la_OBJECTS = $(am_libxmlsec1_nss_la_OBJECTS)
+ libxmlsec1_nss_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+@@ -333,6 +336,7 @@
+ libxmlsec1_nss_la_SOURCES = app.c bignum.c ciphers.c crypto.c \
+ digests.c hmac.c pkikeys.c signatures.c symkeys.c x509.c \
+ x509vfy.c keysstore.c keytrans.c kw_des.c kw_aes.c globals.h \
++ akmngr.c keywrapers.c tokens.c \
+ $(NULL) $(am__append_1)
+ libxmlsec1_nss_la_LIBADD = \
+ ../libxmlsec1.la \
+@@ -439,6 +443,9 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-symkeys.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-x509.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-x509vfy.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-akmngr.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-tokens.Plo@am__quote@
+
+ .c.o:
+ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@@ -468,6 +475,27 @@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-app.lo `test -f 'app.c' || echo '$(srcdir)/'`app.c
+
++libxmlsec1_nss_la-akmngr.lo: akmngr.c
++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-akmngr.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Tpo" -c -o libxmlsec1_nss_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Tpo" "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Tpo"; exit 1; fi
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='akmngr.c' object='libxmlsec1_nss_la-akmngr.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c
++
++libxmlsec1_nss_la-keywrapers.lo: keywrapers.c
++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-keywrapers.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Tpo" -c -o libxmlsec1_nss_la-keywrapers.lo `test -f 'keywrapers.c' || echo '$(srcdir)/'`keywrapers.c; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Tpo" "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Tpo"; exit 1; fi
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keywrapers.c' object='libxmlsec1_nss_la-keywrapers.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-keywrapers.lo `test -f 'keywrapers.c' || echo '$(srcdir)/'`keywrapers.c
++
++libxmlsec1_nss_la-tokens.lo: tokens.c
++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-tokens.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_nss_la-tokens.Tpo" -c -o libxmlsec1_nss_la-tokens.lo `test -f 'tokens.c' || echo '$(srcdir)/'`tokens.c; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_nss_la-tokens.Tpo" "$(DEPDIR)/libxmlsec1_nss_la-tokens.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_nss_la-tokens.Tpo"; exit 1; fi
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tokens.c' object='libxmlsec1_nss_la-tokens.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-tokens.lo `test -f 'tokens.c' || echo '$(srcdir)/'`tokens.c
++
+ libxmlsec1_nss_la-bignum.lo: bignum.c
+ @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-bignum.lo -MD -MP -MF $(DEPDIR)/libxmlsec1_nss_la-bignum.Tpo -c -o libxmlsec1_nss_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c
+ @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxmlsec1_nss_la-bignum.Tpo $(DEPDIR)/libxmlsec1_nss_la-bignum.Plo
+--- misc/xmlsec1-1.2.14/src/nss/hmac.c 2009-06-26 06:18:13.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/hmac.c 2009-09-21 14:02:48.649065288 +0200
+@@ -23,8 +23,8 @@
+ #include <xmlsec/transforms.h>
+ #include <xmlsec/errors.h>
+
+-#include <xmlsec/nss/app.h>
+ #include <xmlsec/nss/crypto.h>
++#include <xmlsec/nss/tokens.h>
+
+ /* sizes in bits */
+ #define XMLSEC_NSS_MIN_HMAC_SIZE 80
+@@ -286,13 +286,13 @@
+ keyItem.data = xmlSecBufferGetData(buffer);
+ keyItem.len = xmlSecBufferGetSize(buffer);
+
+- slot = PK11_GetBestSlot(ctx->digestType, NULL);
++ slot = xmlSecNssSlotGet(ctx->digestType);
+ if(slot == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+- "PK11_GetBestSlot",
++ "xmlSecNssSlotGet",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ return(-1);
+ }
+
+--- misc/xmlsec1-1.2.14/src/nss/keysstore.c 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/keysstore.c 2009-09-21 14:02:48.633533885 +0200
+@@ -1,36 +1,56 @@
+ /**
+ * XMLSec library
+ *
+- * Nss keys store that uses Simple Keys Store under the hood. Uses the
+- * Nss DB as a backing store for the finding keys, but the NSS DB is
+- * not written to by the keys store.
+- * So, if store->findkey is done and the key is not found in the simple
+- * keys store, the NSS DB is looked up.
+- * If store is called to adopt a key, that key is not written to the NSS
+- * DB.
+- * Thus, the NSS DB can be used to pre-load keys and becomes an alternate
+- * source of keys for xmlsec
+- *
+ * This is free software; see Copyright file in the source
+ * distribution for precise wording.
+ *
+ * Copyright (c) 2003 America Online, Inc. All rights reserved.
+ */
++
++/**
++ * NSS key store uses a key list and a slot list as the key repository. NSS slot
++ * list is a backup repository for the finding keys. If a key is not found from
++ * the key list, the NSS slot list is looked up.
++ *
++ * Any key in the key list will not save to pkcs11 slot. When a store to called
++ * to adopt a key, the key is resident in the key list; While a store to called
++ * to set a is resident in the key list; While a store to called to set a slot
++ * list, which means that the keys in the listed slot can be used for xml sign-
++ * nature or encryption.
++ *
++ * Then, a user can adjust slot list to effect the crypto behaviors of xmlSec.
++ *
++ * The framework will decrease the user interfaces to administrate xmlSec crypto
++ * engine. He can only focus on NSS layer functions. For examples, after the
++ * user set up a slot list handler to the keys store, he do not need to do any
++ * other work atop xmlSec interfaces, his action on the slot list handler, such
++ * as add a token to, delete a token from the list, will directly effect the key
++ * store behaviors.
++ *
++ * For example, a scenariio:
++ * 0. Create a slot list;( NSS interfaces )
++ * 1. Create a keys store;( xmlSec interfaces )
++ * 2. Set slot list with the keys store;( xmlSec Interfaces )
++ * 3. Add a slot to the slot list;( NSS interfaces )
++ * 4. Perform xml signature; ( xmlSec Interfaces )
++ * 5. Deleter a slot from the slot list;( NSS interfaces )
++ * 6. Perform xml encryption; ( xmlSec Interfaces )
++ * 7. Perform xml signature;( xmlSec Interfaces )
++ * 8. Destroy the keys store;( xmlSec Interfaces )
++ * 8. Destroy the slot list.( NSS Interfaces )
++ */
+ #include "globals.h"
+
+ #include <stdlib.h>
+ #include <string.h>
+
+ #include <nss.h>
+-#include <cert.h>
+ #include <pk11func.h>
++#include <prinit.h>
+ #include <keyhi.h>
+
+-#include <libxml/tree.h>
+-
+ #include <xmlsec/xmlsec.h>
+-#include <xmlsec/buffer.h>
+-#include <xmlsec/base64.h>
++#include <xmlsec/keys.h>
+ #include <xmlsec/errors.h>
+ #include <xmlsec/xmltree.h>
+
+@@ -38,82 +58,461 @@
+
+ #include <xmlsec/nss/crypto.h>
+ #include <xmlsec/nss/keysstore.h>
+-#include <xmlsec/nss/x509.h>
++#include <xmlsec/nss/tokens.h>
++#include <xmlsec/nss/ciphers.h>
+ #include <xmlsec/nss/pkikeys.h>
+
+ /****************************************************************************
+ *
+- * Nss Keys Store. Uses Simple Keys Store under the hood
++ * Internal NSS key store context
+ *
+- * Simple Keys Store ptr is located after xmlSecKeyStore
++ * This context is located after xmlSecKeyStore
+ *
+ ***************************************************************************/
++typedef struct _xmlSecNssKeysStoreCtx xmlSecNssKeysStoreCtx ;
++typedef struct _xmlSecNssKeysStoreCtx* xmlSecNssKeysStoreCtxPtr ;
++
++struct _xmlSecNssKeysStoreCtx {
++ xmlSecPtrListPtr keyList ;
++ xmlSecPtrListPtr slotList ;
++} ;
++
+ #define xmlSecNssKeysStoreSize \
+- (sizeof(xmlSecKeyStore) + sizeof(xmlSecKeyStorePtr))
++ ( sizeof( xmlSecKeyStore ) + sizeof( xmlSecNssKeysStoreCtx ) )
+
+-#define xmlSecNssKeysStoreGetSS(store) \
+- ((xmlSecKeyStoreCheckSize((store), xmlSecNssKeysStoreSize)) ? \
+- (xmlSecKeyStorePtr*)(((xmlSecByte*)(store)) + sizeof(xmlSecKeyStore)) : \
+- (xmlSecKeyStorePtr*)NULL)
+-
+-static int xmlSecNssKeysStoreInitialize (xmlSecKeyStorePtr store);
+-static void xmlSecNssKeysStoreFinalize (xmlSecKeyStorePtr store);
+-static xmlSecKeyPtr xmlSecNssKeysStoreFindKey (xmlSecKeyStorePtr store,
+- const xmlChar* name,
+- xmlSecKeyInfoCtxPtr keyInfoCtx);
++#define xmlSecNssKeysStoreGetCtx( data ) \
++ ( ( xmlSecNssKeysStoreCtxPtr )( ( ( xmlSecByte* )( data ) ) + sizeof( xmlSecKeyStore ) ) )
+
+-static xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = {
+- sizeof(xmlSecKeyStoreKlass),
+- xmlSecNssKeysStoreSize,
++int xmlSecNssKeysStoreAdoptKeySlot(
++ xmlSecKeyStorePtr store ,
++ xmlSecNssKeySlotPtr keySlot
++) {
++ xmlSecNssKeysStoreCtxPtr context = NULL ;
++
++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ;
++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ;
++ context = xmlSecNssKeysStoreGetCtx( store ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecNssKeysStoreGetCtx" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( context->slotList == NULL ) {
++ if( ( context->slotList = xmlSecPtrListCreate( xmlSecNssKeySlotListId ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecPtrListCreate" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++ }
++
++ if( !xmlSecPtrListCheckId( context->slotList , xmlSecNssKeySlotListId ) ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecPtrListCheckId" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( xmlSecPtrListAdd( context->slotList , keySlot ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecPtrListAdd" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++ return 0 ;
++}
+
+- /* data */
+- BAD_CAST "NSS-keys-store", /* const xmlChar* name; */
+-
+- /* constructors/destructor */
+- xmlSecNssKeysStoreInitialize, /* xmlSecKeyStoreInitializeMethod initialize; */
+- xmlSecNssKeysStoreFinalize, /* xmlSecKeyStoreFinalizeMethod finalize; */
+- xmlSecNssKeysStoreFindKey, /* xmlSecKeyStoreFindKeyMethod findKey; */
+-
+- /* reserved for the future */
+- NULL, /* void* reserved0; */
+- NULL, /* void* reserved1; */
+-};
++int xmlSecNssKeysStoreAdoptKey(
++ xmlSecKeyStorePtr store ,
++ xmlSecKeyPtr key
++) {
++ xmlSecNssKeysStoreCtxPtr context = NULL ;
++
++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ;
++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ;
++
++ context = xmlSecNssKeysStoreGetCtx( store ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecNssKeysStoreGetCtx" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( context->keyList == NULL ) {
++ if( ( context->keyList = xmlSecPtrListCreate( xmlSecKeyPtrListId ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecPtrListCreate" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++ }
++
++ if( !xmlSecPtrListCheckId( context->keyList , xmlSecKeyPtrListId ) ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecPtrListCheckId" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( xmlSecPtrListAdd( context->keyList , key ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecPtrListAdd" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
+
+-/**
+- * xmlSecNssKeysStoreGetKlass:
+- *
+- * The Nss list based keys store klass.
++ return 0 ;
++}
++
++/*
++ * xmlSecKeyStoreInitializeMethod:
++ * @store: the store.
++ *
++ * Keys store specific initialization method.
+ *
+- * Returns: Nss list based keys store klass.
++ * Returns 0 on success or a negative value if an error occurs.
+ */
+-xmlSecKeyStoreId
+-xmlSecNssKeysStoreGetKlass(void) {
+- return(&xmlSecNssKeysStoreKlass);
++static int
++xmlSecNssKeysStoreInitialize(
++ xmlSecKeyStorePtr store
++) {
++ xmlSecNssKeysStoreCtxPtr context = NULL ;
++
++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ;
++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ;
++
++ context = xmlSecNssKeysStoreGetCtx( store ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecNssKeysStoreGetCtx" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ context->keyList = NULL ;
++ context->slotList = NULL ;
++
++ return 0 ;
+ }
+
+ /**
+- * xmlSecNssKeysStoreAdoptKey:
+- * @store: the pointer to Nss keys store.
+- * @key: the pointer to key.
+- *
+- * Adds @key to the @store.
+ *
+- * Returns: 0 on success or a negative value if an error occurs.
++ * xmlSecKeyStoreFinalizeMethod:
++ * @store: the store.
++ *
++ * Keys store specific finalization (destroy) method.
+ */
+-int
+-xmlSecNssKeysStoreAdoptKey(xmlSecKeyStorePtr store, xmlSecKeyPtr key) {
+- xmlSecKeyStorePtr *ss;
+-
+- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1);
+- xmlSecAssert2((key != NULL), -1);
++void
++xmlSecNssKeysStoreFinalize(
++ xmlSecKeyStorePtr store
++) {
++ xmlSecNssKeysStoreCtxPtr context = NULL ;
++
++ xmlSecAssert( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) ) ;
++ xmlSecAssert( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) ) ;
++
++ context = xmlSecNssKeysStoreGetCtx( store ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecNssKeysStoreGetCtx" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return ;
++ }
++
++ if( context->keyList != NULL ) {
++ xmlSecPtrListDestroy( context->keyList ) ;
++ context->keyList = NULL ;
++ }
++
++ if( context->slotList != NULL ) {
++ xmlSecPtrListDestroy( context->slotList ) ;
++ context->slotList = NULL ;
++ }
++}
++
++xmlSecKeyPtr
++xmlSecNssKeysStoreFindKeyFromSlot(
++ PK11SlotInfo* slot,
++ const xmlChar* name,
++ xmlSecKeyInfoCtxPtr keyInfoCtx
++) {
++ xmlSecKeyPtr key = NULL ;
++ xmlSecKeyDataPtr data = NULL ;
++ int length ;
++
++ xmlSecAssert2( slot != NULL , NULL ) ;
++ xmlSecAssert2( name != NULL , NULL ) ;
++ xmlSecAssert2( keyInfoCtx != NULL , NULL ) ;
++
++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypeSymmetric ) == xmlSecKeyDataTypeSymmetric ) {
++ PK11SymKey* symKey ;
++ PK11SymKey* curKey ;
++
++ /* Find symmetric key from the slot by name */
++ symKey = PK11_ListFixedKeysInSlot( slot , ( char* )name , NULL ) ;
++ for( curKey = symKey ; curKey != NULL ; curKey = PK11_GetNextSymKey( curKey ) ) {
++ /* Check the key request */
++ length = PK11_GetKeyLength( curKey ) ;
++ length *= 8 ;
++ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) &&
++ ( length > 0 ) &&
++ ( length < keyInfoCtx->keyReq.keyBitsSize ) )
++ continue ;
++
++ /* We find a eligible key */
++ data = xmlSecNssSymKeyDataKeyAdopt( curKey ) ;
++ if( data == NULL ) {
++ /* Do nothing */
++ }
++ break ;
++ }
++
++ /* Destroy the sym key list */
++ for( curKey = symKey ; curKey != NULL ; ) {
++ symKey = curKey ;
++ curKey = PK11_GetNextSymKey( symKey ) ;
++ PK11_FreeSymKey( symKey ) ;
++ }
++ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) {
++ SECKEYPublicKeyList* pubKeyList ;
++ SECKEYPublicKey* pubKey ;
++ SECKEYPublicKeyListNode* curPub ;
++
++ /* Find asymmetric key from the slot by name */
++ pubKeyList = PK11_ListPublicKeysInSlot( slot , ( char* )name ) ;
++ pubKey = NULL ;
++ curPub = PUBKEY_LIST_HEAD(pubKeyList);
++ for( ; !PUBKEY_LIST_END(curPub, pubKeyList) ; curPub = PUBKEY_LIST_NEXT( curPub ) ) {
++ /* Check the key request */
++ length = SECKEY_PublicKeyStrength( curPub->key ) ;
++ length *= 8 ;
++ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) &&
++ ( length > 0 ) &&
++ ( length < keyInfoCtx->keyReq.keyBitsSize ) )
++ continue ;
++
++ /* We find a eligible key */
++ pubKey = curPub->key ;
++ break ;
++ }
++
++ if( pubKey != NULL ) {
++ data = xmlSecNssPKIAdoptKey( NULL, pubKey ) ;
++ if( data == NULL ) {
++ /* Do nothing */
++ }
++ }
++
++ /* Destroy the public key list */
++ SECKEY_DestroyPublicKeyList( pubKeyList ) ;
++ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) {
++ SECKEYPrivateKeyList* priKeyList = NULL ;
++ SECKEYPrivateKey* priKey = NULL ;
++ SECKEYPrivateKeyListNode* curPri ;
++
++ /* Find asymmetric key from the slot by name */
++ priKeyList = PK11_ListPrivKeysInSlot( slot , ( char* )name , NULL ) ;
++ priKey = NULL ;
++ curPri = PRIVKEY_LIST_HEAD(priKeyList);
++ for( ; !PRIVKEY_LIST_END(curPri, priKeyList) ; curPri = PRIVKEY_LIST_NEXT( curPri ) ) {
++ /* Check the key request */
++ length = PK11_SignatureLen( curPri->key ) ;
++ length *= 8 ;
++ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) &&
++ ( length > 0 ) &&
++ ( length < keyInfoCtx->keyReq.keyBitsSize ) )
++ continue ;
++
++ /* We find a eligible key */
++ priKey = curPri->key ;
++ break ;
++ }
++
++ if( priKey != NULL ) {
++ data = xmlSecNssPKIAdoptKey( priKey, NULL ) ;
++ if( data == NULL ) {
++ /* Do nothing */
++ }
++ }
++
++ /* Destroy the private key list */
++ SECKEY_DestroyPrivateKeyList( priKeyList ) ;
++ }
++
++ /* If we have gotten the key value */
++ if( data != NULL ) {
++ if( ( key = xmlSecKeyCreate() ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecKeyCreate" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ xmlSecKeyDataDestroy( data ) ;
++ return NULL ;
++ }
++
++ if( xmlSecKeySetValue( key , data ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecKeySetValue" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ xmlSecKeyDestroy( key ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return NULL ;
++ }
++ }
+
+- ss = xmlSecNssKeysStoreGetSS(store);
+- xmlSecAssert2(((ss != NULL) && (*ss != NULL) &&
+- (xmlSecKeyStoreCheckId(*ss, xmlSecSimpleKeysStoreId))), -1);
++ return(key);
++}
++
++/**
++ * xmlSecKeyStoreFindKeyMethod:
++ * @store: the store.
++ * @name: the desired key name.
++ * @keyInfoCtx: the pointer to key info context.
++ *
++ * Keys store specific find method. The caller is responsible for destroying
++ * the returned key using #xmlSecKeyDestroy method.
++ *
++ * Returns the pointer to a key or NULL if key is not found or an error occurs.
++ */
++static xmlSecKeyPtr
++xmlSecNssKeysStoreFindKey(
++ xmlSecKeyStorePtr store ,
++ const xmlChar* name ,
++ xmlSecKeyInfoCtxPtr keyInfoCtx
++) {
++ xmlSecNssKeysStoreCtxPtr context = NULL ;
++ xmlSecKeyPtr key = NULL ;
++ xmlSecNssKeySlotPtr keySlot = NULL ;
++ xmlSecSize pos ;
++ xmlSecSize size ;
++
++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , NULL ) ;
++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , NULL ) ;
++ xmlSecAssert2( keyInfoCtx != NULL , NULL ) ;
++
++ context = xmlSecNssKeysStoreGetCtx( store ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecNssKeysStoreGetCtx" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return NULL ;
++ }
++
++ /*-
++ * Look for key at keyList at first.
++ */
++ if( context->keyList != NULL ) {
++ size = xmlSecPtrListGetSize( context->keyList ) ;
++ for( pos = 0 ; pos < size ; pos ++ ) {
++ key = ( xmlSecKeyPtr )xmlSecPtrListGetItem( context->keyList , pos ) ;
++ if( key != NULL && xmlSecKeyMatch( key , name , &( keyInfoCtx->keyReq ) ) ) {
++ return xmlSecKeyDuplicate( key ) ;
++ }
++ }
++ }
++
++ /*-
++ * Find the key from slotList
++ */
++ if( context->slotList != NULL ) {
++ PK11SlotInfo* slot = NULL ;
++
++ size = xmlSecPtrListGetSize( context->slotList ) ;
++ for( pos = 0 ; pos < size ; pos ++ ) {
++ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( context->slotList , pos ) ;
++ slot = xmlSecNssKeySlotGetSlot( keySlot ) ;
++ if( slot == NULL ) {
++ continue ;
++ } else {
++ key = xmlSecNssKeysStoreFindKeyFromSlot( slot, name, keyInfoCtx ) ;
++ if( key == NULL ) {
++ continue ;
++ } else {
++ return( key ) ;
++ }
++ }
++ }
++ }
++
++ /*-
++ * Create a session key if we can not find the key from keyList and slotList
++ */
++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypeSession ) == xmlSecKeyDataTypeSession ) {
++ key = xmlSecKeyGenerate( keyInfoCtx->keyReq.keyId , keyInfoCtx->keyReq.keyBitsSize , xmlSecKeyDataTypeSession ) ;
++ if( key == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) ,
++ "xmlSecKeySetValue" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return NULL ;
++ }
++
++ return key ;
++ }
++
++ /**
++ * We have no way to find the key any more.
++ */
++ return NULL ;
++}
++
++static xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = {
++ sizeof( xmlSecKeyStoreKlass ) ,
++ xmlSecNssKeysStoreSize ,
++ BAD_CAST "implicit_nss_keys_store" ,
++ xmlSecNssKeysStoreInitialize ,
++ xmlSecNssKeysStoreFinalize ,
++ xmlSecNssKeysStoreFindKey ,
++ NULL ,
++ NULL
++} ;
+
+- return (xmlSecSimpleKeysStoreAdoptKey(*ss, key));
++/**
++ * xmlSecNssKeysStoreGetKlass:
++ *
++ * The simple list based keys store klass.
++ *
++ */
++xmlSecKeyStoreId
++xmlSecNssKeysStoreGetKlass( void ) {
++ return &xmlSecNssKeysStoreKlass ;
+ }
+
++/**************************
++ * Application routines
++ */
++
+ /**
+ * xmlSecNssKeysStoreLoad:
+ * @store: the pointer to Nss keys store.
+@@ -252,234 +651,147 @@
+ */
+ int
+ xmlSecNssKeysStoreSave(xmlSecKeyStorePtr store, const char *filename, xmlSecKeyDataType type) {
+- xmlSecKeyStorePtr *ss;
++ xmlSecKeyInfoCtx keyInfoCtx;
++ xmlSecNssKeysStoreCtxPtr context ;
++ xmlSecPtrListPtr list;
++ xmlSecKeyPtr key;
++ xmlSecSize i, keysSize;
++ xmlDocPtr doc;
++ xmlNodePtr cur;
++ xmlSecKeyDataPtr data;
++ xmlSecPtrListPtr idsList;
++ xmlSecKeyDataId dataId;
++ xmlSecSize idsSize, j;
++ int ret;
+
+ xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1);
+- xmlSecAssert2((filename != NULL), -1);
+-
+- ss = xmlSecNssKeysStoreGetSS(store);
+- xmlSecAssert2(((ss != NULL) && (*ss != NULL) &&
+- (xmlSecKeyStoreCheckId(*ss, xmlSecSimpleKeysStoreId))), -1);
+-
+- return (xmlSecSimpleKeysStoreSave(*ss, filename, type));
+-}
+-
+-static int
+-xmlSecNssKeysStoreInitialize(xmlSecKeyStorePtr store) {
+- xmlSecKeyStorePtr *ss;
++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ), -1 ) ;
++ xmlSecAssert2(filename != NULL, -1);
+
+- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1);
++ context = xmlSecNssKeysStoreGetCtx( store ) ;
++ xmlSecAssert2( context != NULL, -1 );
+
+- ss = xmlSecNssKeysStoreGetSS(store);
+- xmlSecAssert2((*ss == NULL), -1);
++ list = context->keyList ;
++ xmlSecAssert2( list != NULL, -1 );
++ xmlSecAssert2(xmlSecPtrListCheckId(list, xmlSecKeyPtrListId), -1);
+
+- *ss = xmlSecKeyStoreCreate(xmlSecSimpleKeysStoreId);
+- if(*ss == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
++ /* create doc */
++ doc = xmlSecCreateTree(BAD_CAST "Keys", xmlSecNs);
++ if(doc == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
+- "xmlSecKeyStoreCreate",
++ "xmlSecCreateTree",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "xmlSecSimpleKeysStoreId");
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+- return(0);
+-}
+-
+-static void
+-xmlSecNssKeysStoreFinalize(xmlSecKeyStorePtr store) {
+- xmlSecKeyStorePtr *ss;
+-
+- xmlSecAssert(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId));
+-
+- ss = xmlSecNssKeysStoreGetSS(store);
+- xmlSecAssert((ss != NULL) && (*ss != NULL));
+-
+- xmlSecKeyStoreDestroy(*ss);
+-}
+-
+-static xmlSecKeyPtr
+-xmlSecNssKeysStoreFindKey(xmlSecKeyStorePtr store, const xmlChar* name,
+- xmlSecKeyInfoCtxPtr keyInfoCtx) {
+- xmlSecKeyStorePtr* ss;
+- xmlSecKeyPtr key = NULL;
+- xmlSecKeyPtr retval = NULL;
+- xmlSecKeyReqPtr keyReq = NULL;
+- CERTCertificate *cert = NULL;
+- SECKEYPublicKey *pubkey = NULL;
+- SECKEYPrivateKey *privkey = NULL;
+- xmlSecKeyDataPtr data = NULL;
+- xmlSecKeyDataPtr x509Data = NULL;
+- int ret;
+-
+- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), NULL);
+- xmlSecAssert2(keyInfoCtx != NULL, NULL);
+-
+- ss = xmlSecNssKeysStoreGetSS(store);
+- xmlSecAssert2(((ss != NULL) && (*ss != NULL)), NULL);
+-
+- key = xmlSecKeyStoreFindKey(*ss, name, keyInfoCtx);
+- if (key != NULL) {
+- return (key);
+- }
+-
+- /* Try to find the key in the NSS DB, and construct an xmlSecKey.
+- * we must have a name to lookup keys in NSS DB.
+- */
+- if (name == NULL) {
+- goto done;
+- }
++ idsList = xmlSecKeyDataIdsGet();
++ xmlSecAssert2(idsList != NULL, -1);
+
+- /* what type of key are we looking for?
+- * TBD: For now, we'll look only for public/private keys using the
+- * name as a cert nickname. Later on, we can attempt to find
+- * symmetric keys using PK11_FindFixedKey
+- */
+- keyReq = &(keyInfoCtx->keyReq);
+- if (keyReq->keyType &
+- (xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate)) {
+- cert = CERT_FindCertByNickname (CERT_GetDefaultCertDB(), (char *)name);
+- if (cert == NULL) {
+- goto done;
+- }
++ keysSize = xmlSecPtrListGetSize(list);
++ idsSize = xmlSecPtrListGetSize(idsList);
++ for(i = 0; i < keysSize; ++i) {
++ key = (xmlSecKeyPtr)xmlSecPtrListGetItem(list, i);
++ xmlSecAssert2(key != NULL, -1);
+
+- if (keyReq->keyType & xmlSecKeyDataTypePublic) {
+- pubkey = CERT_ExtractPublicKey(cert);
+- if (pubkey == NULL) {
++ cur = xmlSecAddChild(xmlDocGetRootElement(doc), xmlSecNodeKeyInfo, xmlSecDSigNs);
++ if(cur == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "CERT_ExtractPublicKey",
+- XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- goto done;
+- }
++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
++ "xmlSecAddChild",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "node=%s",
++ xmlSecErrorsSafeString(xmlSecNodeKeyInfo));
++ xmlFreeDoc(doc);
++ return(-1);
+ }
+
+- if (keyReq->keyType & xmlSecKeyDataTypePrivate) {
+- privkey = PK11_FindKeyByAnyCert(cert, NULL);
+- if (privkey == NULL) {
++ /* special data key name */
++ if(xmlSecKeyGetName(key) != NULL) {
++ if(xmlSecAddChild(cur, xmlSecNodeKeyName, xmlSecDSigNs) == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "PK11_FindKeyByAnyCert",
+- XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- goto done;
++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
++ "xmlSecAddChild",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "node=%s",
++ xmlSecErrorsSafeString(xmlSecNodeKeyName));
++ xmlFreeDoc(doc);
++ return(-1);
+ }
+ }
+
+- data = xmlSecNssPKIAdoptKey(privkey, pubkey);
+- if(data == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssPKIAdoptKey",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- goto done;
+- }
+- privkey = NULL;
+- pubkey = NULL;
+-
+- key = xmlSecKeyCreate();
+- if (key == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecKeyCreate",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return (NULL);
+- }
+-
+- x509Data = xmlSecKeyDataCreate(xmlSecNssKeyDataX509Id);
+- if(x509Data == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecKeyDataCreate",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "transform=%s",
+- xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecNssKeyDataX509Id)));
+- goto done;
+- }
++ /* create nodes for other keys data */
++ for(j = 0; j < idsSize; ++j) {
++ dataId = (xmlSecKeyDataId)xmlSecPtrListGetItem(idsList, j);
++ xmlSecAssert2(dataId != xmlSecKeyDataIdUnknown, -1);
++
++ if(dataId->dataNodeName == NULL) {
++ continue;
++ }
++
++ data = xmlSecKeyGetData(key, dataId);
++ if(data == NULL) {
++ continue;
++ }
+
+- ret = xmlSecNssKeyDataX509AdoptKeyCert(x509Data, cert);
+- if (ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssKeyDataX509AdoptKeyCert",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "data=%s",
+- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data)));
+- goto done;
+- }
+- cert = CERT_DupCertificate(cert);
+- if (cert == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "CERT_DupCertificate",
+- XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- "data=%s",
+- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data)));
+- goto done;
++ if(xmlSecAddChild(cur, dataId->dataNodeName, dataId->dataNodeNs) == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
++ "xmlSecAddChild",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "node=%s",
++ xmlSecErrorsSafeString(dataId->dataNodeName));
++ xmlFreeDoc(doc);
++ return(-1);
++ }
+ }
+
+- ret = xmlSecNssKeyDataX509AdoptCert(x509Data, cert);
++ ret = xmlSecKeyInfoCtxInitialize(&keyInfoCtx, NULL);
+ if (ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssKeyDataX509AdoptCert",
++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
++ "xmlSecKeyInfoCtxInitialize",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "data=%s",
+- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data)));
+- goto done;
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlFreeDoc(doc);
++ return(-1);
+ }
+- cert = NULL;
+
+- ret = xmlSecKeySetValue(key, data);
+- if (ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecKeySetValue",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "data=%s",
+- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)));
+- goto done;
+- }
+- data = NULL;
++ keyInfoCtx.mode = xmlSecKeyInfoModeWrite;
++ keyInfoCtx.keyReq.keyId = xmlSecKeyDataIdUnknown;
++ keyInfoCtx.keyReq.keyType = type;
++ keyInfoCtx.keyReq.keyUsage = xmlSecKeyDataUsageAny;
+
+- ret = xmlSecKeyAdoptData(key, x509Data);
++ /* finally write key in the node */
++ ret = xmlSecKeyInfoNodeWrite(cur, key, &keyInfoCtx);
+ if (ret < 0) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecKeyAdoptData",
++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
++ "xmlSecKeyInfoNodeWrite",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "data=%s",
+- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data)));
+- goto done;
+- }
+- x509Data = NULL;
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecKeyInfoCtxFinalize(&keyInfoCtx);
++ xmlFreeDoc(doc);
++ return(-1);
++ }
+
+- retval = key;
+- key = NULL;
++ xmlSecKeyInfoCtxFinalize(&keyInfoCtx);
+ }
+
+-done:
+- if (cert != NULL) {
+- CERT_DestroyCertificate(cert);
+- }
+- if (pubkey != NULL) {
+- SECKEY_DestroyPublicKey(pubkey);
+- }
+- if (privkey != NULL) {
+- SECKEY_DestroyPrivateKey(privkey);
+- }
+- if (data != NULL) {
+- xmlSecKeyDataDestroy(data);
+- }
+- if (x509Data != NULL) {
+- xmlSecKeyDataDestroy(x509Data);
+- }
+- if (key != NULL) {
+- xmlSecKeyDestroy(key);
++ /* now write result */
++ ret = xmlSaveFormatFile(filename, doc, 1);
++ if (ret < 0) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)),
++ "xmlSaveFormatFile",
++ XMLSEC_ERRORS_R_XML_FAILED,
++ "filename=%s",
++ xmlSecErrorsSafeString(filename));
++ xmlFreeDoc(doc);
++ return(-1);
+ }
+
+- return (retval);
++ xmlFreeDoc(doc);
++ return(0);
+ }
+--- misc/xmlsec1-1.2.14/src/nss/pkikeys.c 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/pkikeys.c 2009-09-21 14:02:48.657352624 +0200
+@@ -24,6 +24,7 @@
+ #include <xmlsec/nss/crypto.h>
+ #include <xmlsec/nss/bignum.h>
+ #include <xmlsec/nss/pkikeys.h>
++#include <xmlsec/nss/tokens.h>
+
+ /**************************************************************************
+ *
+@@ -115,6 +116,8 @@
+ xmlSecNssPKIKeyDataCtxPtr ctxSrc)
+ {
+ xmlSecNSSPKIKeyDataCtxFree(ctxDst);
++ ctxDst->privkey = NULL ;
++ ctxDst->pubkey = NULL ;
+ if (ctxSrc->privkey != NULL) {
+ ctxDst->privkey = SECKEY_CopyPrivateKey(ctxSrc->privkey);
+ if(ctxDst->privkey == NULL) {
+@@ -588,13 +591,13 @@
+ goto done;
+ }
+
+- slot = PK11_GetBestSlot(CKM_DSA, NULL);
++ slot = xmlSecNssSlotGet(CKM_DSA);
+ if(slot == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "PK11_GetBestSlot",
++ "xmlSecNssSlotGet",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ ret = -1;
+ goto done;
+ }
+@@ -792,14 +795,14 @@
+ if (slot != NULL) {
+ PK11_FreeSlot(slot);
+ }
+- if (ret != 0) {
++
+ if (pubkey != NULL) {
+ SECKEY_DestroyPublicKey(pubkey);
+ }
+ if (data != NULL) {
+ xmlSecKeyDataDestroy(data);
+ }
+- }
++
+ return(ret);
+ }
+
+@@ -818,7 +821,7 @@
+
+ ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key));
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);
++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/
+
+ if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) {
+ /* we can have only private key or public key */
+@@ -940,7 +943,8 @@
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ "PK11_PQG_ParamGen",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- "size=%d", sizeBits);
++ "size=%d, error code=%d", sizeBits, PORT_GetError());
++ ret = -1;
+ goto done;
+ }
+
+@@ -950,11 +954,12 @@
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ "PK11_PQG_VerifyParams",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- "size=%d", sizeBits);
++ "size=%d, error code=%d", sizeBits, PORT_GetError());
++ ret = -1;
+ goto done;
+ }
+
+- slot = PK11_GetBestSlot(CKM_DSA_KEY_PAIR_GEN, NULL);
++ slot = xmlSecNssSlotGet(CKM_DSA_KEY_PAIR_GEN);
+ PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */);
+ privkey = PK11_GenerateKeyPair(slot, CKM_DSA_KEY_PAIR_GEN, pqgParams,
+ &pubkey, PR_FALSE, PR_TRUE, NULL);
+@@ -964,8 +969,9 @@
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ "PK11_GenerateKeyPair",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+
++ ret = -1;
+ goto done;
+ }
+
+@@ -979,6 +985,8 @@
+ goto done;
+ }
+
++ privkey = NULL ;
++ pubkey = NULL ;
+ ret = 0;
+
+ done:
+@@ -991,16 +999,13 @@
+ if (pqgVerify != NULL) {
+ PK11_PQG_DestroyVerify(pqgVerify);
+ }
+- if (ret == 0) {
+- return (0);
+- }
+ if (pubkey != NULL) {
+ SECKEY_DestroyPublicKey(pubkey);
+ }
+ if (privkey != NULL) {
+ SECKEY_DestroyPrivateKey(privkey);
+ }
+- return(-1);
++ return(ret);
+ }
+
+ static xmlSecKeyDataType
+@@ -1010,10 +1015,10 @@
+ xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), xmlSecKeyDataTypeUnknown);
+ ctx = xmlSecNssPKIKeyDataGetCtx(data);
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);
++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/
+ if (ctx->privkey != NULL) {
+ return(xmlSecKeyDataTypePrivate | xmlSecKeyDataTypePublic);
+- } else {
++ } else if( ctx->pubkey != NULL ) {
+ return(xmlSecKeyDataTypePublic);
+ }
+
+@@ -1027,7 +1032,7 @@
+ xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), 0);
+ ctx = xmlSecNssPKIKeyDataGetCtx(data);
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);
++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/
+
+ return(8 * SECKEY_PublicKeyStrength(ctx->pubkey));
+ }
+@@ -1216,13 +1221,13 @@
+ goto done;
+ }
+
+- slot = PK11_GetBestSlot(CKM_RSA_PKCS, NULL);
++ slot = xmlSecNssSlotGet(CKM_RSA_PKCS);
+ if(slot == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "PK11_GetBestSlot",
++ "xmlSecNssSlotGet",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ ret = -1;
+ goto done;
+ }
+@@ -1384,7 +1389,7 @@
+
+ ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key));
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);
++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/
+
+
+ if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) {
+@@ -1455,7 +1460,7 @@
+ params.keySizeInBits = sizeBits;
+ params.pe = 65537;
+
+- slot = PK11_GetBestSlot(CKM_RSA_PKCS_KEY_PAIR_GEN, NULL);
++ slot = xmlSecNssSlotGet(CKM_RSA_PKCS_KEY_PAIR_GEN);
+ PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */);
+ privkey = PK11_GenerateKeyPair(slot, CKM_RSA_PKCS_KEY_PAIR_GEN, ¶ms,
+ &pubkey, PR_FALSE, PR_TRUE, NULL);
+@@ -1525,7 +1530,7 @@
+
+ ctx = xmlSecNssPKIKeyDataGetCtx(data);
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);
++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/
+
+ return(8 * SECKEY_PublicKeyStrength(ctx->pubkey));
+ }
+--- misc/xmlsec1-1.2.14/src/nss/symkeys.c 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/symkeys.c 2009-09-21 14:02:48.620574832 +0200
+@@ -15,20 +15,41 @@
+ #include <stdio.h>
+ #include <string.h>
+
++#include <pk11func.h>
++#include <nss.h>
++
+ #include <xmlsec/xmlsec.h>
+ #include <xmlsec/xmltree.h>
++#include <xmlsec/base64.h>
+ #include <xmlsec/keys.h>
+ #include <xmlsec/keyinfo.h>
+ #include <xmlsec/transforms.h>
+ #include <xmlsec/errors.h>
+
+ #include <xmlsec/nss/crypto.h>
++#include <xmlsec/nss/ciphers.h>
++#include <xmlsec/nss/tokens.h>
+
+ /*****************************************************************************
+ *
+- * Symmetic (binary) keys - just a wrapper for xmlSecKeyDataBinary
++ * Symmetic (binary) keys - a wrapper over slot information and PK11SymKey
+ *
+ ****************************************************************************/
++typedef struct _xmlSecNssSymKeyDataCtx xmlSecNssSymKeyDataCtx ;
++typedef struct _xmlSecNssSymKeyDataCtx* xmlSecNssSymKeyDataCtxPtr ;
++
++struct _xmlSecNssSymKeyDataCtx {
++ CK_MECHANISM_TYPE cipher ; /* the symmetic key mechanism */
++ PK11SlotInfo* slot ; /* the key resident slot */
++ PK11SymKey* symkey ; /* the symmetic key */
++} ;
++
++#define xmlSecNssSymKeyDataSize \
++ ( sizeof( xmlSecKeyData ) + sizeof( xmlSecNssSymKeyDataCtx ) )
++
++#define xmlSecNssSymKeyDataGetCtx( data ) \
++ ( ( xmlSecNssSymKeyDataCtxPtr )( ( ( xmlSecByte* )( data ) ) + sizeof( xmlSecKeyData ) ) )
++
+ static int xmlSecNssSymKeyDataInitialize (xmlSecKeyDataPtr data);
+ static int xmlSecNssSymKeyDataDuplicate (xmlSecKeyDataPtr dst,
+ xmlSecKeyDataPtr src);
+@@ -67,107 +88,743 @@
+ (xmlSecKeyDataIsValid((data)) && \
+ xmlSecNssSymKeyDataKlassCheck((data)->id))
+
++/**
++ * xmlSecNssSymKeyDataAdoptKey:
++ * @data: the pointer to symmetric key data.
++ * @symkey: the symmetric key
++ *
++ * Set the value of symmetric key data.
++ *
++ * Returns 0 on success or a negative value if an error occurs.
++ */
++int
++xmlSecNssSymKeyDataAdoptKey(
++ xmlSecKeyDataPtr data ,
++ PK11SymKey* symkey
++) {
++ xmlSecNssSymKeyDataCtxPtr context = NULL ;
++
++ xmlSecAssert2( xmlSecNssSymKeyDataCheckId( data ), -1 ) ;
++ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), -1 ) ;
++ xmlSecAssert2( symkey != NULL, -1 ) ;
++
++ context = xmlSecNssSymKeyDataGetCtx( data ) ;
++ xmlSecAssert2(context != NULL, -1);
++
++ context->cipher = PK11_GetMechanism( symkey ) ;
++
++ if( context->slot != NULL ) {
++ PK11_FreeSlot( context->slot ) ;
++ context->slot = NULL ;
++ }
++ context->slot = PK11_GetSlotFromKey( symkey ) ;
++
++ if( context->symkey != NULL ) {
++ PK11_FreeSymKey( context->symkey ) ;
++ context->symkey = NULL ;
++ }
++ context->symkey = PK11_ReferenceSymKey( symkey ) ;
++
++ return 0 ;
++}
++
++xmlSecKeyDataPtr xmlSecNssSymKeyDataKeyAdopt(
++ PK11SymKey* symKey
++) {
++ xmlSecKeyDataPtr data = NULL ;
++ CK_MECHANISM_TYPE mechanism = CKM_INVALID_MECHANISM ;
++
++ xmlSecAssert2( symKey != NULL , NULL ) ;
++
++ mechanism = PK11_GetMechanism( symKey ) ;
++ switch( mechanism ) {
++ case CKM_DES3_KEY_GEN :
++ case CKM_DES3_CBC :
++ case CKM_DES3_MAC :
++ data = xmlSecKeyDataCreate( xmlSecNssKeyDataDesId ) ;
++ if( data == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecKeyDataCreate" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ "xmlSecNssKeyDataDesId" ) ;
++ return NULL ;
++ }
++ break ;
++ case CKM_AES_KEY_GEN :
++ case CKM_AES_CBC :
++ case CKM_AES_MAC :
++ data = xmlSecKeyDataCreate( xmlSecNssKeyDataAesId ) ;
++ if( data == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecKeyDataCreate" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ "xmlSecNssKeyDataDesId" ) ;
++ return NULL ;
++ }
++ break ;
++ default :
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ NULL ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ "Unsupported mechanism" ) ;
++ return NULL ;
++ }
++
++ if( xmlSecNssSymKeyDataAdoptKey( data , symKey ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecNssSymKeyDataAdoptKey" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ xmlSecKeyDataDestroy( data ) ;
++ return NULL ;
++ }
++
++ return data ;
++}
++
++
++PK11SymKey*
++xmlSecNssSymKeyDataGetKey(
++ xmlSecKeyDataPtr data
++) {
++ xmlSecNssSymKeyDataCtxPtr ctx;
++ PK11SymKey* symkey ;
++
++ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), NULL);
++ xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize), NULL);
++
++ ctx = xmlSecNssSymKeyDataGetCtx(data);
++ xmlSecAssert2(ctx != NULL, NULL);
++
++ if( ctx->symkey != NULL ) {
++ symkey = PK11_ReferenceSymKey( ctx->symkey ) ;
++ } else {
++ symkey = NULL ;
++ }
++
++ return(symkey);
++}
++
+ static int
+ xmlSecNssSymKeyDataInitialize(xmlSecKeyDataPtr data) {
++ xmlSecNssSymKeyDataCtxPtr ctx;
++
+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1);
+-
+- return(xmlSecKeyDataBinaryValueInitialize(data));
++ xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize), -1);
++
++ ctx = xmlSecNssSymKeyDataGetCtx(data);
++ xmlSecAssert2(ctx != NULL, -1);
++
++ memset( ctx, 0, sizeof(xmlSecNssSymKeyDataCtx));
++
++ /* Set the block cipher mechanism */
++#ifndef XMLSEC_NO_DES
++ if(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDesId)) {
++ ctx->cipher = CKM_DES3_KEY_GEN;
++ } else
++#endif /* XMLSEC_NO_DES */
++
++#ifndef XMLSEC_NO_AES
++ if(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDesId)) {
++ ctx->cipher = CKM_AES_KEY_GEN;
++ } else
++#endif /* XMLSEC_NO_AES */
++
++ if(1) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
++ NULL ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ "Unsupported block cipher" ) ;
++ return(-1) ;
++ }
++
++ return(0);
+ }
+
+ static int
+ xmlSecNssSymKeyDataDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) {
++ xmlSecNssSymKeyDataCtxPtr ctxDst;
++ xmlSecNssSymKeyDataCtxPtr ctxSrc;
++
+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(dst), -1);
++ xmlSecAssert2(xmlSecKeyDataCheckSize(dst, xmlSecNssSymKeyDataSize), -1);
+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(src), -1);
++ xmlSecAssert2(xmlSecKeyDataCheckSize(src, xmlSecNssSymKeyDataSize), -1);
+ xmlSecAssert2(dst->id == src->id, -1);
+-
+- return(xmlSecKeyDataBinaryValueDuplicate(dst, src));
++
++ ctxDst = xmlSecNssSymKeyDataGetCtx(dst);
++ xmlSecAssert2(ctxDst != NULL, -1);
++
++ ctxSrc = xmlSecNssSymKeyDataGetCtx(src);
++ xmlSecAssert2(ctxSrc != NULL, -1);
++
++ ctxDst->cipher = ctxSrc->cipher ;
++
++ if( ctxSrc->slot != NULL ) {
++ if( ctxDst->slot != NULL && ctxDst->slot != ctxSrc->slot ) {
++ PK11_FreeSlot( ctxDst->slot ) ;
++ ctxDst->slot = NULL ;
++ }
++
++ if( ctxDst->slot == NULL && ctxSrc->slot != NULL )
++ ctxDst->slot = PK11_ReferenceSlot( ctxSrc->slot ) ;
++ } else {
++ if( ctxDst->slot != NULL ) {
++ PK11_FreeSlot( ctxDst->slot ) ;
++ ctxDst->slot = NULL ;
++ }
++ }
++
++ if( ctxSrc->symkey != NULL ) {
++ if( ctxDst->symkey != NULL && ctxDst->symkey != ctxSrc->symkey ) {
++ PK11_FreeSymKey( ctxDst->symkey ) ;
++ ctxDst->symkey = NULL ;
++ }
++
++ if( ctxDst->symkey == NULL && ctxSrc->symkey != NULL )
++ ctxDst->symkey = PK11_ReferenceSymKey( ctxSrc->symkey ) ;
++ } else {
++ if( ctxDst->symkey != NULL ) {
++ PK11_FreeSymKey( ctxDst->symkey ) ;
++ ctxDst->symkey = NULL ;
++ }
++ }
++
++ return(0);
+ }
+
+ static void
+ xmlSecNssSymKeyDataFinalize(xmlSecKeyDataPtr data) {
++ xmlSecNssSymKeyDataCtxPtr ctx;
++
+ xmlSecAssert(xmlSecNssSymKeyDataCheckId(data));
+-
+- xmlSecKeyDataBinaryValueFinalize(data);
++ xmlSecAssert(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize));
++
++ ctx = xmlSecNssSymKeyDataGetCtx(data);
++ xmlSecAssert(ctx != NULL);
++
++ if( ctx->slot != NULL ) {
++ PK11_FreeSlot( ctx->slot ) ;
++ ctx->slot = NULL ;
++ }
++
++ if( ctx->symkey != NULL ) {
++ PK11_FreeSymKey( ctx->symkey ) ;
++ ctx->symkey = NULL ;
++ }
++
++ ctx->cipher = CKM_INVALID_MECHANISM ;
+ }
+
+ static int
+ xmlSecNssSymKeyDataXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
+ xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+- xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1);
++ PK11SymKey* symKey ;
++ PK11SlotInfo* slot ;
++ xmlSecBufferPtr keyBuf;
++ xmlSecSize len;
++ xmlSecKeyDataPtr data;
++ xmlSecNssSymKeyDataCtxPtr ctx;
++ SECItem keyItem ;
++ int ret;
++
++ xmlSecAssert2(id != xmlSecKeyDataIdUnknown, -1);
++ xmlSecAssert2(key != NULL, -1);
++ xmlSecAssert2(node != NULL, -1);
++ xmlSecAssert2(keyInfoCtx != NULL, -1);
++
++ /* Create a new KeyData from a id */
++ data = xmlSecKeyDataCreate(id);
++ if(data == NULL ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeyDataCreate",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ return(-1);
++ }
++
++ ctx = xmlSecNssSymKeyDataGetCtx(data);
++ xmlSecAssert2(ctx != NULL, -1);
++
++ /* Create a buffer for raw symmetric key value */
++ if( ( keyBuf = xmlSecBufferCreate( 128 ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecBufferCreate" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1) ;
++ }
++
++ /* Read the raw key value */
++ if( xmlSecBufferBase64NodeContentRead( keyBuf , node ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ xmlSecErrorsSafeString(xmlSecNodeGetName(node)),
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ xmlSecBufferDestroy( keyBuf ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1) ;
++ }
++
++ /* Get slot */
++ slot = xmlSecNssSlotGet(ctx->cipher);
++ if( slot == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecNssSlotGet" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ xmlSecBufferDestroy( keyBuf ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1) ;
++ }
++
++ /* Wrap the raw key value SECItem */
++ keyItem.type = siBuffer ;
++ keyItem.data = xmlSecBufferGetData( keyBuf ) ;
++ keyItem.len = xmlSecBufferGetSize( keyBuf ) ;
++
++ /* Import the raw key into slot temporalily and get the key handler*/
++ symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginGenerated, CKA_VALUE, &keyItem, NULL ) ;
++ if( symKey == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "PK11_ImportSymKey" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ PK11_FreeSlot( slot ) ;
++ xmlSecBufferDestroy( keyBuf ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1) ;
++ }
++ PK11_FreeSlot( slot ) ;
++
++ /* raw key material has been copied into symKey, it isn't used any more */
++ xmlSecBufferDestroy( keyBuf ) ;
++
++ /* Adopt the symmetric key into key data */
++ ret = xmlSecNssSymKeyDataAdoptKey(data, symKey);
++ if(ret < 0) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeyDataBinaryValueSetBuffer",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1);
++ }
++ /* symKey has been duplicated into data, it isn't used any more */
++ PK11_FreeSymKey( symKey ) ;
++
++ /* Check value */
++ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), data) != 1) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeyReqMatchKeyValue",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecKeyDataDestroy( data ) ;
++ return(0);
++ }
+
+- return(xmlSecKeyDataBinaryValueXmlRead(id, key, node, keyInfoCtx));
++ ret = xmlSecKeySetValue(key, data);
++ if(ret < 0) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeySetValue",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1);
++ }
++
++ return(0);
+ }
+
+ static int
+ xmlSecNssSymKeyDataXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
+ xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
++ PK11SymKey* symKey ;
++
+ xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1);
+-
+- return(xmlSecKeyDataBinaryValueXmlWrite(id, key, node, keyInfoCtx));
++ xmlSecAssert2(key != NULL, -1);
++ xmlSecAssert2(node != NULL, -1);
++ xmlSecAssert2(keyInfoCtx != NULL, -1);
++
++ /* Get symmetric key from "key" */
++ symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key));
++ if( symKey != NULL ) {
++ SECItem* keyItem ;
++ xmlSecBufferPtr keyBuf ;
++
++ /* Extract raw key data from symmetric key */
++ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "PK11_ExtractKeyValue",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++
++ /* Get raw key data from "symKey" */
++ keyItem = PK11_GetKeyData( symKey ) ;
++ if(keyItem == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "PK11_GetKeyData",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++
++ /* Create key data buffer with raw kwy material */
++ keyBuf = xmlSecBufferCreate(keyItem->len) ;
++ if(keyBuf == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecBufferCreate",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++
++ xmlSecBufferSetData( keyBuf , keyItem->data , keyItem->len ) ;
++
++ /* Write raw key material into current xml node */
++ if( xmlSecBufferBase64NodeContentWrite( keyBuf, node, XMLSEC_BASE64_LINESIZE ) < 0 ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecBufferBase64NodeContentWrite",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecBufferDestroy(keyBuf);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++ xmlSecBufferDestroy(keyBuf);
++ PK11_FreeSymKey( symKey ) ;
++ }
++
++ return 0 ;
+ }
+
+ static int
+ xmlSecNssSymKeyDataBinRead(xmlSecKeyDataId id, xmlSecKeyPtr key,
+ const xmlSecByte* buf, xmlSecSize bufSize,
+ xmlSecKeyInfoCtxPtr keyInfoCtx) {
+- xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1);
++ PK11SymKey* symKey ;
++ PK11SlotInfo* slot ;
++ xmlSecKeyDataPtr data;
++ xmlSecNssSymKeyDataCtxPtr ctx;
++ SECItem keyItem ;
++ int ret;
++
++ xmlSecAssert2(id != xmlSecKeyDataIdUnknown, -1);
++ xmlSecAssert2(key != NULL, -1);
++ xmlSecAssert2(buf != NULL, -1);
++ xmlSecAssert2(bufSize != 0, -1);
++ xmlSecAssert2(keyInfoCtx != NULL, -1);
++
++ /* Create a new KeyData from a id */
++ data = xmlSecKeyDataCreate(id);
++ if(data == NULL ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeyDataCreate",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ return(-1);
++ }
++
++ ctx = xmlSecNssSymKeyDataGetCtx(data);
++ xmlSecAssert2(ctx != NULL, -1);
++
++ /* Get slot */
++ slot = xmlSecNssSlotGet(ctx->cipher);
++ if( slot == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecNssSlotGet" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1) ;
++ }
++
++ /* Wrap the raw key value SECItem */
++ keyItem.type = siBuffer ;
++ keyItem.data = buf ;
++ keyItem.len = bufSize ;
++
++ /* Import the raw key into slot temporalily and get the key handler*/
++ symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginGenerated, CKA_VALUE, &keyItem, NULL ) ;
++ if( symKey == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "PK11_ImportSymKey" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ PK11_FreeSlot( slot ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1) ;
++ }
++
++ /* Adopt the symmetric key into key data */
++ ret = xmlSecNssSymKeyDataAdoptKey(data, symKey);
++ if(ret < 0) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeyDataBinaryValueSetBuffer",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ PK11_FreeSymKey( symKey ) ;
++ PK11_FreeSlot( slot ) ;
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1);
++ }
++ /* symKey has been duplicated into data, it isn't used any more */
++ PK11_FreeSymKey( symKey ) ;
++ PK11_FreeSlot( slot ) ;
++
++ /* Check value */
++ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), data) != 1) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeyReqMatchKeyValue",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecKeyDataDestroy( data ) ;
++ return(0);
++ }
+
+- return(xmlSecKeyDataBinaryValueBinRead(id, key, buf, bufSize, keyInfoCtx));
++ ret = xmlSecKeySetValue(key, data);
++ if(ret < 0) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecKeySetValue",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecKeyDataDestroy( data ) ;
++ return(-1);
++ }
++
++ return(0);
+ }
+
+ static int
+ xmlSecNssSymKeyDataBinWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
+ xmlSecByte** buf, xmlSecSize* bufSize,
+ xmlSecKeyInfoCtxPtr keyInfoCtx) {
++ PK11SymKey* symKey ;
++
+ xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1);
++ xmlSecAssert2(key != NULL, -1);
++ xmlSecAssert2(buf != NULL, -1);
++ xmlSecAssert2(bufSize != 0, -1);
++ xmlSecAssert2(keyInfoCtx != NULL, -1);
++
++ /* Get symmetric key from "key" */
++ symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key));
++ if( symKey != NULL ) {
++ SECItem* keyItem ;
++
++ /* Extract raw key data from symmetric key */
++ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "PK11_ExtractKeyValue",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++
++ /* Get raw key data from "symKey" */
++ keyItem = PK11_GetKeyData( symKey ) ;
++ if(keyItem == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "PK11_GetKeyData",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++
++ *bufSize = keyItem->len;
++ *buf = ( xmlSecByte* )xmlMalloc( *bufSize );
++ if( *buf == NULL ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ NULL,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ PK11_FreeSymKey( symKey ) ;
++ return(-1);
++ }
++
++ memcpy((*buf), keyItem->data, (*bufSize));
++ PK11_FreeSymKey( symKey ) ;
++ }
+
+- return(xmlSecKeyDataBinaryValueBinWrite(id, key, buf, bufSize, keyInfoCtx));
++ return 0 ;
+ }
+
+ static int
+ xmlSecNssSymKeyDataGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type ATTRIBUTE_UNUSED) {
+- xmlSecBufferPtr buffer;
++ PK11SymKey* symkey ;
++ PK11SlotInfo* slot ;
++ xmlSecNssSymKeyDataCtxPtr ctx;
++ int ret;
+
+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1);
+ xmlSecAssert2(sizeBits > 0, -1);
+
+- buffer = xmlSecKeyDataBinaryValueGetBuffer(data);
+- xmlSecAssert2(buffer != NULL, -1);
+-
+- return(xmlSecNssGenerateRandom(buffer, (sizeBits + 7) / 8));
++ ctx = xmlSecNssSymKeyDataGetCtx(data);
++ xmlSecAssert2(ctx != NULL, -1);
++
++ if( sizeBits % 8 != 0 ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
++ NULL,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "Symmetric key size must be octuple");
++ return(-1);
++ }
++
++ /* Get slot */
++ slot = xmlSecNssSlotGet(ctx->cipher);
++ if( slot == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
++ "xmlSecNssSlotGet" ,
++ XMLSEC_ERRORS_R_XMLSEC_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return(-1) ;
++ }
++
++ if( PK11_Authenticate( slot, PR_FALSE , NULL ) != SECSuccess ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "PK11_Authenticate" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ PK11_FreeSlot( slot ) ;
++ return -1 ;
++ }
++
++ symkey = PK11_KeyGen( slot , ctx->cipher , NULL , sizeBits/8 , NULL ) ;
++ if( symkey == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "PK11_KeyGen" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ PK11_FreeSlot( slot ) ;
++ return -1 ;
++ }
++
++ if( ctx->slot != NULL ) {
++ PK11_FreeSlot( ctx->slot ) ;
++ ctx->slot = NULL ;
++ }
++ ctx->slot = slot ;
++
++ if( ctx->symkey != NULL ) {
++ PK11_FreeSymKey( ctx->symkey ) ;
++ ctx->symkey = NULL ;
++ }
++ ctx->symkey = symkey ;
++
++ return 0;
+ }
+
+ static xmlSecKeyDataType
+ xmlSecNssSymKeyDataGetType(xmlSecKeyDataPtr data) {
+- xmlSecBufferPtr buffer;
++ xmlSecNssSymKeyDataCtxPtr context = NULL ;
++ xmlSecKeyDataType type = xmlSecKeyDataTypeUnknown ;
+
+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), xmlSecKeyDataTypeUnknown);
++ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), xmlSecKeyDataTypeUnknown ) ;
+
+- buffer = xmlSecKeyDataBinaryValueGetBuffer(data);
+- xmlSecAssert2(buffer != NULL, xmlSecKeyDataTypeUnknown);
++ context = xmlSecNssSymKeyDataGetCtx( data ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "xmlSecNssSymKeyDataGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return xmlSecKeyDataTypeUnknown ;
++ }
+
+- return((xmlSecBufferGetSize(buffer) > 0) ? xmlSecKeyDataTypeSymmetric : xmlSecKeyDataTypeUnknown);
++ if( context->symkey != NULL ) {
++ type |= xmlSecKeyDataTypeSymmetric ;
++ } else {
++ type |= xmlSecKeyDataTypeUnknown ;
++ }
++
++ return type ;
+ }
+
+ static xmlSecSize
+ xmlSecNssSymKeyDataGetSize(xmlSecKeyDataPtr data) {
++ xmlSecNssSymKeyDataCtxPtr context ;
++ unsigned int length = 0 ;
++
+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), 0);
++ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), 0 ) ;
++ context = xmlSecNssSymKeyDataGetCtx( data ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "xmlSecNssSymKeyDataGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return 0 ;
++ }
++
++ if( context->symkey != NULL ) {
++ length = PK11_GetKeyLength( context->symkey ) ;
++ length *= 8 ;
++ }
+
+- return(xmlSecKeyDataBinaryValueGetSize(data));
++ return length ;
+ }
+
+ static void
+ xmlSecNssSymKeyDataDebugDump(xmlSecKeyDataPtr data, FILE* output) {
+ xmlSecAssert(xmlSecNssSymKeyDataCheckId(data));
+
+- xmlSecKeyDataBinaryValueDebugDump(data, output);
++ /* print only size, everything else is sensitive */
++ fprintf( output , "=== %s: size=%d\n" , data->id->dataNodeName ,
++ xmlSecKeyDataGetSize(data)) ;
+ }
+
+ static void
+ xmlSecNssSymKeyDataDebugXmlDump(xmlSecKeyDataPtr data, FILE* output) {
+ xmlSecAssert(xmlSecNssSymKeyDataCheckId(data));
+-
+- xmlSecKeyDataBinaryValueDebugXmlDump(data, output);
++
++ /* print only size, everything else is sensitive */
++ fprintf( output , "<%s size=\"%d\" />\n" , data->id->dataNodeName ,
++ xmlSecKeyDataGetSize(data)) ;
+ }
+
+ static int
+@@ -201,7 +858,7 @@
+ *************************************************************************/
+ static xmlSecKeyDataKlass xmlSecNssKeyDataAesKlass = {
+ sizeof(xmlSecKeyDataKlass),
+- xmlSecKeyDataBinarySize,
++ xmlSecNssSymKeyDataSize,
+
+ /* data */
+ xmlSecNameAESKeyValue,
+@@ -282,7 +939,7 @@
+ *************************************************************************/
+ static xmlSecKeyDataKlass xmlSecNssKeyDataDesKlass = {
+ sizeof(xmlSecKeyDataKlass),
+- xmlSecKeyDataBinarySize,
++ xmlSecNssSymKeyDataSize,
+
+ /* data */
+ xmlSecNameDESKeyValue,
+@@ -364,7 +1021,7 @@
+ *************************************************************************/
+ static xmlSecKeyDataKlass xmlSecNssKeyDataHmacKlass = {
+ sizeof(xmlSecKeyDataKlass),
+- xmlSecKeyDataBinarySize,
++ xmlSecNssSymKeyDataSize,
+
+ /* data */
+ xmlSecNameHMACKeyValue,
+--- misc/xmlsec1-1.2.14/src/nss/x509.c 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/x509.c 2009-09-21 14:02:48.642312431 +0200
+@@ -34,7 +34,6 @@
+ #include <xmlsec/keys.h>
+ #include <xmlsec/keyinfo.h>
+ #include <xmlsec/keysmngr.h>
+-#include <xmlsec/x509.h>
+ #include <xmlsec/base64.h>
+ #include <xmlsec/errors.h>
+
+@@ -61,33 +60,18 @@
+ static int xmlSecNssX509CertificateNodeRead (xmlSecKeyDataPtr data,
+ xmlNodePtr node,
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+-static int xmlSecNssX509CertificateNodeWrite (CERTCertificate* cert,
+- xmlNodePtr node,
+- xmlSecKeyInfoCtxPtr keyInfoCtx);
+ static int xmlSecNssX509SubjectNameNodeRead (xmlSecKeyDataPtr data,
+ xmlNodePtr node,
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+-static int xmlSecNssX509SubjectNameNodeWrite (CERTCertificate* cert,
+- xmlNodePtr node,
+- xmlSecKeyInfoCtxPtr keyInfoCtx);
+ static int xmlSecNssX509IssuerSerialNodeRead (xmlSecKeyDataPtr data,
+ xmlNodePtr node,
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+-static int xmlSecNssX509IssuerSerialNodeWrite (CERTCertificate* cert,
+- xmlNodePtr node,
+- xmlSecKeyInfoCtxPtr keyInfoCtx);
+ static int xmlSecNssX509SKINodeRead (xmlSecKeyDataPtr data,
+ xmlNodePtr node,
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+-static int xmlSecNssX509SKINodeWrite (CERTCertificate* cert,
+- xmlNodePtr node,
+- xmlSecKeyInfoCtxPtr keyInfoCtx);
+ static int xmlSecNssX509CRLNodeRead (xmlSecKeyDataPtr data,
+ xmlNodePtr node,
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+-static int xmlSecNssX509CRLNodeWrite (CERTSignedCrl* crl,
+- xmlNodePtr node,
+- xmlSecKeyInfoCtxPtr keyInfoCtx);
+ static int xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data,
+ xmlSecKeyPtr key,
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+@@ -104,9 +88,6 @@
+ xmlSecKeyInfoCtxPtr keyInfoCtx);
+ static xmlChar* xmlSecNssX509CrlBase64DerWrite (CERTSignedCrl* crl,
+ int base64LineWrap);
+-static xmlChar* xmlSecNssX509NameWrite (CERTName* nm);
+-static xmlChar* xmlSecNssASN1IntegerWrite (SECItem *num);
+-static xmlChar* xmlSecNssX509SKIWrite (CERTCertificate* cert);
+ static void xmlSecNssX509CertDebugDump (CERTCertificate* cert,
+ FILE* output);
+ static void xmlSecNssX509CertDebugXmlDump (CERTCertificate* cert,
+@@ -752,31 +733,22 @@
+ xmlSecNssKeyDataX509XmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
+ xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ xmlSecKeyDataPtr data;
++ xmlNodePtr cur;
++ xmlChar* buf;
+ CERTCertificate* cert;
+ CERTSignedCrl* crl;
+ xmlSecSize size, pos;
+- int content = 0;
+- int ret;
+
+ xmlSecAssert2(id == xmlSecNssKeyDataX509Id, -1);
+ xmlSecAssert2(key != NULL, -1);
+ xmlSecAssert2(node != NULL, -1);
+ xmlSecAssert2(keyInfoCtx != NULL, -1);
+
+- content = xmlSecX509DataGetNodeContent (node, 1, keyInfoCtx);
+- if (content < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecX509DataGetNodeContent",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "content=%d", content);
+- return(-1);
+- } else if(content == 0) {
+- /* by default we are writing certificates and crls */
+- content = XMLSEC_X509DATA_DEFAULT;
++ /* todo: flag in ctx remove all existing content */
++ if(0) {
++ xmlNodeSetContent(node, NULL);
+ }
+
+- /* get x509 data */
+ data = xmlSecKeyGetData(key, id);
+ if(data == NULL) {
+ /* no x509 data in the key */
+@@ -796,79 +768,74 @@
+ return(-1);
+ }
+
+- if((content & XMLSEC_X509DATA_CERTIFICATE_NODE) != 0) {
+- ret = xmlSecNssX509CertificateNodeWrite(cert, node, keyInfoCtx);
+- if(ret < 0) {
++ /* set base64 lines size from context */
++ buf = xmlSecNssX509CertBase64DerWrite(cert, keyInfoCtx->base64LineSize);
++ if(buf == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecNssX509CertificateNodeWrite",
++ "xmlSecNssX509CertBase64DerWrite",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "pos=%d", pos);
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+- }
+ }
+
+- if((content & XMLSEC_X509DATA_SUBJECTNAME_NODE) != 0) {
+- ret = xmlSecNssX509SubjectNameNodeWrite(cert, node, keyInfoCtx);
+- if(ret < 0) {
++ cur = xmlSecAddChild(node, xmlSecNodeX509Certificate, xmlSecDSigNs);
++ if(cur == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecNssX509SubjectNameNodeWrite",
++ "xmlSecAddChild",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "pos=%d", pos);
++ "node=%s",
++ xmlSecErrorsSafeString(xmlSecNodeX509Certificate));
++ xmlFree(buf);
+ return(-1);
+- }
+ }
++ /* todo: add \n around base64 data - from context */
++ /* todo: add errors check */
++ xmlNodeSetContent(cur, xmlSecStringCR);
++ xmlNodeSetContent(cur, buf);
++ xmlFree(buf);
++ }
+
+- if((content & XMLSEC_X509DATA_ISSUERSERIAL_NODE) != 0) {
+- ret = xmlSecNssX509IssuerSerialNodeWrite(cert, node, keyInfoCtx);
+- if(ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecNssX509IssuerSerialNodeWrite",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "pos=%d", pos);
+- return(-1);
+- }
++ /* write crls */
++ size = xmlSecNssKeyDataX509GetCrlsSize(data);
++ for(pos = 0; pos < size; ++pos) {
++ crl = xmlSecNssKeyDataX509GetCrl(data, pos);
++ if(crl == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecNssKeyDataX509GetCrl",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "pos=%d", pos);
++ return(-1);
+ }
+
+- if((content & XMLSEC_X509DATA_SKI_NODE) != 0) {
+- ret = xmlSecNssX509SKINodeWrite(cert, node, keyInfoCtx);
+- if(ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecNssX509SKINodeWrite",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "pos=%d", pos);
+- return(-1);
+- }
++ /* set base64 lines size from context */
++ buf = xmlSecNssX509CrlBase64DerWrite(crl, keyInfoCtx->base64LineSize);
++ if(buf == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecNssX509CrlBase64DerWrite",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ return(-1);
+ }
+- }
+
+- /* write crls if needed */
+- if((content & XMLSEC_X509DATA_CRL_NODE) != 0) {
+- size = xmlSecNssKeyDataX509GetCrlsSize(data);
+- for(pos = 0; pos < size; ++pos) {
+- crl = xmlSecNssKeyDataX509GetCrl(data, pos);
+- if(crl == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecNssKeyDataX509GetCrl",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "pos=%d", pos);
+- return(-1);
+- }
+-
+- ret = xmlSecNssX509CRLNodeWrite(crl, node, keyInfoCtx);
+- if(ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
+- "xmlSecNssX509CRLNodeWrite",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "pos=%d", pos);
+- return(-1);
+- }
+- }
++ cur = xmlSecAddChild(node, xmlSecNodeX509CRL, xmlSecDSigNs);
++ if(cur == NULL) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)),
++ "xmlSecAddChild",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "new_node=%s",
++ xmlSecErrorsSafeString(xmlSecNodeX509CRL));
++ xmlFree(buf);
++ return(-1);
++ }
++ /* todo: add \n around base64 data - from context */
++ /* todo: add errors check */
++ xmlNodeSetContent(cur, xmlSecStringCR);
++ xmlNodeSetContent(cur, buf);
+ }
+
+ return(0);
+@@ -1057,46 +1024,6 @@
+ return(0);
+ }
+
+-static int
+-xmlSecNssX509CertificateNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+- xmlChar* buf;
+- xmlNodePtr cur;
+-
+- xmlSecAssert2(cert != NULL, -1);
+- xmlSecAssert2(node != NULL, -1);
+- xmlSecAssert2(keyInfoCtx != NULL, -1);
+-
+- /* set base64 lines size from context */
+- buf = xmlSecNssX509CertBase64DerWrite(cert, keyInfoCtx->base64LineSize);
+- if(buf == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509CertBase64DerWrite",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+-
+- cur = xmlSecAddChild(node, xmlSecNodeX509Certificate, xmlSecDSigNs);
+- if(cur == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509Certificate));
+- xmlFree(buf);
+- return(-1);
+- }
+-
+- /* todo: add \n around base64 data - from context */
+- /* todo: add errors check */
+- xmlNodeSetContent(cur, xmlSecStringCR);
+- xmlNodeSetContent(cur, buf);
+- xmlFree(buf);
+- return(0);
+-}
+-
+ static int
+ xmlSecNssX509SubjectNameNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ xmlSecKeyDataStorePtr x509Store;
+@@ -1120,19 +1047,13 @@
+ }
+
+ subject = xmlNodeGetContent(node);
+- if((subject == NULL) || (xmlSecIsEmptyString(subject) == 1)) {
+- if(subject != NULL) {
+- xmlFree(subject);
+- }
+- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) {
++ if(subject == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)),
+ XMLSEC_ERRORS_R_INVALID_NODE_CONTENT,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+- }
+- return(0);
+ }
+
+ cert = xmlSecNssX509StoreFindCert(x509Store, subject, NULL, NULL, NULL, keyInfoCtx);
+@@ -1169,40 +1090,6 @@
+ return(0);
+ }
+
+-static int
+-xmlSecNssX509SubjectNameNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) {
+- xmlChar* buf = NULL;
+- xmlNodePtr cur = NULL;
+-
+- xmlSecAssert2(cert != NULL, -1);
+- xmlSecAssert2(node != NULL, -1);
+-
+- buf = xmlSecNssX509NameWrite(&(cert->subject));
+- if(buf == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameWrite(&(cert->subject))",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+-
+- cur = xmlSecAddChild(node, xmlSecNodeX509SubjectName, xmlSecDSigNs);
+- if(cur == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509SubjectName));
+- xmlFree(buf);
+- return(-1);
+- }
+- xmlSecNodeEncodeAndSetContent(cur, buf);
+- xmlFree(buf);
+- return(0);
+-}
+-
+ static int
+ xmlSecNssX509IssuerSerialNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ xmlSecKeyDataStorePtr x509Store;
+@@ -1228,21 +1115,9 @@
+ }
+
+ cur = xmlSecGetNextElementNode(node->children);
+- if(cur == NULL) {
+- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+- xmlSecErrorsSafeString(xmlSecNodeX509IssuerName),
+- XMLSEC_ERRORS_R_NODE_NOT_FOUND,
+- "node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeGetName(cur)));
+- return(-1);
+- }
+- return(0);
+- }
+
+ /* the first is required node X509IssuerName */
+- if(!xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs)) {
++ if((cur == NULL) || !xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs)) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ xmlSecErrorsSafeString(xmlSecNodeX509IssuerName),
+@@ -1336,78 +1211,6 @@
+ return(0);
+ }
+
+-static int
+-xmlSecNssX509IssuerSerialNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) {
+- xmlNodePtr cur;
+- xmlNodePtr issuerNameNode;
+- xmlNodePtr issuerNumberNode;
+- xmlChar* buf;
+-
+- xmlSecAssert2(cert != NULL, -1);
+- xmlSecAssert2(node != NULL, -1);
+-
+- /* create xml nodes */
+- cur = xmlSecAddChild(node, xmlSecNodeX509IssuerSerial, xmlSecDSigNs);
+- if(cur == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509IssuerSerial));
+- return(-1);
+- }
+-
+- issuerNameNode = xmlSecAddChild(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs);
+- if(issuerNameNode == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509IssuerName));
+- return(-1);
+- }
+-
+- issuerNumberNode = xmlSecAddChild(cur, xmlSecNodeX509SerialNumber, xmlSecDSigNs);
+- if(issuerNumberNode == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509SerialNumber));
+- return(-1);
+- }
+-
+- /* write data */
+- buf = xmlSecNssX509NameWrite(&(cert->issuer));
+- if(buf == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameWrite(&(cert->issuer))",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+- xmlSecNodeEncodeAndSetContent(issuerNameNode, buf);
+- xmlFree(buf);
+-
+- buf = xmlSecNssASN1IntegerWrite(&(cert->serialNumber));
+- if(buf == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssASN1IntegerWrite(&(cert->serialNumber))",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+- xmlNodeSetContent(issuerNumberNode, buf);
+- xmlFree(buf);
+-
+- return(0);
+-}
+-
+ static int
+ xmlSecNssX509SKINodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ xmlSecKeyDataStorePtr x509Store;
+@@ -1431,11 +1234,7 @@
+ }
+
+ ski = xmlNodeGetContent(node);
+- if((ski == NULL) || (xmlSecIsEmptyString(ski) == 1)) {
+- if(ski != NULL) {
+- xmlFree(ski);
+- }
+- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) {
++ if(ski == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)),
+@@ -1443,8 +1242,6 @@
+ "node=%s",
+ xmlSecErrorsSafeString(xmlSecNodeX509SKI));
+ return(-1);
+- }
+- return(0);
+ }
+
+ cert = xmlSecNssX509StoreFindCert(x509Store, NULL, NULL, NULL, ski, keyInfoCtx);
+@@ -1479,41 +1276,6 @@
+ return(0);
+ }
+
+-static int
+-xmlSecNssX509SKINodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) {
+- xmlChar *buf = NULL;
+- xmlNodePtr cur = NULL;
+-
+- xmlSecAssert2(cert != NULL, -1);
+- xmlSecAssert2(node != NULL, -1);
+-
+- buf = xmlSecNssX509SKIWrite(cert);
+- if(buf == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509SKIWrite",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+-
+- cur = xmlSecAddChild(node, xmlSecNodeX509SKI, xmlSecDSigNs);
+- if(cur == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "new_node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509SKI));
+- xmlFree(buf);
+- return(-1);
+- }
+- xmlSecNodeEncodeAndSetContent(cur, buf);
+- xmlFree(buf);
+-
+- return(0);
+-}
+-
+ static int
+ xmlSecNssX509CRLNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ xmlChar *content;
+@@ -1524,19 +1286,13 @@
+ xmlSecAssert2(keyInfoCtx != NULL, -1);
+
+ content = xmlNodeGetContent(node);
+- if((content == NULL) || (xmlSecIsEmptyString(content) == 1)) {
+- if(content != NULL) {
+- xmlFree(content);
+- }
+- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) {
++ if(content == NULL){
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)),
+ XMLSEC_ERRORS_R_INVALID_NODE_CONTENT,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+- }
+- return(0);
+ }
+
+ crl = xmlSecNssX509CrlBase64DerRead(content, keyInfoCtx);
+@@ -1556,47 +1312,6 @@
+ }
+
+ static int
+-xmlSecNssX509CRLNodeWrite(CERTSignedCrl* crl, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+- xmlChar* buf = NULL;
+- xmlNodePtr cur = NULL;
+-
+- xmlSecAssert2(crl != NULL, -1);
+- xmlSecAssert2(node != NULL, -1);
+- xmlSecAssert2(keyInfoCtx != NULL, -1);
+-
+- /* set base64 lines size from context */
+- buf = xmlSecNssX509CrlBase64DerWrite(crl, keyInfoCtx->base64LineSize);
+- if(buf == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509CrlBase64DerWrite",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(-1);
+- }
+-
+- cur = xmlSecAddChild(node, xmlSecNodeX509CRL, xmlSecDSigNs);
+- if(cur == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecAddChild",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "new_node=%s",
+- xmlSecErrorsSafeString(xmlSecNodeX509CRL));
+- xmlFree(buf);
+- return(-1);
+- }
+- /* todo: add \n around base64 data - from context */
+- /* todo: add errors check */
+- xmlNodeSetContent(cur, xmlSecStringCR);
+- xmlNodeSetContent(cur, buf);
+- xmlFree(buf);
+-
+- return(0);
+-}
+-
+-
+-static int
+ xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data, xmlSecKeyPtr key,
+ xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ xmlSecNssX509DataCtxPtr ctx;
+@@ -1604,6 +1319,10 @@
+ int ret;
+ SECStatus status;
+ PRTime notBefore, notAfter;
++
++ PK11SlotInfo* slot ;
++ SECKEYPublicKey *pubKey = NULL;
++ SECKEYPrivateKey *priKey = NULL;
+
+ xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataX509Id), -1);
+ xmlSecAssert2(key != NULL, -1);
+@@ -1636,10 +1355,14 @@
+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)),
+ "CERT_DupCertificate",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ return(-1);
+ }
+-
++
++ /*-
++ * Get Public key from cert, which does not always work for sign
++ * action.
++ *
+ keyValue = xmlSecNssX509CertGetKey(ctx->keyCert);
+ if(keyValue == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+@@ -1649,6 +1372,54 @@
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
++ */
++ /*-
++ * I'll search key according to KeyReq.
++ */
++ slot = cert->slot ;
++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) {
++ if( ( priKey = PK11_FindPrivateKeyFromCert( slot , cert , NULL ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "PK11_FindPrivateKeyFromCert" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++ }
++
++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) {
++ if( ( pubKey = CERT_ExtractPublicKey( cert ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "CERT_ExtractPublicKey" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++
++ if( priKey != NULL )
++ SECKEY_DestroyPrivateKey( priKey ) ;
++ return -1 ;
++ }
++ }
++
++ keyValue = xmlSecNssPKIAdoptKey(priKey, pubKey);
++ if( keyValue == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) ,
++ "xmlSecNssPKIAdoptKey" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++
++ if( priKey != NULL )
++ SECKEY_DestroyPrivateKey( priKey ) ;
++
++ if( pubKey != NULL )
++ SECKEY_DestroyPublicKey( pubKey ) ;
++
++ return -1 ;
++ }
++ /* Modify keyValue get Done */
+
+ /* verify that the key matches our expectations */
+ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), keyValue) != 1) {
+@@ -1950,86 +1721,6 @@
+ return(res);
+ }
+
+-static xmlChar*
+-xmlSecNssX509NameWrite(CERTName* nm) {
+- xmlChar *res = NULL;
+- char *str;
+-
+- xmlSecAssert2(nm != NULL, NULL);
+-
+- str = CERT_NameToAscii(nm);
+- if (str == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "CERT_NameToAscii",
+- XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(NULL);
+- }
+-
+- res = xmlStrdup(BAD_CAST str);
+- if(res == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlStrdup",
+- XMLSEC_ERRORS_R_MALLOC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- PORT_Free(str);
+- return(NULL);
+- }
+- PORT_Free(str);
+- return(res);
+-}
+-
+-static xmlChar*
+-xmlSecNssASN1IntegerWrite(SECItem *num) {
+- xmlChar *res = NULL;
+-
+- xmlSecAssert2(num != NULL, NULL);
+-
+- /* TODO : to be implemented after
+- * NSS bug http://bugzilla.mozilla.org/show_bug.cgi?id=212864 is fixed
+- */
+- return(res);
+-}
+-
+-static xmlChar*
+-xmlSecNssX509SKIWrite(CERTCertificate* cert) {
+- xmlChar *res = NULL;
+- SECItem ski;
+- SECStatus rv;
+-
+- xmlSecAssert2(cert != NULL, NULL);
+-
+- memset(&ski, 0, sizeof(ski));
+-
+- rv = CERT_FindSubjectKeyIDExtension(cert, &ski);
+- if (rv != SECSuccess) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "CERT_FindSubjectKeyIDExtension",
+- XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- SECITEM_FreeItem(&ski, PR_FALSE);
+- return(NULL);
+- }
+-
+- res = xmlSecBase64Encode(ski.data, ski.len, 0);
+- if(res == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecBase64Encode",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- SECITEM_FreeItem(&ski, PR_FALSE);
+- return(NULL);
+- }
+- SECITEM_FreeItem(&ski, PR_FALSE);
+-
+- return(res);
+-}
+-
+-
+ static void
+ xmlSecNssX509CertDebugDump(CERTCertificate* cert, FILE* output) {
+ SECItem *sn;
+--- misc/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-09-21 14:02:48.669245207 +0200
+@@ -30,6 +30,7 @@
+ #include <xmlsec/keyinfo.h>
+ #include <xmlsec/keysmngr.h>
+ #include <xmlsec/base64.h>
++#include <xmlsec/bn.h>
+ #include <xmlsec/errors.h>
+
+ #include <xmlsec/nss/crypto.h>
+@@ -61,17 +62,7 @@
+
+ static int xmlSecNssX509StoreInitialize (xmlSecKeyDataStorePtr store);
+ static void xmlSecNssX509StoreFinalize (xmlSecKeyDataStorePtr store);
+-static int xmlSecNssX509NameStringRead (xmlSecByte **str,
+- int *strLen,
+- xmlSecByte *res,
+- int resLen,
+- xmlSecByte delim,
+- int ingoreTrailingSpaces);
+-static xmlSecByte * xmlSecNssX509NameRead (xmlSecByte *str,
+- int len);
+-
+-static void xmlSecNssNumToItem(SECItem *it, unsigned long num);
+-
++static int xmlSecNssIntegerToItem( const xmlChar* integer , SECItem *it ) ;
+
+ static xmlSecKeyDataStoreKlass xmlSecNssX509StoreKlass = {
+ sizeof(xmlSecKeyDataStoreKlass),
+@@ -339,40 +330,28 @@
+ xmlSecNssX509FindCert(xmlChar *subjectName, xmlChar *issuerName,
+ xmlChar *issuerSerial, xmlChar *ski) {
+ CERTCertificate *cert = NULL;
+- xmlChar *p = NULL;
+ CERTName *name = NULL;
+ SECItem *nameitem = NULL;
+ PRArenaPool *arena = NULL;
+
+ if (subjectName != NULL) {
+- p = xmlSecNssX509NameRead(subjectName, xmlStrlen(subjectName));
+- if (p == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameRead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "subject=%s",
+- xmlSecErrorsSafeString(subjectName));
+- goto done;
+- }
+-
+ arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
+ if (arena == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PORT_NewArena",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ goto done;
+ }
+
+- name = CERT_AsciiToName((char*)p);
++ name = CERT_AsciiToName((char*)subjectName);
+ if (name == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "CERT_AsciiToName",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ goto done;
+ }
+
+@@ -394,34 +373,23 @@
+ if((issuerName != NULL) && (issuerSerial != NULL)) {
+ CERTIssuerAndSN issuerAndSN;
+
+- p = xmlSecNssX509NameRead(issuerName, xmlStrlen(issuerName));
+- if (p == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameRead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "issuer=%s",
+- xmlSecErrorsSafeString(issuerName));
+- goto done;
+- }
+-
+ arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
+ if (arena == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "PORT_NewArena",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ goto done;
+ }
+
+- name = CERT_AsciiToName((char*)p);
++ name = CERT_AsciiToName((char*)issuerName);
+ if (name == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ "CERT_AsciiToName",
+ XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
++ "error code=%d", PORT_GetError());
+ goto done;
+ }
+
+@@ -441,8 +409,15 @@
+ issuerAndSN.derIssuer.data = nameitem->data;
+ issuerAndSN.derIssuer.len = nameitem->len;
+
+- /* TBD: serial num can be arbitrarily long */
+- xmlSecNssNumToItem(&issuerAndSN.serialNumber, PORT_Atoi((char *)issuerSerial));
++ if( xmlSecNssIntegerToItem( issuerSerial, &issuerAndSN.serialNumber ) < 0 ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ "xmlSecNssIntegerToItem",
++ XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ "serial number=%s",
++ xmlSecErrorsSafeString(issuerSerial));
++ goto done;
++ }
+
+ cert = CERT_FindCertByIssuerAndSN(CERT_GetDefaultCertDB(),
+ &issuerAndSN);
+@@ -473,9 +448,6 @@
+ }
+
+ done:
+- if (p != NULL) {
+- PORT_Free(p);
+- }
+ if (arena != NULL) {
+ PORT_FreeArena(arena, PR_FALSE);
+ }
+@@ -486,176 +458,6 @@
+ return(cert);
+ }
+
+-static xmlSecByte *
+-xmlSecNssX509NameRead(xmlSecByte *str, int len) {
+- xmlSecByte name[256];
+- xmlSecByte value[256];
+- xmlSecByte *retval = NULL;
+- xmlSecByte *p = NULL;
+- int nameLen, valueLen;
+-
+- xmlSecAssert2(str != NULL, NULL);
+-
+- /* return string should be no longer than input string */
+- retval = (xmlSecByte *)PORT_Alloc(len+1);
+- if(retval == NULL) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "PORT_Alloc",
+- XMLSEC_ERRORS_R_MALLOC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- return(NULL);
+- }
+- p = retval;
+-
+- while(len > 0) {
+- /* skip spaces after comma or semicolon */
+- while((len > 0) && isspace(*str)) {
+- ++str; --len;
+- }
+-
+- nameLen = xmlSecNssX509NameStringRead(&str, &len, name, sizeof(name), '=', 0);
+- if(nameLen < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameStringRead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- goto done;
+- }
+- memcpy(p, name, nameLen);
+- p+=nameLen;
+- *p++='=';
+- if(len > 0) {
+- ++str; --len;
+- if((*str) == '\"') {
+- valueLen = xmlSecNssX509NameStringRead(&str, &len,
+- value, sizeof(value), '"', 1);
+- if(valueLen < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameStringRead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- goto done;
+- }
+- /* skip spaces before comma or semicolon */
+- while((len > 0) && isspace(*str)) {
+- ++str; --len;
+- }
+- if((len > 0) && ((*str) != ',')) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
+- "comma is expected");
+- goto done;
+- }
+- if(len > 0) {
+- ++str; --len;
+- }
+- *p++='\"';
+- memcpy(p, value, valueLen);
+- p+=valueLen;
+- *p++='\"';
+- } else if((*str) == '#') {
+- /* TODO: read octect values */
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
+- "reading octect values is not implemented yet");
+- goto done;
+- } else {
+- valueLen = xmlSecNssX509NameStringRead(&str, &len,
+- value, sizeof(value), ',', 1);
+- if(valueLen < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- "xmlSecNssX509NameStringRead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- XMLSEC_ERRORS_NO_MESSAGE);
+- goto done;
+- }
+- memcpy(p, value, valueLen);
+- p+=valueLen;
+- if (len > 0)
+- *p++=',';
+- }
+- } else {
+- valueLen = 0;
+- }
+- if(len > 0) {
+- ++str; --len;
+- }
+- }
+-
+- *p = 0;
+- return(retval);
+-
+-done:
+- PORT_Free(retval);
+- return (NULL);
+-}
+-
+-static int
+-xmlSecNssX509NameStringRead(xmlSecByte **str, int *strLen,
+- xmlSecByte *res, int resLen,
+- xmlSecByte delim, int ingoreTrailingSpaces) {
+- xmlSecByte *p, *q, *nonSpace;
+-
+- xmlSecAssert2(str != NULL, -1);
+- xmlSecAssert2(strLen != NULL, -1);
+- xmlSecAssert2(res != NULL, -1);
+-
+- p = (*str);
+- nonSpace = q = res;
+- while(((p - (*str)) < (*strLen)) && ((*p) != delim) && ((q - res) < resLen)) {
+- if((*p) != '\\') {
+- if(ingoreTrailingSpaces && !isspace(*p)) {
+- nonSpace = q;
+- }
+- *(q++) = *(p++);
+- } else {
+- ++p;
+- nonSpace = q;
+- if(xmlSecIsHex((*p))) {
+- if((p - (*str) + 1) >= (*strLen)) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
+- "two hex digits expected");
+- return(-1);
+- }
+- *(q++) = xmlSecGetHex(p[0]) * 16 + xmlSecGetHex(p[1]);
+- p += 2;
+- } else {
+- if(((++p) - (*str)) >= (*strLen)) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
+- "escaped symbol missed");
+- return(-1);
+- }
+- *(q++) = *(p++);
+- }
+- }
+- }
+- if(((p - (*str)) < (*strLen)) && ((*p) != delim)) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- NULL,
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_SIZE,
+- "buffer is too small");
+- return(-1);
+- }
+- (*strLen) -= (p - (*str));
+- (*str) = p;
+- return((ingoreTrailingSpaces) ? nonSpace - res + 1 : q - res);
+-}
+-
+ /* code lifted from NSS */
+ static void
+ xmlSecNssNumToItem(SECItem *it, unsigned long ui)
+@@ -699,6 +501,77 @@
+ it->len = len;
+ PORT_Memcpy(it->data, bb + (sizeof(bb) - len), len);
+ }
++
++static int
++xmlSecNssIntegerToItem(
++ const xmlChar* integer ,
++ SECItem *item
++) {
++ xmlSecBn bn ;
++ xmlSecSize i, length ;
++ const xmlSecByte* bnInteger ;
++
++ xmlSecAssert2( integer != NULL, -1 ) ;
++ xmlSecAssert2( item != NULL, -1 ) ;
++
++ if( xmlSecBnInitialize( &bn, 0 ) < 0 ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ "xmlSecBnInitialize",
++ XMLSEC_ERRORS_R_INVALID_DATA,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ return -1 ;
++ }
++
++ if( xmlSecBnFromDecString( &bn, integer ) < 0 ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ "xmlSecBnFromDecString",
++ XMLSEC_ERRORS_R_INVALID_DATA,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecBnFinalize( &bn ) ;
++ return -1 ;
++ }
++
++ length = xmlSecBnGetSize( &bn ) ;
++ if( length <= 0 ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ "xmlSecBnGetSize",
++ XMLSEC_ERRORS_R_INVALID_DATA,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ }
++
++ bnInteger = xmlSecBnGetData( &bn ) ;
++ if( bnInteger == NULL ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ "xmlSecBnGetData",
++ XMLSEC_ERRORS_R_INVALID_DATA,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ xmlSecBnFinalize( &bn ) ;
++ return -1 ;
++ }
++
++ item->data = ( unsigned char * )PORT_Alloc( length );
++ if( item->data == NULL ) {
++ xmlSecError(XMLSEC_ERRORS_HERE,
++ NULL,
++ "PORT_Alloc",
++ XMLSEC_ERRORS_R_INVALID_DATA,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ xmlSecBnFinalize( &bn ) ;
++ return -1 ;
++ }
++
++ item->len = length;
++ for( i = 0 ; i < length ; i ++ )
++ item->data[i] = *( bnInteger + i ) ;
++
++ xmlSecBnFinalize( &bn ) ;
++
++ return 0 ;
++}
+ #endif /* XMLSEC_NO_X509 */
+
+
+--- misc/xmlsec1-1.2.14/win32/Makefile.msvc 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/win32/Makefile.msvc 2009-09-21 14:02:48.607277908 +0200
+@@ -218,6 +218,9 @@
+ $(XMLSEC_OPENSSL_INTDIR_A)\x509vfy.obj
+
+ XMLSEC_NSS_OBJS = \
++ $(XMLSEC_NSS_INTDIR)\akmngr.obj\
++ $(XMLSEC_NSS_INTDIR)\keywrapers.obj\
++ $(XMLSEC_NSS_INTDIR)\tokens.obj\
+ $(XMLSEC_NSS_INTDIR)\app.obj\
+ $(XMLSEC_NSS_INTDIR)\bignum.obj\
+ $(XMLSEC_NSS_INTDIR)\ciphers.obj \
+@@ -253,6 +256,7 @@
+ $(XMLSEC_NSS_INTDIR_A)\strings.obj
+
+ XMLSEC_MSCRYPTO_OBJS = \
++ $(XMLSEC_MSCRYPTO_INTDIR)\akmngr.obj\
+ $(XMLSEC_MSCRYPTO_INTDIR)\app.obj\
+ $(XMLSEC_MSCRYPTO_INTDIR)\crypto.obj \
+ $(XMLSEC_MSCRYPTO_INTDIR)\ciphers.obj \
--- /dev/null
+--- misc/xmlsec1-1.2.14/src/mscrypto/Makefile.am 2009-06-26 05:53:18.000000000 +0900
++++ misc/build/xmlsec1-1.2.14/src/mscrypto/Makefile.am 2009-09-30 18:53:05.373000000 +0900
+@@ -35,6 +35,7 @@
+ csp_oid.h \
+ globals.h \
+ xmlsec-mingw.h \
++ akmngr.c \
+ $(NULL)
+
+ if SHAREDLIB_HACK
+--- misc/xmlsec1-1.2.14/src/mscrypto/Makefile.in 2009-06-26 05:53:32.000000000 +0900
++++ misc/build/xmlsec1-1.2.14/src/mscrypto/Makefile.in 2009-09-30 19:00:50.107375000 +0900
+@@ -72,7 +72,8 @@
+ am__libxmlsec1_mscrypto_la_SOURCES_DIST = app.c certkeys.c ciphers.c \
+ crypto.c digests.c keysstore.c kt_rsa.c signatures.c symkeys.c \
+ x509.c x509vfy.c csp_calg.h csp_oid.h globals.h xmlsec-mingw.h \
+- ../strings.c
++ ../strings.c \
++ akmngr.c
+ am__objects_1 =
+ @SHAREDLIB_HACK_TRUE@am__objects_2 = \
+ @SHAREDLIB_HACK_TRUE@ libxmlsec1_mscrypto_la-strings.lo
+@@ -86,7 +87,8 @@
+ libxmlsec1_mscrypto_la-signatures.lo \
+ libxmlsec1_mscrypto_la-symkeys.lo \
+ libxmlsec1_mscrypto_la-x509.lo \
+- libxmlsec1_mscrypto_la-x509vfy.lo $(am__objects_1) \
++ libxmlsec1_mscrypto_la-x509vfy.lo \
++ libxmlsec1_mscrypto_la-akmngr.lo $(am__objects_1) \
+ $(am__objects_2)
+ libxmlsec1_mscrypto_la_OBJECTS = $(am_libxmlsec1_mscrypto_la_OBJECTS)
+ libxmlsec1_mscrypto_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+@@ -338,6 +340,7 @@
+ libxmlsec1_mscrypto_la_SOURCES = app.c certkeys.c ciphers.c crypto.c \
+ digests.c keysstore.c kt_rsa.c signatures.c symkeys.c x509.c \
+ x509vfy.c csp_calg.h csp_oid.h globals.h xmlsec-mingw.h \
++ akmngr.c \
+ $(NULL) $(am__append_1)
+ libxmlsec1_mscrypto_la_LIBADD = \
+ ../libxmlsec1.la \
+@@ -441,6 +444,7 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-symkeys.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-x509.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-x509vfy.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Plo@am__quote@
+
+ .c.o:
+ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@@ -470,6 +474,13 @@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_mscrypto_la-app.lo `test -f 'app.c' || echo '$(srcdir)/'`app.c
+
++libxmlsec1_mscrypto_la-akmngr.lo: akmngr.c
++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_mscrypto_la-akmngr.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Tpo" -c -o libxmlsec1_mscrypto_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Tpo" "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Tpo"; exit 1; fi
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='akmngr.c' object='libxmlsec1_mscrypto_la-akmngr.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_mscrypto_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c
++
+ libxmlsec1_mscrypto_la-certkeys.lo: certkeys.c
+ @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_mscrypto_la-certkeys.lo -MD -MP -MF $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Tpo -c -o libxmlsec1_mscrypto_la-certkeys.lo `test -f 'certkeys.c' || echo '$(srcdir)/'`certkeys.c
+ @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Tpo $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Plo
--- /dev/null
+--- misc/xmlsec1-1.2.14/configure.in 2009-09-29 15:55:33.282288142 +0200
++++ misc/build/xmlsec1-1.2.14/configure.in 2009-09-29 15:49:39.614223428 +0200
+@@ -33,6 +33,8 @@
+ AC_HEADER_STDC
+
+ LT_INIT
++dnl force the right implib extension for mingw
++libext=dll.a
+
+ dnl
+ dnl Find programs
+@@ -672,6 +674,26 @@
+ done
+
+ for dir in $ac_nss_lib_dir ; do
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ if test -f $dir/libnspr4.$libext ; then
++ dnl do not add -L/usr/lib because compiler does it anyway
++ if test "z$dir" = "z/usr/lib" ; then
++ NSPR_LIBS="$NSPR_LIBS_LIST"
++ else
++ if test "z$with_gnu_ld" = "zyes" ; then
++ NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST"
++ else
++ NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
++ fi
++ fi
++ NSPR_LIBS_FOUND="yes"
++ break
++ fi
++ ;;
++
++ *)
++
+ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then
+ dnl do not add -L/usr/lib because compiler does it anyway
+ if test "z$dir" = "z/usr/lib" ; then
+@@ -686,6 +708,8 @@
+ NSPR_LIBS_FOUND="yes"
+ break
+ fi
++ ;;
++ esac
+ done
+ fi
+
+@@ -743,6 +767,25 @@
+ done
+
+ for dir in $ac_nss_lib_dir ; do
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ if test -f $dir/libnss3.$libext ; then
++ dnl do not add -L/usr/lib because compiler does it anyway
++ if test "z$dir" = "z/usr/lib" ; then
++ NSS_LIBS="$NSS_LIBS_LIST"
++ else
++ if test "z$with_gnu_ld" = "zyes" ; then
++ NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST"
++ else
++ NSS_LIBS="-L$dir $NSS_LIBS_LIST"
++ fi
++ fi
++ NSS_LIBS_FOUND="yes"
++ break
++ fi
++ ;;
++
++ *)
+ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then
+ dnl do not add -L/usr/lib because compiler does it anyway
+ if test "z$dir" = "z/usr/lib" ; then
+@@ -757,6 +800,8 @@
+ NSS_LIBS_FOUND="yes"
+ break
+ fi
++ ;;
++ esac
+ done
+ fi
+
+@@ -927,7 +972,7 @@
+ dnl cannot detect __stdcall functions
+ dnl AC_CHECK_LIB(crypt32, CertOpenStore, ....
+ LIBS_SAVE="$LIBS"
+- LIBS="$LIBS -lcrypt32"
++ LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib"
+ AC_MSG_CHECKING(for mscrypto libraries)
+ AC_LINK_IFELSE([
+ #include <windows.h>
+@@ -944,15 +989,7 @@
+ XMLSEC_NO_MSCRYPTO="0"
+
+ MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1"
+- case $host in
+- *-*-mingw*)
+- dnl since mingw crypt32 library is limited
+- dnl we use own def-file
+- MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';;
+- *)
+- MSCRYPTO_LIBS="-lcrypt32";;
+- esac
+-
++ MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib"
+ dnl first crypto library is default one
+ if test "z$XMLSEC_CRYPTO" = "z" ; then
+ XMLSEC_CRYPTO="mscrypto"
+--- misc/xmlsec1-1.2.14/ltmain.sh 2009-06-25 22:53:19.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/ltmain.sh 2009-09-29 15:49:39.628349554 +0200
+@@ -4868,6 +4868,11 @@
+ fi
+ ;;
+
++ *.lib)
++ deplibs="$deplibs $arg"
++ continue
++ ;;
++
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+@@ -5213,6 +5218,10 @@
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
++ *.lib)
++ deplibs="$deplib $deplibs"
++ continue
++ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+--- misc/xmlsec1-1.2.14/src/nss/keywrapers.c 2009-09-29 15:55:33.430875248 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/keywrapers.c 2009-09-29 15:49:39.749963247 +0200
+@@ -1126,6 +1126,7 @@
+ NULL, /* void* reserved1; */
+ };
+
++#ifndef __MINGW32__
+ /**
+ * xmlSecNssTransformKWAes128GetKlass:
+ *
+@@ -1160,6 +1161,7 @@
+ xmlSecNssTransformKWAes256GetKlass(void) {
+ return(&xmlSecNssKWAes256Klass);
+ }
++#endif /* __MINGW32__ */
+
+ #endif /* XMLSEC_NO_AES */
+
+@@ -1197,6 +1199,7 @@
+ NULL, /* void* reserved1; */
+ };
+
++#ifndef __MINGW32__
+ /**
+ * xmlSecNssTransformKWDes3GetKlass:
+ *
+@@ -1208,6 +1211,7 @@
+ xmlSecNssTransformKWDes3GetKlass(void) {
+ return(&xmlSecNssKWDes3Klass);
+ }
++#endif /* __MINGW32__ */
+
+ #endif /* XMLSEC_NO_DES */
+
--- /dev/null
+--- misc/xmlsec1-1.2.14/src/mscrypto/x509vfy.c 2009-06-25 22:53:18.000000000 +0200
++++ misc/build/xmlsec1-1.2.14/src/mscrypto/x509vfy.c 2009-09-23 10:01:07.237316078 +0200
+@@ -567,9 +567,16 @@
+ CertFreeCertificateContext(nextCert);
+ }
+
+- if((selected == 1) && xmlSecMSCryptoX509StoreConstructCertsChain(store, cert, certs, keyInfoCtx)) {
+- return(cert);
+- }
++ /* JL: OpenOffice.org implements its own certificate verification routine.
++ The goal is to separate validation of the signature
++ and the certificate. For example, OOo could show that the document signature is valid,
++ but the certificate could not be verified. If we do not prevent the verification of
++ the certificate by libxmlsec and the verification fails, then the XML signature will not be
++ verified. This would happen, for example, if the root certificate is not installed.
++ */
++/* if((selected == 1) && xmlSecMSCryptoX509StoreConstructCertsChain(store, cert, certs, keyInfoCtx)) { */
++ if (selected == 1)
++ return cert;
+ }
+
+ return (NULL);
+--- misc/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-09-23 10:06:52.989793254 +0200
++++ misc/build/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-09-23 10:05:03.183042205 +0200
+@@ -191,13 +191,27 @@
+ continue;
+ }
+
+- status = CERT_VerifyCertificate(CERT_GetDefaultCertDB(),
+- cert, PR_FALSE,
+- (SECCertificateUsage)0,
+- timeboundary , NULL, NULL, NULL);
+- if (status == SECSuccess) {
+- break;
+- }
++
++ /*
++ JL: OpenOffice.org implements its own certificate verification routine.
++ The goal is to separate validation of the signature
++ and the certificate. For example, OOo could show that the document signature is valid,
++ but the certificate could not be verified. If we do not prevent the verification of
++ the certificate by libxmlsec and the verification fails, then the XML signature may not be
++ verified. This would happen, for example, if the root certificate is not installed.
++
++ status = CERT_VerifyCertificate(CERT_GetDefaultCertDB(),
++ cert, PR_FALSE,
++ (SECCertificateUsage)0,
++ timeboundary , NULL, NULL, NULL);
++ if (status == SECSuccess) {
++ break;
++ }
++
++ */
++ status = SECSuccess;
++ break;
++
+ }
+
+ if (status == SECSuccess) {
--- /dev/null
+--- misc/xmlsec1-1.2.14.orig/src/nss/crypto.c 2009-09-10 07:06:17.000000000 -0400
++++ misc/build/xmlsec1-1.2.14/src/nss/crypto.c 2009-09-10 07:08:24.000000000 -0400
+@@ -136,6 +136,7 @@
+ /**
+ * High level routines form xmlsec command line utility
+ */
++#if 0
+ gXmlSecNssFunctions->cryptoAppInit = xmlSecNssAppInit;
+ gXmlSecNssFunctions->cryptoAppShutdown = xmlSecNssAppShutdown;
+ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrInit = xmlSecNssAppDefaultKeysMngrInit;
+@@ -153,6 +154,25 @@
+ gXmlSecNssFunctions->cryptoAppKeyLoad = xmlSecNssAppKeyLoad;
+ gXmlSecNssFunctions->cryptoAppKeyLoadMemory = xmlSecNssAppKeyLoadMemory;
+ gXmlSecNssFunctions->cryptoAppDefaultPwdCallback = (void*)xmlSecNssAppGetDefaultPwdCallback();
++#else
++ gXmlSecNssFunctions->cryptoAppInit = NULL ;
++ gXmlSecNssFunctions->cryptoAppShutdown = NULL ;
++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrInit = NULL ;
++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrAdoptKey = NULL ;
++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrLoad = NULL ;
++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrSave = NULL ;
++#ifndef XMLSEC_NO_X509
++ gXmlSecNssFunctions->cryptoAppKeysMngrCertLoad = NULL ;
++ gXmlSecNssFunctions->cryptoAppKeysMngrCertLoadMemory= NULL ;
++ gXmlSecNssFunctions->cryptoAppPkcs12Load = NULL ;
++ gXmlSecNssFunctions->cryptoAppPkcs12LoadMemory = NULL ;
++ gXmlSecNssFunctions->cryptoAppKeyCertLoad = NULL ;
++ gXmlSecNssFunctions->cryptoAppKeyCertLoadMemory = NULL ;
++#endif /* XMLSEC_NO_X509 */
++ gXmlSecNssFunctions->cryptoAppKeyLoad = NULL ;
++ gXmlSecNssFunctions->cryptoAppKeyLoadMemory = NULL ;
++ gXmlSecNssFunctions->cryptoAppDefaultPwdCallback = (void*)NULL ;
++#endif
+
+ return(gXmlSecNssFunctions);
+ }
--- /dev/null
+--- misc/xmlsec1-1.2.14/src/nss/ciphers.c 2009-09-10 05:16:27.000000000 -0400
++++ misc/build/xmlsec1-1.2.14/src/nss/ciphers.c 2009-09-10 06:59:39.000000000 -0400
+@@ -11,180 +11,421 @@
+
+ #include <string.h>
+
+-#include <nspr.h>
+ #include <nss.h>
+-#include <secoid.h>
+ #include <pk11func.h>
+
+ #include <xmlsec/xmlsec.h>
++#include <xmlsec/xmltree.h>
++#include <xmlsec/base64.h>
+ #include <xmlsec/keys.h>
+ #include <xmlsec/transforms.h>
+ #include <xmlsec/errors.h>
+
+ #include <xmlsec/nss/crypto.h>
+-
+-#define XMLSEC_NSS_MAX_KEY_SIZE 32
+-#define XMLSEC_NSS_MAX_IV_SIZE 32
+-#define XMLSEC_NSS_MAX_BLOCK_SIZE 32
++#include <xmlsec/nss/ciphers.h>
+
+ /**************************************************************************
+ *
+- * Internal Nss Block cipher CTX
++ * Internal Nss Block Cipher Context
++ * This context is designed for repositing a block cipher for transform
+ *
+ *****************************************************************************/
+-typedef struct _xmlSecNssBlockCipherCtx xmlSecNssBlockCipherCtx,
+- *xmlSecNssBlockCipherCtxPtr;
++typedef struct _xmlSecNssBlockCipherCtx xmlSecNssBlockCipherCtx ;
++typedef struct _xmlSecNssBlockCipherCtx* xmlSecNssBlockCipherCtxPtr ;
++
+ struct _xmlSecNssBlockCipherCtx {
+ CK_MECHANISM_TYPE cipher;
++ PK11SymKey* symkey ;
+ PK11Context* cipherCtx;
+ xmlSecKeyDataId keyId;
+- int keyInitialized;
+- int ctxInitialized;
+- xmlSecByte key[XMLSEC_NSS_MAX_KEY_SIZE];
+- xmlSecSize keySize;
+- xmlSecByte iv[XMLSEC_NSS_MAX_IV_SIZE];
+- xmlSecSize ivSize;
+ };
+-static int xmlSecNssBlockCipherCtxInit (xmlSecNssBlockCipherCtxPtr ctx,
+- xmlSecBufferPtr in,
+- xmlSecBufferPtr out,
+- int encrypt,
+- const xmlChar* cipherName,
+- xmlSecTransformCtxPtr transformCtx);
+-static int xmlSecNssBlockCipherCtxUpdate (xmlSecNssBlockCipherCtxPtr ctx,
+- xmlSecBufferPtr in,
+- xmlSecBufferPtr out,
+- int encrypt,
+- const xmlChar* cipherName,
+- xmlSecTransformCtxPtr transformCtx);
+-static int xmlSecNssBlockCipherCtxFinal (xmlSecNssBlockCipherCtxPtr ctx,
+- xmlSecBufferPtr in,
+- xmlSecBufferPtr out,
+- int encrypt,
+- const xmlChar* cipherName,
+- xmlSecTransformCtxPtr transformCtx);
++
++#define xmlSecNssBlockCipherSize \
++ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssBlockCipherCtx ) )
++
++#define xmlSecNssBlockCipherGetCtx( transform ) \
++ ( ( xmlSecNssBlockCipherCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) )
++
++static int
++xmlSecNssBlockCipherCheckId(
++ xmlSecTransformPtr transform
++) {
++ #ifndef XMLSEC_NO_DES
++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformDes3CbcId ) ) {
++ return 1 ;
++ }
++ #endif /* XMLSEC_NO_DES */
++
++ #ifndef XMLSEC_NO_AES
++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformAes128CbcId ) ||
++ xmlSecTransformCheckId( transform, xmlSecNssTransformAes192CbcId ) ||
++ xmlSecTransformCheckId( transform, xmlSecNssTransformAes256CbcId ) ) {
++
++ return 1 ;
++ }
++ #endif /* XMLSEC_NO_AES */
++
++ return 0 ;
++}
++
++static int
++xmlSecNssBlockCipherFetchCtx(
++ xmlSecNssBlockCipherCtxPtr context ,
++ xmlSecTransformId id
++) {
++ xmlSecAssert2( context != NULL, -1 ) ;
++
++ #ifndef XMLSEC_NO_DES
++ if( id == xmlSecNssTransformDes3CbcId ) {
++ context->cipher = CKM_DES3_CBC ;
++ context->keyId = xmlSecNssKeyDataDesId ;
++ } else
++ #endif /* XMLSEC_NO_DES */
++
++ #ifndef XMLSEC_NO_AES
++ if( id == xmlSecNssTransformAes128CbcId ) {
++ context->cipher = CKM_AES_CBC ;
++ context->keyId = xmlSecNssKeyDataAesId ;
++ } else
++ if( id == xmlSecNssTransformAes192CbcId ) {
++ context->cipher = CKM_AES_CBC ;
++ context->keyId = xmlSecNssKeyDataAesId ;
++ } else
++ if( id == xmlSecNssTransformAes256CbcId ) {
++ context->cipher = CKM_AES_CBC ;
++ context->keyId = xmlSecNssKeyDataAesId ;
++ } else
++ #endif /* XMLSEC_NO_AES */
++
++ if( 1 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ NULL ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ return 0 ;
++}
++
++/**
++ * xmlSecTransformInitializeMethod:
++ * @transform: the pointer to transform object.
++ *
++ * The transform specific initialization method.
++ *
++ * Returns 0 on success or a negative value otherwise.
++ */
++static int
++xmlSecNssBlockCipherInitialize(
++ xmlSecTransformPtr transform
++) {
++ xmlSecNssBlockCipherCtxPtr context = NULL ;
++
++ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ;
++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ;
++
++ context = xmlSecNssBlockCipherGetCtx( transform ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
++ "xmlSecNssBlockCipherGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( xmlSecNssBlockCipherFetchCtx( context , transform->id ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
++ "xmlSecNssBlockCipherFetchCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ context->symkey = NULL ;
++ context->cipherCtx = NULL ;
++
++ return 0 ;
++}
++
++/**
++ * xmlSecTransformFinalizeMethod:
++ * @transform: the pointer to transform object.
++ *
++ * The transform specific destroy method.
++ */
++static void
++xmlSecNssBlockCipherFinalize(
++ xmlSecTransformPtr transform
++) {
++ xmlSecNssBlockCipherCtxPtr context = NULL ;
++
++ xmlSecAssert( xmlSecNssBlockCipherCheckId( transform ) ) ;
++ xmlSecAssert( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ) ) ;
++
++ context = xmlSecNssBlockCipherGetCtx( transform ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
++ "xmlSecNssBlockCipherGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return ;
++ }
++
++ if( context->cipherCtx != NULL ) {
++ PK11_DestroyContext( context->cipherCtx, PR_TRUE ) ;
++ context->cipherCtx = NULL ;
++ }
++
++ if( context->symkey != NULL ) {
++ PK11_FreeSymKey( context->symkey ) ;
++ context->symkey = NULL ;
++ }
++
++ context->cipher = CKM_INVALID_MECHANISM ;
++ context->keyId = NULL ;
++}
++
++/**
++ * xmlSecTransformSetKeyRequirementsMethod:
++ * @transform: the pointer to transform object.
++ * @keyReq: the pointer to key requirements structure.
++ *
++ * Transform specific method to set transform's key requirements.
++ *
++ * Returns 0 on success or a negative value otherwise.
++ */
++static int
++xmlSecNssBlockCipherSetKeyReq(
++ xmlSecTransformPtr transform ,
++ xmlSecKeyReqPtr keyReq
++) {
++ xmlSecNssBlockCipherCtxPtr context = NULL ;
++ xmlSecSize cipherSize = 0 ;
++
++ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ;
++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ;
++ xmlSecAssert2( keyReq != NULL , -1 ) ;
++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ;
++
++ context = xmlSecNssBlockCipherGetCtx( transform ) ;
++ if( context == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
++ "xmlSecNssBlockCipherGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ keyReq->keyId = context->keyId ;
++ keyReq->keyType = xmlSecKeyDataTypeSymmetric ;
++
++ if( transform->operation == xmlSecTransformOperationEncrypt ) {
++ keyReq->keyUsage = xmlSecKeyUsageEncrypt ;
++ } else {
++ keyReq->keyUsage = xmlSecKeyUsageDecrypt ;
++ }
++
++ /*
++ if( context->symkey != NULL )
++ cipherSize = PK11_GetKeyLength( context->symkey ) ;
++
++ keyReq->keyBitsSize = cipherSize * 8 ;
++ */
++
++ return 0 ;
++}
++
++/**
++ * xmlSecTransformSetKeyMethod:
++ * @transform: the pointer to transform object.
++ * @key: the pointer to key.
++ *
++ * The transform specific method to set the key for use.
++ *
++ * Returns 0 on success or a negative value otherwise.
++ */
++static int
++xmlSecNssBlockCipherSetKey(
++ xmlSecTransformPtr transform ,
++ xmlSecKeyPtr key
++) {
++ xmlSecNssBlockCipherCtxPtr context = NULL ;
++ xmlSecKeyDataPtr keyData = NULL ;
++ PK11SymKey* symkey = NULL ;
++ CK_ATTRIBUTE_TYPE operation ;
++ int ivLen ;
++
++ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ;
++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ;
++ xmlSecAssert2( key != NULL , -1 ) ;
++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ;
++
++ context = xmlSecNssBlockCipherGetCtx( transform ) ;
++ if( context == NULL || context->keyId == NULL || context->symkey != NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
++ "xmlSecNssBlockCipherGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ;
++
++ keyData = xmlSecKeyGetValue( key ) ;
++ if( keyData == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) ,
++ "xmlSecKeyGetValue" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( ( symkey = xmlSecNssSymKeyDataGetKey( keyData ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) ,
++ "xmlSecNssSymKeyDataGetKey" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ context->symkey = symkey ;
++
++ return 0 ;
++}
++
+ static int
+ xmlSecNssBlockCipherCtxInit(xmlSecNssBlockCipherCtxPtr ctx,
+ xmlSecBufferPtr in, xmlSecBufferPtr out,
+ int encrypt,
+ const xmlChar* cipherName,
+ xmlSecTransformCtxPtr transformCtx) {
+- SECItem keyItem;
+ SECItem ivItem;
+- PK11SlotInfo* slot;
+- PK11SymKey* symKey;
++ SECItem* secParam = NULL ;
++ xmlSecBufferPtr ivBuf = NULL ;
+ int ivLen;
+- SECStatus rv;
+- int ret;
+
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(ctx->cipher != 0, -1);
++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2(ctx->cipherCtx == NULL, -1);
+- xmlSecAssert2(ctx->keyInitialized != 0, -1);
+- xmlSecAssert2(ctx->ctxInitialized == 0, -1);
++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2(in != NULL, -1);
+ xmlSecAssert2(out != NULL, -1);
+ xmlSecAssert2(transformCtx != NULL, -1);
+
+ ivLen = PK11_GetIVLength(ctx->cipher);
+- xmlSecAssert2(ivLen > 0, -1);
+- xmlSecAssert2((xmlSecSize)ivLen <= sizeof(ctx->iv), -1);
++ if( ivLen < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "PK11_GetIVLength" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( ( ivBuf = xmlSecBufferCreate( ivLen ) ) == NULL ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecBufferCreate" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
+
+ if(encrypt) {
+- /* generate random iv */
+- rv = PK11_GenerateRandom(ctx->iv, ivLen);
+- if(rv != SECSuccess) {
++ if( PK11_GenerateRandom( ivBuf->data , ivLen ) != SECSuccess ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "PK11_GenerateRandom",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- "size=%d", ivLen);
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(-1);
+ }
++ if( xmlSecBufferSetSize( ivBuf , ivLen ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ NULL ,
++ "xmlSecBufferSetSize" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ xmlSecBufferDestroy( ivBuf ) ;
++ return -1 ;
++ }
+
+- /* write iv to the output */
+- ret = xmlSecBufferAppend(out, ctx->iv, ivLen);
+- if(ret < 0) {
++ if( xmlSecBufferAppend( out , ivBuf->data , ivLen ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "xmlSecBufferAppend",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", ivLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(-1);
+ }
+
+ } else {
+- /* if we don't have enough data, exit and hope that
+- * we'll have iv next time */
+- if(xmlSecBufferGetSize(in) < (xmlSecSize)ivLen) {
+- return(0);
+- }
+-
+- /* copy iv to our buffer*/
+- xmlSecAssert2(xmlSecBufferGetData(in) != NULL, -1);
+- memcpy(ctx->iv, xmlSecBufferGetData(in), ivLen);
+-
+- /* and remove from input */
+- ret = xmlSecBufferRemoveHead(in, ivLen);
+- if(ret < 0) {
++ if( xmlSecBufferSetData( ivBuf , in->data , ivLen ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+- "xmlSecBufferRemoveHead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", ivLen);
++ "xmlSecBufferSetData",
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(-1);
+ }
+ }
+
+- memset(&keyItem, 0, sizeof(keyItem));
+- keyItem.data = ctx->key;
+- keyItem.len = ctx->keySize;
+- memset(&ivItem, 0, sizeof(ivItem));
+- ivItem.data = ctx->iv;
+- ivItem.len = ctx->ivSize;
+-
+- slot = PK11_GetBestSlot(ctx->cipher, NULL);
+- if(slot == NULL) {
++ if( xmlSecBufferRemoveHead( in , ivLen ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+- "PK11_GetBestSlot",
++ "xmlSecBufferRemoveHead",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(-1);
+ }
+
+- symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginDerive,
+- CKA_SIGN, &keyItem, NULL);
+- if(symKey == NULL) {
++ ivItem.data = xmlSecBufferGetData( ivBuf ) ;
++ ivItem.len = xmlSecBufferGetSize( ivBuf ) ;
++ if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+- "PK11_ImportSymKey",
++ "PK11_ParamFromIV",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+- PK11_FreeSlot(slot);
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(-1);
+ }
+
+ ctx->cipherCtx = PK11_CreateContextBySymKey(ctx->cipher,
+ (encrypt) ? CKA_ENCRYPT : CKA_DECRYPT,
+- symKey, &ivItem);
++ ctx->symkey, secParam);
+ if(ctx->cipherCtx == NULL) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+- "PK11_CreateContextBySymKey",
++ "xmlSecBufferRemoveHead",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+- PK11_FreeSymKey(symKey);
+- PK11_FreeSlot(slot);
++ SECITEM_FreeItem( secParam , PR_TRUE ) ;
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(-1);
+ }
+
+- ctx->ctxInitialized = 1;
+- PK11_FreeSymKey(symKey);
+- PK11_FreeSlot(slot);
++ SECITEM_FreeItem( secParam , PR_TRUE ) ;
++ xmlSecBufferDestroy( ivBuf ) ;
+ return(0);
+ }
+
++/**
++ * Block cipher transform update
++ */
+ static int
+ xmlSecNssBlockCipherCtxUpdate(xmlSecNssBlockCipherCtxPtr ctx,
+ xmlSecBufferPtr in, xmlSecBufferPtr out,
+@@ -192,54 +433,49 @@
+ const xmlChar* cipherName,
+ xmlSecTransformCtxPtr transformCtx) {
+ xmlSecSize inSize, inBlocks, outSize;
+- int blockLen;
++ int blockSize;
+ int outLen = 0;
+ xmlSecByte* outBuf;
+- SECStatus rv;
+- int ret;
+
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(ctx->cipher != 0, -1);
++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2(ctx->cipherCtx != NULL, -1);
+- xmlSecAssert2(ctx->ctxInitialized != 0, -1);
++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2(in != NULL, -1);
+ xmlSecAssert2(out != NULL, -1);
+ xmlSecAssert2(transformCtx != NULL, -1);
+
+- blockLen = PK11_GetBlockSize(ctx->cipher, NULL);
+- xmlSecAssert2(blockLen > 0, -1);
++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( cipherName ) ,
++ "PK11_GetBlockSize" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
+
+ inSize = xmlSecBufferGetSize(in);
+ outSize = xmlSecBufferGetSize(out);
+-
+- if(inSize < (xmlSecSize)blockLen) {
+- return(0);
++
++ inBlocks = ( encrypt != 0 ? inSize : ( inSize - 1 ) ) / blockSize ;
++ inSize = inBlocks * blockSize ;
++
++ if( inSize < blockSize ) {
++ return 0 ;
+ }
+
+- if(encrypt) {
+- inBlocks = inSize / ((xmlSecSize)blockLen);
+- } else {
+- /* we want to have the last block in the input buffer
+- * for padding check */
+- inBlocks = (inSize - 1) / ((xmlSecSize)blockLen);
+- }
+- inSize = inBlocks * ((xmlSecSize)blockLen);
+-
+- /* we write out the input size plus may be one block */
+- ret = xmlSecBufferSetMaxSize(out, outSize + inSize + blockLen);
+- if(ret < 0) {
++ if( xmlSecBufferSetMaxSize( out , outSize + inSize + blockSize ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "xmlSecBufferSetMaxSize",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", outSize + inSize + blockLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ outBuf = xmlSecBufferGetData(out) + outSize;
+
+- rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, inSize + blockLen,
+- xmlSecBufferGetData(in), inSize);
+- if(rv != SECSuccess) {
++ if(PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData( in ) , inSize ) != SECSuccess ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "PK11_CipherOp",
+@@ -247,27 +483,22 @@
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+- xmlSecAssert2((xmlSecSize)outLen == inSize, -1);
+
+- /* set correct output buffer size */
+- ret = xmlSecBufferSetSize(out, outSize + outLen);
+- if(ret < 0) {
++ if( xmlSecBufferSetSize( out , outSize + outLen ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "xmlSecBufferSetSize",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", outSize + outLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+
+- /* remove the processed block from input */
+- ret = xmlSecBufferRemoveHead(in, inSize);
+- if(ret < 0) {
++ if( xmlSecBufferRemoveHead( in , inSize ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "xmlSecBufferRemoveHead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", inSize);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ return(0);
+@@ -281,81 +512,82 @@
+ const xmlChar* cipherName,
+ xmlSecTransformCtxPtr transformCtx) {
+ xmlSecSize inSize, outSize;
+- int blockLen, outLen = 0;
++ int blockSize, outLen = 0;
+ xmlSecByte* inBuf;
+ xmlSecByte* outBuf;
+- SECStatus rv;
+- int ret;
+
+ xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(ctx->cipher != 0, -1);
++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
+ xmlSecAssert2(ctx->cipherCtx != NULL, -1);
+- xmlSecAssert2(ctx->ctxInitialized != 0, -1);
++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
+ xmlSecAssert2(in != NULL, -1);
+ xmlSecAssert2(out != NULL, -1);
+ xmlSecAssert2(transformCtx != NULL, -1);
+
+- blockLen = PK11_GetBlockSize(ctx->cipher, NULL);
+- xmlSecAssert2(blockLen > 0, -1);
++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( cipherName ) ,
++ "PK11_GetBlockSize" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
+
+ inSize = xmlSecBufferGetSize(in);
+ outSize = xmlSecBufferGetSize(out);
+
++ /******************************************************************/
+ if(encrypt != 0) {
+- xmlSecAssert2(inSize < (xmlSecSize)blockLen, -1);
++ xmlSecAssert2( inSize < blockSize, -1 ) ;
+
+ /* create padding */
+- ret = xmlSecBufferSetMaxSize(in, blockLen);
+- if(ret < 0) {
++ if( xmlSecBufferSetMaxSize( in , blockSize ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "xmlSecBufferSetMaxSize",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", blockLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ inBuf = xmlSecBufferGetData(in);
+
+- /* generate random padding */
+- if((xmlSecSize)blockLen > (inSize + 1)) {
+- rv = PK11_GenerateRandom(inBuf + inSize, blockLen - inSize - 1);
+- if(rv != SECSuccess) {
++ /* generate random */
++ if( blockSize > ( inSize + 1 ) ) {
++ if( PK11_GenerateRandom( inBuf + inSize, blockSize - inSize - 1 ) != SECSuccess ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "PK11_GenerateRandom",
+ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+- "size=%d", blockLen - inSize - 1);
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ }
+- inBuf[blockLen - 1] = blockLen - inSize;
+- inSize = blockLen;
++ inBuf[blockSize-1] = blockSize - inSize ;
++ inSize = blockSize ;
+ } else {
+- if(inSize != (xmlSecSize)blockLen) {
++ if( inSize != blockSize ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
+- "data=%d;block=%d", inSize, blockLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ }
+
+- /* process last block */
+- ret = xmlSecBufferSetMaxSize(out, outSize + 2 * blockLen);
+- if(ret < 0) {
++ /* process the last block */
++ if( xmlSecBufferSetMaxSize( out , outSize + inSize + blockSize ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "xmlSecBufferSetMaxSize",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", outSize + 2 * blockLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ outBuf = xmlSecBufferGetData(out) + outSize;
+
+- rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, 2 * blockLen,
+- xmlSecBufferGetData(in), inSize);
+- if(rv != SECSuccess) {
++ if( PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData( in ) , inSize ) != SECSuccess ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ "PK11_CipherOp",
+@@ -363,300 +595,169 @@
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+- xmlSecAssert2((xmlSecSize)outLen == inSize, -1);
+
+ if(encrypt == 0) {
+ /* check padding */
+- if(outLen < outBuf[blockLen - 1]) {
++ if( outLen < outBuf[blockSize-1] ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+ NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
+- "padding=%d;buffer=%d",
+- outBuf[blockLen - 1], outLen);
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
++ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+- outLen -= outBuf[blockLen - 1];
++ outLen -= outBuf[blockSize-1] ;
+ }
+
+- /* set correct output buffer size */
+- ret = xmlSecBufferSetSize(out, outSize + outLen);
+- if(ret < 0) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(cipherName),
+- "xmlSecBufferSetSize",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", outSize + outLen);
+- return(-1);
+- }
++ /******************************************************************/
+
+- /* remove the processed block from input */
+- ret = xmlSecBufferRemoveHead(in, inSize);
+- if(ret < 0) {
++ /******************************************************************
++ if( xmlSecBufferSetMaxSize( out , outSize + blockSize ) < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(cipherName),
+- "xmlSecBufferRemoveHead",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
+- "size=%d", inSize);
+- return(-1);
+- }
+-
+- return(0);
+-}
+-
+-
+-/******************************************************************************
+- *
+- * EVP Block Cipher transforms
+- *
+- * xmlSecNssBlockCipherCtx block is located after xmlSecTransform structure
+- *
+- *****************************************************************************/
+-#define xmlSecNssBlockCipherSize \
+- (sizeof(xmlSecTransform) + sizeof(xmlSecNssBlockCipherCtx))
+-#define xmlSecNssBlockCipherGetCtx(transform) \
+- ((xmlSecNssBlockCipherCtxPtr)(((xmlSecByte*)(transform)) + sizeof(xmlSecTransform)))
+-
+-static int xmlSecNssBlockCipherInitialize (xmlSecTransformPtr transform);
+-static void xmlSecNssBlockCipherFinalize (xmlSecTransformPtr transform);
+-static int xmlSecNssBlockCipherSetKeyReq (xmlSecTransformPtr transform,
+- xmlSecKeyReqPtr keyReq);
+-static int xmlSecNssBlockCipherSetKey (xmlSecTransformPtr transform,
+- xmlSecKeyPtr key);
+-static int xmlSecNssBlockCipherExecute (xmlSecTransformPtr transform,
+- int last,
+- xmlSecTransformCtxPtr transformCtx);
+-static int xmlSecNssBlockCipherCheckId (xmlSecTransformPtr transform);
+-
+-
+-
+-static int
+-xmlSecNssBlockCipherCheckId(xmlSecTransformPtr transform) {
+-#ifndef XMLSEC_NO_DES
+- if(xmlSecTransformCheckId(transform, xmlSecNssTransformDes3CbcId)) {
+- return(1);
+- }
+-#endif /* XMLSEC_NO_DES */
+-
+-#ifndef XMLSEC_NO_AES
+- if(xmlSecTransformCheckId(transform, xmlSecNssTransformAes128CbcId) ||
+- xmlSecTransformCheckId(transform, xmlSecNssTransformAes192CbcId) ||
+- xmlSecTransformCheckId(transform, xmlSecNssTransformAes256CbcId)) {
+-
+- return(1);
+- }
+-#endif /* XMLSEC_NO_AES */
+-
+- return(0);
+-}
+-
+-static int
+-xmlSecNssBlockCipherInitialize(xmlSecTransformPtr transform) {
+- xmlSecNssBlockCipherCtxPtr ctx;
+-
+- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1);
+- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1);
+-
+- ctx = xmlSecNssBlockCipherGetCtx(transform);
+- xmlSecAssert2(ctx != NULL, -1);
+-
+- memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx));
+-
+-#ifndef XMLSEC_NO_DES
+- if(transform->id == xmlSecNssTransformDes3CbcId) {
+- ctx->cipher = CKM_DES3_CBC;
+- ctx->keyId = xmlSecNssKeyDataDesId;
+- ctx->keySize = 24;
+- } else
+-#endif /* XMLSEC_NO_DES */
+-
+-#ifndef XMLSEC_NO_AES
+- if(transform->id == xmlSecNssTransformAes128CbcId) {
+- ctx->cipher = CKM_AES_CBC;
+- ctx->keyId = xmlSecNssKeyDataAesId;
+- ctx->keySize = 16;
+- } else if(transform->id == xmlSecNssTransformAes192CbcId) {
+- ctx->cipher = CKM_AES_CBC;
+- ctx->keyId = xmlSecNssKeyDataAesId;
+- ctx->keySize = 24;
+- } else if(transform->id == xmlSecNssTransformAes256CbcId) {
+- ctx->cipher = CKM_AES_CBC;
+- ctx->keyId = xmlSecNssKeyDataAesId;
+- ctx->keySize = 32;
+- } else
+-#endif /* XMLSEC_NO_AES */
+-
+- if(1) {
+- xmlSecError(XMLSEC_ERRORS_HERE,
+- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_TRANSFORM,
++ "xmlSecBufferSetMaxSize",
++ XMLSEC_ERRORS_R_CRYPTO_FAILED,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+- }
+-
+- return(0);
+-}
+-
+-static void
+-xmlSecNssBlockCipherFinalize(xmlSecTransformPtr transform) {
+- xmlSecNssBlockCipherCtxPtr ctx;
+-
+- xmlSecAssert(xmlSecNssBlockCipherCheckId(transform));
+- xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize));
+-
+- ctx = xmlSecNssBlockCipherGetCtx(transform);
+- xmlSecAssert(ctx != NULL);
+-
+- if(ctx->cipherCtx != NULL) {
+- PK11_DestroyContext(ctx->cipherCtx, PR_TRUE);
+ }
+-
+- memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx));
+-}
+
+-static int
+-xmlSecNssBlockCipherSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) {
+- xmlSecNssBlockCipherCtxPtr ctx;
+-
+- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1);
+- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1);
+- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1);
+- xmlSecAssert2(keyReq != NULL, -1);
+-
+- ctx = xmlSecNssBlockCipherGetCtx(transform);
+- xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(ctx->keyId != NULL, -1);
++ outBuf = xmlSecBufferGetData( out ) + outSize ;
++ if( PK11_DigestFinal( ctx->cipherCtx , outBuf , &outLen , blockSize ) != SECSuccess ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( cipherName ) ,
++ "PK11_DigestFinal" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++ ******************************************************************/
++
++ if( xmlSecBufferSetSize( out , outSize + outLen ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( cipherName ) ,
++ "xmlSecBufferSetSize" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++ if( xmlSecBufferRemoveHead( in , inSize ) < 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( cipherName ) ,
++ "xmlSecBufferRemoveHead" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
++ return -1 ;
++ }
++
++/* PK11_Finalize( ctx->cipherCtx ) ;*/
++ PK11_DestroyContext(ctx->cipherCtx, PR_TRUE);
++ ctx->cipherCtx = NULL ;
+
+- keyReq->keyId = ctx->keyId;
+- keyReq->keyType = xmlSecKeyDataTypeSymmetric;
+- if(transform->operation == xmlSecTransformOperationEncrypt) {
+- keyReq->keyUsage = xmlSecKeyUsageEncrypt;
+- } else {
+- keyReq->keyUsage = xmlSecKeyUsageDecrypt;
+- }
+- keyReq->keyBitsSize = 8 * ctx->keySize;
+ return(0);
+ }
+
+-static int
+-xmlSecNssBlockCipherSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) {
+- xmlSecNssBlockCipherCtxPtr ctx;
+- xmlSecBufferPtr buffer;
++/**
++ * xmlSecTransformExecuteMethod:
++ * @transform: the pointer to transform object.
++ * @last: the flag: if set to 1 then it's the last data chunk.
++ * @transformCtx: the pointer to transform context object.
++ *
++ * Transform specific method to process a chunk of data.
++ *
++ * Returns 0 on success or a negative value otherwise.
++ */
++xmlSecNssBlockCipherExecute(
++ xmlSecTransformPtr transform ,
++ int last ,
++ xmlSecTransformCtxPtr transformCtx
++) {
++ xmlSecNssBlockCipherCtxPtr context = NULL ;
++ xmlSecBufferPtr inBuf = NULL ;
++ xmlSecBufferPtr outBuf = NULL ;
++ const xmlChar* cipherName ;
++ int operation ;
++ int rtv ;
+
+ xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1);
+- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1);
+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1);
+- xmlSecAssert2(key != NULL, -1);
+-
+- ctx = xmlSecNssBlockCipherGetCtx(transform);
+- xmlSecAssert2(ctx != NULL, -1);
+- xmlSecAssert2(ctx->cipher != 0, -1);
+- xmlSecAssert2(ctx->keyInitialized == 0, -1);
+- xmlSecAssert2(ctx->keyId != NULL, -1);
+- xmlSecAssert2(xmlSecKeyCheckId(key, ctx->keyId), -1);
+-
+- xmlSecAssert2(ctx->keySize > 0, -1);
+- xmlSecAssert2(ctx->keySize <= sizeof(ctx->key), -1);
+
+- buffer = xmlSecKeyDataBinaryValueGetBuffer(xmlSecKeyGetValue(key));
+- xmlSecAssert2(buffer != NULL, -1);
++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ;
++ xmlSecAssert2( transformCtx != NULL , -1 ) ;
+
+- if(xmlSecBufferGetSize(buffer) < ctx->keySize) {
++ context = xmlSecNssBlockCipherGetCtx( transform ) ;
++ if( context == NULL ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+- NULL,
+- XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE,
+- "keySize=%d;expected=%d",
+- xmlSecBufferGetSize(buffer), ctx->keySize);
+- return(-1);
++ "xmlSecNssBlockCipherGetCtx" ,
++ XMLSEC_ERRORS_R_CRYPTO_FAILED ,
++ XMLSEC_ERRORS_NO_MESSAGE ) ;
+ }
+-
+- xmlSecAssert2(xmlSecBufferGetData(buffer) != NULL, -1);
+- memcpy(ctx->key, xmlSecBufferGetData(buffer), ctx->keySize);
+-
+- ctx->keyInitialized = 1;
+- return(0);
+-}
+-
+-static int
+-xmlSecNssBlockCipherExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) {
+- xmlSecNssBlockCipherCtxPtr ctx;
+- xmlSecBufferPtr in, out;
+- int ret;
+-
+- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1);
+- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1);
+- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1);
+- xmlSecAssert2(transformCtx != NULL, -1);
+
+- in = &(transform->inBuf);
+- out = &(transform->outBuf);
+-
+- ctx = xmlSecNssBlockCipherGetCtx(transform);
+- xmlSecAssert2(ctx != NULL, -1);
++ inBuf = &( transform->inBuf ) ;
++ outBuf = &( transform->outBuf ) ;
+
+ if(transform->status == xmlSecTransformStatusNone) {
+ transform->status = xmlSecTransformStatusWorking;
+ }
+
++ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ;
++ cipherName = xmlSecTransformGetName( transform ) ;
++
+ if(transform->status == xmlSecTransformStatusWorking) {
+- if(ctx->ctxInitialized == 0) {
+- ret = xmlSecNssBlockCipherCtxInit(ctx, in, out,
+- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0,
+- xmlSecTransformGetName(transform), transformCtx);
+- if(ret < 0) {
++ if( context->cipherCtx == NULL ) {
++ rtv = xmlSecNssBlockCipherCtxInit( context, inBuf , outBuf , operation , cipherName , transformCtx ) ;
++ if( rtv < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+ "xmlSecNssBlockCipherCtxInit",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_R_INVALID_STATUS,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ }
+- if((ctx->ctxInitialized == 0) && (last != 0)) {
++ if( context->cipherCtx == NULL && last != 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+ NULL,
+- XMLSEC_ERRORS_R_INVALID_DATA,
++ XMLSEC_ERRORS_R_INVALID_STATUS,
+ "not enough data to initialize transform");
+ return(-1);
+ }
+
+- if(ctx->ctxInitialized != 0) {
+- ret = xmlSecNssBlockCipherCtxUpdate(ctx, in, out,
+- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0,
+- xmlSecTransformGetName(transform), transformCtx);
+- if(ret < 0) {
++ if( context->cipherCtx != NULL ) {
++ rtv = xmlSecNssBlockCipherCtxUpdate( context, inBuf , outBuf , operation , cipherName , transformCtx ) ;
++ if( rtv < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+ "xmlSecNssBlockCipherCtxUpdate",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_R_INVALID_STATUS,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ }
+
+ if(last) {
+- ret = xmlSecNssBlockCipherCtxFinal(ctx, in, out,
+- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0,
+- xmlSecTransformGetName(transform), transformCtx);
+- if(ret < 0) {
++ rtv = xmlSecNssBlockCipherCtxFinal( context, inBuf , outBuf , operation , cipherName , transformCtx ) ;
++ if( rtv < 0 ) {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
+ "xmlSecNssBlockCipherCtxFinal",
+- XMLSEC_ERRORS_R_XMLSEC_FAILED,
++ XMLSEC_ERRORS_R_INVALID_STATUS,
+ XMLSEC_ERRORS_NO_MESSAGE);
+ return(-1);
+ }
+ transform->status = xmlSecTransformStatusFinished;
+ }
+ } else if(transform->status == xmlSecTransformStatusFinished) {
+- /* the only way we can get here is if there is no input */
+- xmlSecAssert2(xmlSecBufferGetSize(in) == 0, -1);
+- } else if(transform->status == xmlSecTransformStatusNone) {
+- /* the only way we can get here is if there is no enough data in the input */
+- xmlSecAssert2(last == 0, -1);
++ if( xmlSecBufferGetSize( inBuf ) != 0 ) {
++ xmlSecError( XMLSEC_ERRORS_HERE ,
++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) ,
++ NULL ,
++ XMLSEC_ERRORS_R_INVALID_STATUS ,
++ "status=%d", transform->status ) ;
++ return -1 ;
++ }
+ } else {
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
--- /dev/null
+--- misc/xmlsec1-1.2.14/src/c14n.c 2010-03-02 15:46:05.000000000 +0000
++++ misc/build/xmlsec1-1.2.14/src/c14n.c 2010-03-02 15:50:35.000000000 +0000
+@@ -406,6 +406,20 @@
+ return(0);
+ }
+
++#if !defined(LIBXML_VERSION) || LIBXML_VERSION < 20704
++/*
++ * xmlC14NMode:
++ *
++ * Predefined values for C14N modes
++ *
++ */
++typedef enum {
++ XML_C14N_1_0 = 0, /* Origianal C14N 1.0 spec */
++ XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
++ XML_C14N_1_1 = 2 /* C14N 1.1 spec */
++} xmlC14NMode;
++#endif
++
+ static int
+ xmlSecTransformC14NExecute(xmlSecTransformId id, xmlSecNodeSetPtr nodes, xmlChar** nsList,
+ xmlOutputBufferPtr buf) {
--- /dev/null
+--- /dev/null 2012-11-27 15:14:41.892226008 +0100
++++ misc/xmlsec1-1.2.14/compile 2012-11-29 12:27:14.000000000 +0100
+@@ -0,0 +1,142 @@
++#! /bin/sh
++# Wrapper for compilers which do not understand `-c -o'.
++
++scriptversion=2005-05-14.22
++
++# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
++# Written by Tom Tromey <tromey@cygnus.com>.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# This file is maintained in Automake, please report
++# bugs to <bug-automake@gnu.org> or send patches to
++# <automake-patches@gnu.org>.
++
++case $1 in
++ '')
++ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
++ exit 1;
++ ;;
++ -h | --h*)
++ cat <<\EOF
++Usage: compile [--help] [--version] PROGRAM [ARGS]
++
++Wrapper for compilers which do not understand `-c -o'.
++Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
++arguments, and rename the output as expected.
++
++If you are trying to build a whole package this is not the
++right script to run: please start by reading the file `INSTALL'.
++
++Report bugs to <bug-automake@gnu.org>.
++EOF
++ exit $?
++ ;;
++ -v | --v*)
++ echo "compile $scriptversion"
++ exit $?
++ ;;
++esac
++
++ofile=
++cfile=
++eat=
++
++for arg
++do
++ if test -n "$eat"; then
++ eat=
++ else
++ case $1 in
++ -o)
++ # configure might choose to run compile as `compile cc -o foo foo.c'.
++ # So we strip `-o arg' only if arg is an object.
++ eat=1
++ case $2 in
++ *.o | *.obj)
++ ofile=$2
++ ;;
++ *)
++ set x "$@" -o "$2"
++ shift
++ ;;
++ esac
++ ;;
++ *.c)
++ cfile=$1
++ set x "$@" "$1"
++ shift
++ ;;
++ *)
++ set x "$@" "$1"
++ shift
++ ;;
++ esac
++ fi
++ shift
++done
++
++if test -z "$ofile" || test -z "$cfile"; then
++ # If no `-o' option was seen then we might have been invoked from a
++ # pattern rule where we don't need one. That is ok -- this is a
++ # normal compilation that the losing compiler can handle. If no
++ # `.c' file was seen then we are probably linking. That is also
++ # ok.
++ exec "$@"
++fi
++
++# Name of file we expect compiler to create.
++cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
++
++# Create the lock directory.
++# Note: use `[/.-]' here to ensure that we don't use the same name
++# that we are using for the .o file. Also, base the name on the expected
++# object file name, since that is what matters with a parallel build.
++lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
++while true; do
++ if mkdir "$lockdir" >/dev/null 2>&1; then
++ break
++ fi
++ sleep 1
++done
++# FIXME: race condition here if user kills between mkdir and trap.
++trap "rmdir '$lockdir'; exit 1" 1 2 15
++
++# Run the compile.
++"$@"
++ret=$?
++
++if test -f "$cofile"; then
++ mv "$cofile" "$ofile"
++elif test -f "${cofile}bj"; then
++ mv "${cofile}bj" "$ofile"
++fi
++
++rmdir "$lockdir"
++exit $ret
++
++# Local Variables:
++# mode: shell-script
++# sh-indentation: 2
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "scriptversion="
++# time-stamp-format: "%:y-%02m-%02d.%02H"
++# time-stamp-end: "$"
++# End:
--- /dev/null
+From dd15aae9ce221198be486a6e75d5a42f75ff9de6 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Tue, 13 May 2014 16:35:04 +0200
+Subject: [PATCH] update config.* to support ppc64le
+
+---
+ config.guess | 541 +++++++++++++++++++++++++++++------------------------------
+ config.sub | 301 ++++++++++++++++++++++-----------
+ 2 files changed, 472 insertions(+), 370 deletions(-)
+
+diff --git a/config.guess b/config.guess
+index da83314..b79252d 100755
+--- a/config.guess
++++ b/config.guess
+@@ -1,14 +1,12 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+-# Free Software Foundation, Inc.
++# Copyright 1992-2013 Free Software Foundation, Inc.
+
+-timestamp='2009-04-27'
++timestamp='2013-06-10'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
++# the Free Software Foundation; either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -17,26 +15,22 @@ timestamp='2009-04-27'
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
+-
+-
+-# Originally written by Per Bothner <per@bothner.com>.
+-# Please send patches to <config-patches@gnu.org>. Submit a context
+-# diff and a properly formatted ChangeLog entry.
++# the same distribution terms that you use for the rest of that
++# program. This Exception is an additional permission under section 7
++# of the GNU General Public License, version 3 ("GPLv3").
++#
++# Originally written by Per Bothner.
+ #
+-# This script attempts to guess a canonical system name similar to
+-# config.sub. If it succeeds, it prints the system name on stdout, and
+-# exits with 0. Otherwise, it exits with 1.
++# You can get the latest version of this script from:
++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ #
+-# The plan is that this can be called by configure scripts if you
+-# don't specify an explicit build system type.
++# Please send patches with a ChangeLog entry to config-patches@gnu.org.
++
+
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+@@ -56,8 +50,7 @@ version="\
+ GNU config.guess ($timestamp)
+
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++Copyright 1992-2013 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
++case "${UNAME_SYSTEM}" in
++Linux|GNU|GNU/*)
++ # If the system lacks a compiler, then just pick glibc.
++ # We could probably try harder.
++ LIBC=gnu
++
++ eval $set_cc_for_build
++ cat <<-EOF > $dummy.c
++ #include <features.h>
++ #if defined(__UCLIBC__)
++ LIBC=uclibc
++ #elif defined(__dietlibc__)
++ LIBC=dietlibc
++ #else
++ LIBC=gnu
++ #endif
++ EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
++ ;;
++esac
++
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+@@ -170,7 +184,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+- | grep __ELF__ >/dev/null
++ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+@@ -180,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ fi
+ ;;
+ *)
+- os=netbsd
++ os=netbsd
+ ;;
+ esac
+ # The OS release
+@@ -201,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
++ *:Bitrig:*:*)
++ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
++ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
++ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+@@ -223,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+@@ -269,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- exit ;;
++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
++ exitcode=$?
++ trap '' 0
++ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+@@ -295,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+- echo powerpc-ibm-os400
++ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+- arm:riscos:*:*|arm:RISCOS:*:*)
++ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+@@ -333,6 +354,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
++ echo i386-pc-auroraux${UNAME_RELEASE}
++ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+@@ -391,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+- echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+- exit ;;
++ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+- echo m68k-atari-mint${UNAME_RELEASE}
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+- echo m68k-milan-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-milan-mint${UNAME_RELEASE}
++ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+- echo m68k-hades-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-hades-mint${UNAME_RELEASE}
++ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+- echo m68k-unknown-mint${UNAME_RELEASE}
+- exit ;;
++ echo m68k-unknown-mint${UNAME_RELEASE}
++ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+@@ -477,8 +501,8 @@ EOF
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+- # DG/UX returns AViiON for all architectures
+- UNAME_PROCESSOR=`/usr/bin/uname -p`
++ # DG/UX returns AViiON for all architectures
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+@@ -491,7 +515,7 @@ EOF
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+- exit ;;
++ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+@@ -548,7 +572,7 @@ EOF
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+- *:AIX:*:[456])
++ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+@@ -591,52 +615,52 @@ EOF
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+- case "${sc_cpu_version}" in
+- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+- 532) # CPU_PA_RISC2_0
+- case "${sc_kernel_bits}" in
+- 32) HP_ARCH="hppa2.0n" ;;
+- 64) HP_ARCH="hppa2.0w" ;;
++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++ case "${sc_cpu_version}" in
++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++ 532) # CPU_PA_RISC2_0
++ case "${sc_kernel_bits}" in
++ 32) HP_ARCH="hppa2.0n" ;;
++ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+- esac ;;
+- esac
++ esac ;;
++ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
++ sed 's/^ //' << EOF >$dummy.c
+
+- #define _HPUX_SOURCE
+- #include <stdlib.h>
+- #include <unistd.h>
++ #define _HPUX_SOURCE
++ #include <stdlib.h>
++ #include <unistd.h>
+
+- int main ()
+- {
+- #if defined(_SC_KERNEL_BITS)
+- long bits = sysconf(_SC_KERNEL_BITS);
+- #endif
+- long cpu = sysconf (_SC_CPU_VERSION);
++ int main ()
++ {
++ #if defined(_SC_KERNEL_BITS)
++ long bits = sysconf(_SC_KERNEL_BITS);
++ #endif
++ long cpu = sysconf (_SC_CPU_VERSION);
+
+- switch (cpu)
+- {
+- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+- case CPU_PA_RISC2_0:
+- #if defined(_SC_KERNEL_BITS)
+- switch (bits)
+- {
+- case 64: puts ("hppa2.0w"); break;
+- case 32: puts ("hppa2.0n"); break;
+- default: puts ("hppa2.0"); break;
+- } break;
+- #else /* !defined(_SC_KERNEL_BITS) */
+- puts ("hppa2.0"); break;
+- #endif
+- default: puts ("hppa1.0"); break;
+- }
+- exit (0);
+- }
++ switch (cpu)
++ {
++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
++ case CPU_PA_RISC2_0:
++ #if defined(_SC_KERNEL_BITS)
++ switch (bits)
++ {
++ case 64: puts ("hppa2.0w"); break;
++ case 32: puts ("hppa2.0n"); break;
++ default: puts ("hppa2.0"); break;
++ } break;
++ #else /* !defined(_SC_KERNEL_BITS) */
++ puts ("hppa2.0"); break;
++ #endif
++ default: puts ("hppa1.0"); break;
++ }
++ exit (0);
++ }
+ EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+@@ -656,7 +680,7 @@ EOF
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+- grep __LP64__ >/dev/null
++ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+@@ -727,22 +751,22 @@ EOF
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+- exit ;;
++ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+- exit ;;
++ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+- exit ;;
++ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+- exit ;;
++ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+- exit ;;
++ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+@@ -766,14 +790,14 @@ EOF
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+- exit ;;
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+@@ -785,34 +809,39 @@ EOF
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+- case ${UNAME_MACHINE} in
+- pc98)
+- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
++ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
++ *:MINGW64*:*)
++ echo ${UNAME_MACHINE}-pc-mingw64
++ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
++ i*:MSYS*:*)
++ echo ${UNAME_MACHINE}-pc-msys
++ exit ;;
+ i*:windows32*:*)
+- # uname -m includes "-pc" on this system.
+- echo ${UNAME_MACHINE}-mingw32
++ # uname -m includes "-pc" on this system.
++ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+- *:Interix*:[3456]*)
+- case ${UNAME_MACHINE} in
++ *:Interix*:*)
++ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+- EM64T | authenticamd | genuineintel)
++ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+@@ -822,6 +851,9 @@ EOF
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
++ 8664:Windows_NT:*)
++ echo x86_64-pc-mks
++ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+@@ -842,210 +874,157 @@ EOF
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
++ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
++ aarch64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
++ aarch64_be:Linux:*:*)
++ UNAME_MACHINE=aarch64_be
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
++ alpha:Linux:*:*)
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep -q ld.so.1
++ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
++ arc:Linux:*:* | arceb:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep -q __ARM_PCS_VFP
++ then
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
++ else
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
++ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+- echo cris-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+- echo crisv32-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+- echo frv-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
++ hexagon:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
++ i*86:Linux:*:*)
++ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+- mips:Linux:*:*)
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #undef CPU
+- #undef mips
+- #undef mipsel
+- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+- CPU=mipsel
+- #else
+- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+- CPU=mips
+- #else
+- CPU=
+- #endif
+- #endif
+-EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^CPU/{
+- s: ::g
+- p
+- }'`"
+- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+- ;;
+- mips64:Linux:*:*)
++ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+- #undef mips64
+- #undef mips64el
++ #undef ${UNAME_MACHINE}
++ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+- CPU=mips64el
++ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+- CPU=mips64
++ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+ EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^CPU/{
+- s: ::g
+- p
+- }'`"
+- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+- or32:Linux:*:*)
+- echo or32-unknown-linux-gnu
+- exit ;;
+- ppc:Linux:*:*)
+- echo powerpc-unknown-linux-gnu
++ or1k:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+- ppc64:Linux:*:*)
+- echo powerpc64-unknown-linux-gnu
+- exit ;;
+- alpha:Linux:*:*)
+- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+- EV5) UNAME_MACHINE=alphaev5 ;;
+- EV56) UNAME_MACHINE=alphaev56 ;;
+- PCA56) UNAME_MACHINE=alphapca56 ;;
+- PCA57) UNAME_MACHINE=alphapca56 ;;
+- EV6) UNAME_MACHINE=alphaev6 ;;
+- EV67) UNAME_MACHINE=alphaev67 ;;
+- EV68*) UNAME_MACHINE=alphaev68 ;;
+- esac
+- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ or32:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+- echo sparc-unknown-linux-gnu
++ echo sparc-unknown-linux-${LIBC}
++ exit ;;
++ parisc64:Linux:*:* | hppa64:Linux:*:*)
++ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+- PA7*) echo hppa1.1-unknown-linux-gnu ;;
+- PA8*) echo hppa2.0-unknown-linux-gnu ;;
+- *) echo hppa-unknown-linux-gnu ;;
++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+- parisc64:Linux:*:* | hppa64:Linux:*:*)
+- echo hppa64-unknown-linux-gnu
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-${LIBC}
++ exit ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-${LIBC}
++ exit ;;
++ ppc64le:Linux:*:*)
++ echo powerpc64le-unknown-linux-${LIBC}
++ exit ;;
++ ppcle:Linux:*:*)
++ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+- echo ${UNAME_MACHINE}-ibm-linux
++ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ exit ;;
+ sh64*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++ exit ;;
++ tile*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+- echo ${UNAME_MACHINE}-dec-linux-gnu
++ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+- echo x86_64-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+- i*86:Linux:*:*)
+- # The BFD linker knows what the default object file format is, so
+- # first see if it will tell us. cd to the root directory to prevent
+- # problems with other programs or directories called `ld' in the path.
+- # Set LC_ALL=C to ensure ld outputs messages in English.
+- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+- | sed -ne '/supported targets:/!d
+- s/[ ][ ]*/ /g
+- s/.*supported targets: *//
+- s/ .*//
+- p'`
+- case "$ld_supported_targets" in
+- elf32-i386)
+- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+- ;;
+- a.out-i386-linux)
+- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+- exit ;;
+- "")
+- # Either a pre-BFD a.out linker (linux-gnuoldld) or
+- # one that does not give us useful --help.
+- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+- exit ;;
+- esac
+- # Determine whether the default compiler is a.out or elf
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #include <features.h>
+- #ifdef __ELF__
+- # ifdef __GLIBC__
+- # if __GLIBC__ >= 2
+- LIBC=gnu
+- # else
+- LIBC=gnulibc1
+- # endif
+- # else
+- LIBC=gnulibc1
+- # endif
+- #else
+- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+- LIBC=gnu
+- #else
+- LIBC=gnuaout
+- #endif
+- #endif
+- #ifdef __dietlibc__
+- LIBC=dietlibc
+- #endif
+-EOF
+- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+- /^LIBC/{
+- s: ::g
+- p
+- }'`"
+- test x"${LIBC}" != x && {
+- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+- exit
+- }
+- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+- ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+@@ -1053,11 +1032,11 @@ EOF
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+- # Unixware is an offshoot of SVR4, but it has its own version
+- # number series starting with 2...
+- # I am not positive that other SVR4 systems won't match this,
++ # Unixware is an offshoot of SVR4, but it has its own version
++ # number series starting with 2...
++ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+- # Use sysv4.2uw... so that sysv4* matches it.
++ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+@@ -1074,7 +1053,7 @@ EOF
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+@@ -1089,7 +1068,7 @@ EOF
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+- # UnixWare 7.x, OpenUNIX and OpenServer 6.
++ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+@@ -1117,13 +1096,13 @@ EOF
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+- # uname -m prints for DJGPP always 'pc', but it prints nothing about
+- # the processor, so we play safe by assuming i586.
++ # uname -m prints for DJGPP always 'pc', but it prints nothing about
++ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+- exit ;;
++ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+@@ -1158,8 +1137,8 @@ EOF
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+- && { echo i486-ncr-sysv4; exit; } ;;
++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+@@ -1182,7 +1161,7 @@ EOF
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+@@ -1202,10 +1181,10 @@ EOF
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
+- echo i586-unisys-sysv4
+- exit ;;
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
++ echo i586-unisys-sysv4
++ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+@@ -1231,11 +1210,11 @@ EOF
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+- echo mips-nec-sysv${UNAME_RELEASE}
++ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+- echo mips-unknown-sysv${UNAME_RELEASE}
++ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+- exit ;;
++ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+@@ -1248,6 +1227,9 @@ EOF
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
++ x86_64:Haiku:*:*)
++ echo x86_64-unknown-haiku
++ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+@@ -1274,9 +1256,21 @@ EOF
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+- case $UNAME_PROCESSOR in
+- unknown) UNAME_PROCESSOR=powerpc ;;
+- esac
++ eval $set_cc_for_build
++ if test "$UNAME_PROCESSOR" = unknown ; then
++ UNAME_PROCESSOR=powerpc
++ fi
++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
++ grep IS_64BIT_ARCH >/dev/null
++ then
++ case $UNAME_PROCESSOR in
++ i386) UNAME_PROCESSOR=x86_64 ;;
++ powerpc) UNAME_PROCESSOR=powerpc64 ;;
++ esac
++ fi
++ fi
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+@@ -1290,7 +1284,10 @@ EOF
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+- NSE-?:NONSTOP_KERNEL:*:*)
++ NEO-?:NONSTOP_KERNEL:*:*)
++ echo neo-tandem-nsk${UNAME_RELEASE}
++ exit ;;
++ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+@@ -1335,13 +1332,13 @@ EOF
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+- echo mips-sei-seiux${UNAME_RELEASE}
++ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+- UNAME_MACHINE=`(uname -p) 2>/dev/null`
++ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+@@ -1359,11 +1356,11 @@ EOF
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
++ x86_64:VMkernel:*:*)
++ echo ${UNAME_MACHINE}-unknown-esx
++ exit ;;
+ esac
+
+-#echo '(No uname command or uname output not recognized.)' 1>&2
+-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+-
+ eval $set_cc_for_build
+ cat >$dummy.c <<EOF
+ #ifdef _SEQUENT_
+@@ -1381,11 +1378,11 @@ main ()
+ #include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+ #ifdef NEWSOS4
+- "4"
++ "4"
+ #else
+- ""
++ ""
+ #endif
+- ); exit (0);
++ ); exit (0);
+ #endif
+ #endif
+
+diff --git a/config.sub b/config.sub
+index 45bad78..d2a9613 100755
+--- a/config.sub
++++ b/config.sub
+@@ -1,44 +1,40 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+-# Free Software Foundation, Inc.
++# Copyright 1992-2013 Free Software Foundation, Inc.
+
+-timestamp='2009-04-17'
++timestamp='2013-08-10'
+
+-# This file is (in principle) common to ALL GNU software.
+-# The presence of a machine in this file suggests that SOME GNU software
+-# can handle that machine. It does not imply ALL GNU software can.
+-#
+-# This file is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
++# This file is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
+ # (at your option) any later version.
+ #
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
++# the same distribution terms that you use for the rest of that
++# program. This Exception is an additional permission under section 7
++# of the GNU General Public License, version 3 ("GPLv3").
+
+
+-# Please send patches to <config-patches@gnu.org>. Submit a context
+-# diff and a properly formatted ChangeLog entry.
++# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+ #
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+ # If it is invalid, we print an error message on stderr and exit with code 1.
+ # Otherwise, we print the canonical config type on stdout and succeed.
+
++# You can get the latest version of this script from:
++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
++
+ # This file is supposed to be the same for all GNU packages
+ # and recognize all the CPU types, system types and aliases
+ # that are meaningful with *any* GNU software.
+@@ -72,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
+ version="\
+ GNU config.sub ($timestamp)
+
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++Copyright 1992-2013 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -120,13 +115,18 @@ esac
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
++ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
++ android-linux)
++ os=-linux-android
++ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
++ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+@@ -149,10 +149,13 @@ case $os in
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple | -axis | -knuth | -cray)
++ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
++ -bluegene*)
++ os=-cnk
++ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+@@ -167,10 +170,10 @@ case $os in
+ os=-chorusos
+ basic_machine=$1
+ ;;
+- -chorusrdb)
+- os=-chorusrdb
++ -chorusrdb)
++ os=-chorusrdb
+ basic_machine=$1
+- ;;
++ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+@@ -215,6 +218,12 @@ case $os in
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
++ -lynx*178)
++ os=-lynxos178
++ ;;
++ -lynx*5)
++ os=-lynxos5
++ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+@@ -239,20 +248,27 @@ case $basic_machine in
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
++ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
++ | arc | arceb \
++ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
++ | avr | avr32 \
++ | be32 | be64 \
+ | bfin \
+- | c4x | clipper \
++ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
++ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
++ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+- | maxq | mb | microblaze | mcore | mep | metag \
++ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+@@ -270,32 +286,45 @@ case $basic_machine in
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+- | nios | nios2 \
++ | nds32 | nds32le | nds32be \
++ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+- | or32 \
++ | open8 \
++ | or1k | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
++ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+- | spu | strongarm \
+- | tahoe | thumb | tic4x | tic80 | tron \
+- | v850 | v850e \
++ | spu \
++ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
++ | ubicom32 \
++ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
++ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+- m6811 | m68hc11 | m6812 | m68hc12)
+- # Motorola 68HC11/12.
++ c54x)
++ basic_machine=tic54x-unknown
++ ;;
++ c55x)
++ basic_machine=tic55x-unknown
++ ;;
++ c6x)
++ basic_machine=tic6x-unknown
++ ;;
++ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+@@ -305,6 +334,21 @@ case $basic_machine in
+ basic_machine=mt-unknown
+ ;;
+
++ strongarm | thumb | xscale)
++ basic_machine=arm-unknown
++ ;;
++ xgate)
++ basic_machine=$basic_machine-unknown
++ os=-none
++ ;;
++ xscaleeb)
++ basic_machine=armeb-unknown
++ ;;
++
++ xscaleel)
++ basic_machine=armel-unknown
++ ;;
++
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+@@ -319,25 +363,30 @@ case $basic_machine in
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
++ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
++ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+- | clipper-* | craynv-* | cydra-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* \
++ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
++ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
++ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+@@ -355,28 +404,34 @@ case $basic_machine in
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+- | nios-* | nios2-* \
++ | nds32-* | nds32le-* | nds32be-* \
++ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
++ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+- | romp-* | rs6000-* \
++ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+- | tahoe-* | thumb-* \
+- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
++ | tahoe-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tile*-* \
+ | tron-* \
+- | v850-* | v850e-* | vax-* \
++ | ubicom32-* \
++ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
++ | vax-* \
+ | we32k-* \
+- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
++ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+@@ -401,7 +456,7 @@ case $basic_machine in
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+- abacus)
++ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+@@ -467,11 +522,24 @@ case $basic_machine in
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
++ bluegene*)
++ basic_machine=powerpc-ibm
++ os=-cnk
++ ;;
++ c54x-*)
++ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ c55x-*)
++ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ c6x-*)
++ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+- cegcc)
++ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+@@ -503,7 +571,7 @@ case $basic_machine in
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+- cr16)
++ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+@@ -661,7 +729,6 @@ case $basic_machine in
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+@@ -719,8 +786,15 @@ case $basic_machine in
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
++ microblaze*)
++ basic_machine=microblaze-xilinx
++ ;;
++ mingw64)
++ basic_machine=x86_64-pc
++ os=-mingw64
++ ;;
+ mingw32)
+- basic_machine=i386-pc
++ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+@@ -755,10 +829,18 @@ case $basic_machine in
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
++ msys)
++ basic_machine=i686-pc
++ os=-msys
++ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
++ nacl)
++ basic_machine=le32-unknown
++ os=-nacl
++ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+@@ -823,6 +905,12 @@ case $basic_machine in
+ np1)
+ basic_machine=np1-gould
+ ;;
++ neo-tandem)
++ basic_machine=neo-tandem
++ ;;
++ nse-tandem)
++ basic_machine=nse-tandem
++ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+@@ -905,9 +993,10 @@ case $basic_machine in
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+- ppc) basic_machine=powerpc-unknown
++ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc-* | ppcbe-*)
++ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+@@ -917,7 +1006,7 @@ case $basic_machine in
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+@@ -932,7 +1021,11 @@ case $basic_machine in
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+- rdos)
++ rdos | rdos64)
++ basic_machine=x86_64-pc
++ os=-rdos
++ ;;
++ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+@@ -1001,6 +1094,9 @@ case $basic_machine in
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
++ strongarm-* | thumb-*)
++ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+@@ -1057,20 +1153,8 @@ case $basic_machine in
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+- tic54x | c54x*)
+- basic_machine=tic54x-unknown
+- os=-coff
+- ;;
+- tic55x | c55x*)
+- basic_machine=tic55x-unknown
+- os=-coff
+- ;;
+- tic6x | c6x*)
+- basic_machine=tic6x-unknown
+- os=-coff
+- ;;
+ tile*)
+- basic_machine=tile-unknown
++ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+@@ -1140,6 +1224,9 @@ case $basic_machine in
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
++ xscale-* | xscalee[bl]-*)
++ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
++ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+@@ -1237,9 +1324,12 @@ esac
+ if [ x"$os" != x"" ]
+ then
+ case $os in
+- # First match some system type aliases
+- # that might get confused with valid system types.
++ # First match some system type aliases
++ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
++ -auroraux)
++ os=-auroraux
++ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+@@ -1260,22 +1350,23 @@ case $os in
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+- | -kopensolaris* \
++ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
++ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
++ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+- | -openbsd* | -solidbsd* \
++ | -bitrig* | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
++ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+@@ -1283,7 +1374,7 @@ case $os in
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+@@ -1322,7 +1413,7 @@ case $os in
+ -opened*)
+ os=-openedition
+ ;;
+- -os400*)
++ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+@@ -1371,7 +1462,7 @@ case $os in
+ -sinix*)
+ os=-sysv4
+ ;;
+- -tpf*)
++ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+@@ -1407,15 +1498,14 @@ case $os in
+ -aros*)
+ os=-aros
+ ;;
+- -kaos*)
+- os=-kaos
+- ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
++ -nacl*)
++ ;;
+ -none)
+ ;;
+ *)
+@@ -1438,10 +1528,10 @@ else
+ # system, and we'll never get to this point.
+
+ case $basic_machine in
+- score-*)
++ score-*)
+ os=-elf
+ ;;
+- spu-*)
++ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+@@ -1453,8 +1543,23 @@ case $basic_machine in
+ arm*-semi)
+ os=-aout
+ ;;
+- c4x-* | tic4x-*)
+- os=-coff
++ c4x-* | tic4x-*)
++ os=-coff
++ ;;
++ c8051-*)
++ os=-elf
++ ;;
++ hexagon-*)
++ os=-elf
++ ;;
++ tic54x-*)
++ os=-coff
++ ;;
++ tic55x-*)
++ os=-coff
++ ;;
++ tic6x-*)
++ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+@@ -1474,14 +1579,11 @@ case $basic_machine in
+ ;;
+ m68000-sun)
+ os=-sunos3
+- # This also exists in the configure program, but was not the
+- # default.
+- # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+- mep-*)
++ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+@@ -1490,6 +1592,9 @@ case $basic_machine in
+ mips*-*)
+ os=-elf
+ ;;
++ or1k-*)
++ os=-elf
++ ;;
+ or32-*)
+ os=-coff
+ ;;
+@@ -1508,7 +1613,7 @@ case $basic_machine in
+ *-ibm)
+ os=-aix
+ ;;
+- *-knuth)
++ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+@@ -1613,7 +1718,7 @@ case $basic_machine in
+ -sunos*)
+ vendor=sun
+ ;;
+- -aix*)
++ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+--
+1.9.0
+
--- /dev/null
+--- build/xmlsec1-1.2.14/win32/Makefile.msvc.old 2010-10-20 00:49:04.671875000 +0200
++++ build/xmlsec1-1.2.14/win32/Makefile.msvc 2010-10-20 00:49:23.406250000 +0200
+@@ -351,7 +351,11 @@
+ !if "$(DEBUG)" == "1"
+ LDFLAGS = $(LDFLAGS) /DEBUG
+ !else
+-LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
++!if "$(_NMAKE_VER)" >= "10.00.30319.01"
++LDFLAGS = $(LDFLAGS)
++!else
++LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
++!endif
+ !endif
+
+ SOLIBS = $(LIBS) libxml2.lib
+--- build/xmlsec/win32/Makefile.msvc.old 2012-11-30 11:09:23.130479800 -0500
++++ build/xmlsec/win32/Makefile.msvc 2012-11-30 11:11:06.037550700 -0500
+@@ -301,6 +301,10 @@
+ CFLAGS = $(CFLAGS) /D "HAVE_STDIO_H" /D "HAVE_STDLIB_H"
+ CFLAGS = $(CFLAGS) /D "HAVE_STRING_H" /D "HAVE_CTYPE_H"
+ CFLAGS = $(CFLAGS) /D "HAVE_MALLOC_H" /D "HAVE_MEMORY_H"
++CFLAGS = $(CFLAGS) $(SOLARINC) -I$(WORKDIR)\UnpackedTarball\xml2\include -I$(WORKDIR)/UnpackedTarball/icu/source/i18n -I$(WORKDIR)/UnpackedTarball/icu/source/common
++!if "$(MSVC_USE_DEBUG_RUNTIME)" != ""
++CFLAGS = $(CFLAGS) /MDd
++!endif
+
+ # Optimisation and debug symbols.
+ !if "$(DEBUG)" == "1"
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,xslt,xslt))
+
+$(eval $(call gb_ExternalPackage_use_external_project,xslt,xslt))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.1.dylib,libxslt/.libs/libxslt.1.dylib))
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.0.dylib,libexslt/.libs/libexslt.0.dylib))
+else ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.dll,libxslt/.libs/libxslt.dll))
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.dll,libexslt/.libs/libexslt.dll))
+else # COM=MSC
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.dll,win32/bin.msvc/libxslt.dll))
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.dll,win32/bin.msvc/libexslt.dll))
+endif
+else # OS!=WNT
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.28))
+$(eval $(call gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.17))
+endif
+endif # DISABLE_DYNLOADING
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,xslt))
+
+$(eval $(call gb_ExternalProject_use_external,xslt,libxml2))
+
+$(eval $(call gb_ExternalProject_register_targets,xslt,\
+ build \
+))
+ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(call gb_ExternalProject_get_state_target,xslt,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --without-crypto --without-python --disable-static \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ $(if $(MINGW_SHARED_GXXLIB),LIBS="$(MINGW_SHARED_LIBSTDCPP)") \
+ LDFLAGS="-Wl$(COMMA)--no-undefined -Wl$(COMMA)--enable-runtime-pseudo-reloc-v2" \
+ OBJDUMP=objdump \
+ && chmod 777 xslt-config \
+ && $(MAKE) \
+ )
+else # COM=MSC
+$(call gb_ExternalProject_get_state_target,xslt,build):
+ $(call gb_ExternalProject_run,build,\
+ cscript configure.js \
+ $(if $(MSVC_USE_DEBUG_RUNTIME),cruntime=/MDd) \
+ vcmanifest=yes \
+ lib=$(call gb_UnpackedTarball_get_dir,xml2)/win32/bin.msvc \
+ && unset MAKEFLAGS \
+ && LIB="$(ILIB)" nmake \
+ ,win32)
+endif
+else # OS!=WNT
+$(call gb_ExternalProject_get_state_target,xslt,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --without-crypto --without-python \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ LDFLAGS="$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib" -Wl$(COMMA)-noinhibit-exec) \
+ $(if $(SYSBASE),$(if $(filter SOLARIS LINUX,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
+ $(if $(SYSBASE),CPPFLAGS="-I$(SYSBASE)/usr/include") \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)), \
+ $(if $(filter IOS,$(OS)),LIBS="-liconv") \
+ --disable-shared,--disable-static) \
+ $(if $(SYSTEM_LIBXML),,--with-libxml-src=$(call gb_UnpackedTarball_get_dir,xml2)) \
+ && chmod 777 xslt-config \
+ && $(MAKE) \
+ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libxslt))
+
+$(eval $(call gb_Module_add_targets,libxslt,\
+ ExternalPackage_xslt \
+ ExternalProject_xslt \
+ UnpackedTarball_xslt \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Gnome xslt library written in C, from [http://xmlsoft.org/xslt/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,xslt))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,xslt,$(LIBXSLT_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,xslt,\
+ external/libxslt/libxslt-config.patch.1 \
+ external/libxslt/libxslt-configure.patch.1 \
+ external/libxslt/libxslt-freebsd.patch.1 \
+ external/libxslt/libxslt-internal-symbols.patch \
+ external/libxslt/libxslt-vc10.patch \
+ external/libxslt/libxslt-1.1.26-memdump.patch \
+ $(if $(filter ANDROID,$(OS)),external/libxslt/libxslt-android.patch) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/libxslt-1.1.26/xsltproc/xsltproc.c 2009-08-23 14:53:33.000000000 +0200
++++ misc/build/libxslt-1.1.26/xsltproc/xsltproc.c 2013-01-18 14:16:12.202767222 +0100
+@@ -877,7 +877,6 @@
+ xsltFreeSecurityPrefs(sec);
+ xsltCleanupGlobals();
+ xmlCleanupParser();
+- xmlMemoryDump();
+ return(errorno);
+ }
+
--- /dev/null
+--- misc/libxslt-1.1.26/ltmain.sh
++++ misc/build/libxslt-1.1.26/ltmain.sh
+@@ -3228,6 +3228,12 @@
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
++ # Force no versioning suffix for Android thanks to silly
++ # apkbuilder which doesn't add extra native libs unless their
++ # name ends with .so
++
++ version_type=none
++
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
--- /dev/null
+Hack the xslt-config to return paths into WORKDIR.
+
+--- a/xslt-config.in Wed Jan 17 14:18:26 2007
++++ b/xslt-config.in Wed Jun 25 13:06:05 2008
+@@ -1,10 +1,16 @@
+ #! /bin/sh
+
+-prefix=@prefix@
+-exec_prefix=@exec_prefix@
++#prefix=@prefix@
++#exec_prefix=@exec_prefix@
++#exec_prefix_set=no
++#includedir=@includedir@
++#libdir=@libdir@
++
++prefix=${WORKDIR}/UnpackedTarball/xslt
++exec_prefix=${WORKDIR}/UnpackedTarball/xsltproc
+ exec_prefix_set=no
+-includedir=@includedir@
+-libdir=@libdir@
++includedir=${WORKDIR}/UnpackedTarball/xslt/libxslt
++libdir=${WORKDIR}/UnpackedTarball/xslt/libxslt/.libs
+
+ usage()
+ {
+@@ -89,7 +95,8 @@
+ shift
+ done
+
+-the_libs="@XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@"
++#the_libs="@XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@"
++the_libs="-L${libdir} -lxslt -lm"
+ if test "$includedir" != "/usr/include"; then
+ the_flags="$the_flags -I$includedir `@XML_CONFIG@ --cflags`"
+ else
--- /dev/null
+-*- Mode: Diff -*-
+We need to recognize arm-unknown-linux-androideabi
+
+--- a/config.sub
++++ b/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-androideabi* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1218,7 +1218,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-androideabi | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+Usual patch to produce Linux-like .so files on FreeBSD
+
+--- a/ltmain.sh Wed Aug 29 14:28:46 2007
++++ b/ltmain.sh Wed Jun 25 13:06:05 2008
+@@ -6195,9 +6195,9 @@
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+- current="$number_major"
+- revision="$number_minor"
+- age="0"
++ current=`expr $number_major + $number_minor`
++ age="$number_minor"
++ revision="$number_revision"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+@@ -6271,8 +6271,8 @@
+ ;;
+
+ freebsd-elf)
+- major=".$current"
+- versuffix=".$current"
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
+ ;;
+
+ irix | nonstopux)
--- /dev/null
+--- misc/libxslt-1.1.26/libxslt/libxslt.syms Thu Sep 24 16:28:46 2009
++++ misc/build/libxslt-1.1.26/libxslt/libxslt.syms Thu Jul 8 12:22:14 2010
+@@ -107,7 +107,7 @@
+ xsltFreeCompMatchList;
+ xsltFreeTemplateHashes;
+ xsltGetTemplate;
+- xsltMatchPattern;
++#NOT_IMPLEMENTED xsltMatchPattern;
+ xsltTestCompMatchList;
+
+ # preproc
+@@ -406,7 +406,7 @@
+ global:
+
+ # xsltInternals
+- xsltConstNamespaceNameXSLT; # variable
++#XSLT_REFACTORED_XSLT_NSCOMP xsltConstNamespaceNameXSLT; # variable
+ xsltExtensionInstructionResultFinalize;
+ xsltExtensionInstructionResultRegister;
+ xsltInitCtxtKey;
+@@ -415,24 +415,24 @@
+ xsltInit;
+
+ # xsltInternals
+- xsltParseAnyXSLTElem;
+- xsltParseSequenceConstructor;
+- xsltPointerListAddSize;
+- xsltPointerListClear;
+- xsltPointerListCreate;
+- xsltPointerListFree;
++#XSLT_REFACTORED xsltParseAnyXSLTElem;
++#XSLT_REFACTORED xsltParseSequenceConstructor;
++#XSLT_REFACTORED xsltPointerListAddSize;
++#XSLT_REFACTORED xsltPointerListClear;
++#XSLT_REFACTORED xsltPointerListCreate;
++#XSLT_REFACTORED xsltPointerListFree;
+ xsltRegisterLocalRVT;
+ xsltReleaseRVT;
+- xsltRestoreDocumentNamespaces;
++#XSLT_REFACTORED_XSLT_NSCOMP xsltRestoreDocumentNamespaces;
+
+ # extensions
+- xsltStyleStylesheetLevelGetExtData;
++#XSLT_REFACTORED xsltStyleStylesheetLevelGetExtData;
+
+ # xsltInternals
+ # xsltTransStorageAdd; removed in 1.1.28
+ # xsltTransStorageRemove; removed in 1.1.28
+ xsltUninit;
+- xsltXSLTAttrMarker; # variable
++#XSLT_REFACTORED xsltXSLTAttrMarker; # variable
+ } LIBXML2_1.1.9;
+
+ LIBXML2_1.1.20 {
+@@ -475,5 +475,9 @@
+
+ # xsltutils
+ xsltXPathCompileFlags;
++
++# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local")
++ local:
++ *;
+ } LIBXML2_1.1.26;
+
--- /dev/null
+--- build/libxslt-1.1.26/win32/Makefile.msvc.old 2010-10-20 01:02:55.359375000 +0200
++++ build/libxslt-1.1.26/win32/Makefile.msvc 2010-10-20 01:03:05.187500000 +0200
+@@ -54,6 +54,7 @@
+ CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W3 $(CRUNTIME) /D "_REENTRANT"
+ CFLAGS = $(CFLAGS) /I$(BASEDIR) /I$(XSLT_SRCDIR) /I$(INCPREFIX)
+ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
++CFLAGS = $(CFLAGS) $(SOLARINC) -I$(WORKDIR)\UnpackedTarball\xml2\include -I$(WORKDIR)/UnpackedTarball/icu/source/i18n -I$(WORKDIR)/UnpackedTarball/icu/source/common
+
+ # The linker and its options.
+ LD = link.exe
+@@ -71,8 +71,12 @@
+ LDFLAGS = $(LDFLAGS) /DEBUG
+ !else
+ CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
++!if "$(_NMAKE_VER)" >= "10.00.30319.01"
++LDFLAGS = $(LDFLAGS)
++!else
+ LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
+ !endif
++!endif
+
+ # Libxslt object files.
+ XSLT_OBJS = $(XSLT_INTDIR)\attributes.obj\
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,lpsolve,lpsolve))
+
+$(eval $(call gb_ExternalPackage_use_external_project,lpsolve,lpsolve))
+
+ifneq ($(DISABLE_DYNLOADING),TRUE)
+ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_file,lpsolve,$(LIBO_LIB_FOLDER)/lpsolve55.dll,lpsolve55/lpsolve55.dll))
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,lpsolve,$(LIBO_LIB_FOLDER)/liblpsolve55.dylib,lpsolve55/liblpsolve55.dylib))
+else # $(OS) != WNT/MACOSX
+$(eval $(call gb_ExternalPackage_add_file,lpsolve,$(LIBO_LIB_FOLDER)/liblpsolve55.so,lpsolve55/liblpsolve55.so))
+endif # $(OS)
+endif # $(DISABLE_DYNLOADING)
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,lpsolve))
+
+$(eval $(call gb_ExternalProject_register_targets,lpsolve,\
+ build \
+))
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),GCC)
+$(call gb_ExternalProject_get_state_target,lpsolve,build):
+ $(call gb_ExternalProject_run,build,\
+ $(if $(filter WNT,$(OS_FOR_BUILD)), \
+ $(if $(MINGW_SHARED_GCCLIB) lpsolve_LDFLAGS="-shared-libgcc") \
+ $(if $(MINGW_SHARED_GXXLIB) lpsolve_LIBS="$(MINGW_SHARED_LIBSTDCPP)") \
+ cmd /c cgcc.bat, sh ccc) \
+ ,lpsolve55)
+else # $(COM)!=GCC
+$(call gb_ExternalProject_get_state_target,lpsolve,build):
+ $(call gb_ExternalProject_run,build,\
+ LIB="$(ILIB)" RUNTIME_FLAG="$(if $(MSVC_USE_DEBUG_RUNTIME),/MDd,/MD)" \
+ cmd /c cvc6.bat \
+ ,lpsolve55)
+endif # $(COM)
+else # $(OS)!=WNT
+$(call gb_ExternalProject_get_state_target,lpsolve,build):
+ $(call gb_ExternalProject_run,build,\
+ sh $(if $(filter MACOSX,$(OS)),ccc.osx, \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),ccc.static, \
+ $(if $(filter AIXGCC,$(OS)$(COM)),ccc.aix.gcc, \
+ ccc))) \
+ ,lpsolve55)
+endif # $(OS)
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,lpsolve))
+
+$(eval $(call gb_Module_add_targets,lpsolve,\
+ UnpackedTarball_lpsolve \
+ ExternalPackage_lpsolve \
+ ExternalProject_lpsolve \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+A mixed Integer Linear Programming (MILP) solver from [http://lpsolve.sourceforge.net/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,lpsolve))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,lpsolve,$(LPSOLVE_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,lpsolve,3))
+
+ifeq ($(OS_FOR_BUILD),WNT)
+
+$(eval $(call gb_UnpackedTarball_set_patchflags,lpsolve,--binary))
+$(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\
+ external/lpsolve/lp_solve_5.5-windows.patch \
+))
+
+else
+
+$(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\
+ external/lpsolve/lp_solve-aix.patch \
+ external/lpsolve/lp_solve-fixed-warn.patch \
+ external/lpsolve/lp_solve_5.5.patch \
+))
+
+$(eval $(call gb_UnpackedTarball_add_file,lpsolve,lpsolve55/ccc.static,external/lpsolve/ccc.static))
+
+endif
+# vim: set noet sw=4 ts=4:
+
+
--- /dev/null
+src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
+obj=`echo $src|sed -e 's/\.c/.o/g' -e 's!\([^ ]*/\)*!!g'`
+
+opts='-O3'
+
+def=
+
+$CC -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -c $src
+
+$AR -r liblpsolve55.a $obj
+rm $obj
--- /dev/null
+--- /dev/null 2010-07-28 04:47:47.000000000 -0500
++++ misc/build/lp_solve_5.5/lpsolve55/ccc.aix.gcc 2010-06-29 17:44:53.000000000 -0500
+@@ -0,0 +1,25 @@
++src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
++c=$CC
++
++def=
++so=
++if [ "$PLATFORM" = "SCO_UNIX" ]
++then def='-dy -K PIC -DNOLONGLONG'
++ dl=-lc
++else dl=-ldl
++ so=y
++fi
++
++opts='-O3'
++
++$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++ar rv liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
++ranlib liblpsolve55.a
++
++if [ "$so" != "" ]
++then
++ $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++ $c -shared $lpsolve_LDFLAGS -o liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
++fi
++
++rm *.o 2>/dev/null
+--- misc/lp_solve_5.5/lp_lib.h 2010-07-28 05:15:10.000000000 -0500
++++ misc/build/lp_solve_5.5/lp_lib.h 2010-07-28 05:15:55.000000000 -0500
+@@ -56,7 +56,7 @@
+ /* Define user program feature option switches */
+ /* ------------------------------------------------------------------------- */
+
+-#if !defined _WINDOWS && !defined _WIN32 && !defined WIN32
++#if !defined _WINDOWS && !defined _WIN32 && !defined WIN32 && !defined(_AIX)
+ # define _isnan(x) FALSE
+ #endif
+
--- /dev/null
+--- misc/build/lp_solve_5.5/lp_report.c 2007-01-14 10:31:34.000000000 -0800
++++ misc/build/lp_solve_5.5/lp_report.c 2007-01-14 10:31:34.000000000 -0800
+@@ -160,7 +160,7 @@
+ {
+ int i, k = 0;
+
+- fprintf(output, label);
++ fputs(label, output);
+ fprintf(output, "\n");
+ for(i = first; i <= last; i++) {
+ fprintf(output, " %18g", vector[i]);
+@@ -189,7 +189,7 @@
+ if(last < 0)
+ last = lp->rows;
+
+- fprintf(output, label);
++ fputs(label, output);
+ fprintf(output, "\n");
+
+ if(first == 0) {
+@@ -254,7 +254,7 @@
+ if(last < 0)
+ last = lp->rows;
+
+- fprintf(output, label);
++ fputs(label, output);
+ fprintf(output, "\n");
+
+ for(i = first; i <= last; i++) {
+--- misc/build/lp_solve_5.5/lp_rlp.h 2007-01-14 10:31:52.000000000 -0800
++++ misc/build/lp_solve_5.5/lp_rlp.h 2007-01-14 10:31:52.000000000 -0800
+@@ -615,7 +615,7 @@
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+-#define ECHO (void) fwrite( lp_yytext, lp_yyleng, 1, lp_yyout )
++#define ECHO if(fwrite( lp_yytext, lp_yyleng, 1, lp_yyout ) != 1) YY_FATAL_ERROR( "can't write into lp_yytext" )
+ #endif
+
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+--- misc/build/lp_solve_5.5/shared/commonlib.c 2007-01-14 10:33:14.000000000 -0800
++++ misc/build/lp_solve_5.5/shared/commonlib.c 2007-01-14 10:33:14.000000000 -0800
+@@ -715,7 +715,7 @@
+ {
+ int i, k = 0;
+
+- fprintf(output, label);
++ fputs(label, output);
+ fprintf(output, "\n");
+ for(i = first; i <= last; i++) {
+ fprintf(output, " %5d", myvector[i]);
+@@ -734,7 +734,7 @@
+ {
+ int i, k = 0;
+
+- fprintf(output, label);
++ fputs(label, output);
+ fprintf(output, "\n");
+ for(i = first; i <= last; i++) {
+ if(asRaw)
+@@ -756,7 +756,7 @@
+ {
+ int i, k = 0;
+
+- fprintf(output, label);
++ fputs(label, output);
+ fprintf(output, "\n");
+ for(i = first; i <= last; i++) {
+ fprintf(output, " %18g", myvector[i]);
+--- misc/build/lp_solve_5.5/shared/mmio.c 2007-01-14 10:33:14.000000000 -0800
++++ misc/build/lp_solve_5.5/shared/mmio.c 2007-01-14 10:33:14.000000000 -0800
+@@ -74,7 +74,11 @@
+
+ for (i=0; i<nz; i++)
+ {
+- fscanf(f, "%d %d %lg\n", &I[i], &J[i], &val[i]);
++ if(fscanf(f, "%d %d %lg\n", &I[i], &J[i], &val[i]) != 3)
++ {
++ fprintf(stderr, "read_unsymmetric_sparse(): could not parse values.\n");
++ return -1;
++ }
+ I[i]--; /* adjust from 1-based to 0-based */
+ J[i]--;
+ }
--- /dev/null
+*** misc/lp_solve_5.5/lpsolve55/cgcc.bat Sun Jun 12 04:27:28 2005
+--- misc/build/lp_solve_5.5/lpsolve55/cgcc.bat Sun Dec 14 07:55:19 2008
+***************
+*** 7,14 ****
+ \r
+ set c=gcc\r
+ \r
+! rem rc lpsolve.rc\r
+! %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -mno-cygwin -enable-stdcall-fixup -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% ..\lp_solve.def -o lpsolve55.dll\r
+ \r
+ %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o liblpsolve55.so\r
+ \r
+--- 7,14 ----
+ \r
+ set c=gcc\r
+ \r
+! windres lpsolve.rc lpsolve_res.obj\r
+! %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -mno-cygwin -enable-stdcall-fixup -mthreads %lpsolve_LDFLAGS% -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve_res.obj ..\lp_solve.def %lpsolve_LIBS% -o lpsolve55.dll\r
+ \r
+ %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o liblpsolve55.so\r
+ \r
+*** misc/lp_solve_5.5/lpsolve55/lpsolve.rc Sun Jun 4 00:15:24 2006
+--- misc/build/lp_solve_5.5/lpsolve55/lpsolve.rc Fri Nov 23 16:34:22 2007
+***************
+*** 7,13 ****
+ //\r
+ // Generated from the TEXTINCLUDE 2 resource.\r
+ //\r
+! #include "afxres.h"\r
+ \r
+ /////////////////////////////////////////////////////////////////////////////\r
+ #undef APSTUDIO_READONLY_SYMBOLS\r
+--- 7,13 ----
+ //\r
+ // Generated from the TEXTINCLUDE 2 resource.\r
+ //\r
+! #include "winresrc.h"\r
+ \r
+ /////////////////////////////////////////////////////////////////////////////\r
+ #undef APSTUDIO_READONLY_SYMBOLS\r
+--- misc/lp_solve_5.5/lpsolve55/cvc6.bat
++++ misc/build/lp_solve_5.5/lpsolve55/cvc6.bat
+@@ -14,15 +14,4 @@
+ set c=cl\r
+ \r
+-rc lpsolve.rc\r
++rc %SOLARINC% lpsolve.rc\r
+-%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /LD /MD /O1 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res ..\lp_solve.def -o lpsolve55.dll\r
++%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd %SOLARINC% /LD %RUNTIME_FLAG% /O1 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res ..\lp_solve.def -Felpsolve55.dll\r
+-rem /link /LINK50COMPAT\r
+-\r
+-if exist a.obj del a.obj\r
+-%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MT /O1 /Zp8 /Gd /c -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src%\r
+-lib *.obj /OUT:liblpsolve55.lib\r
+-\r
+-if exist a.obj del a.obj\r
+-%c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MTd /O1 /Zp8 /Gd /c -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src%\r
+-lib *.obj /OUT:liblpsolve55d.lib\r
+-\r
+-if exist *.obj del *.obj\r
--- /dev/null
+--- misc/build/lp_solve_5.5/lpsolve55/ccc.orig Sat Jun 11 21:27:18 2005
++++ misc/build/lp_solve_5.5/lpsolve55/ccc Sun May 22 11:20:19 2011
+@@ -1,25 +1,42 @@
+ src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
+-c=cc
++ar=$AR
++c=$CC
++ranlib=$RANLIB
+
+ def=
+ so=
+-if [ "$PLATFORM" = "SCO_UNIX" ]
+-then def='-dy -K PIC -DNOLONGLONG'
+- dl=-lc
+-else dl=-ldl
+- so=y
++soprefix=
++libs=
++pic=
++ldflags=
++inline=
++if [ "$OS" = "WNT" -a "$COM" = "GCC" ]; then
++ so=dll
++ a=dll.a
++ inline=-DINLINE=static
++else
++ so=so
++ a=a
++ soprefix=lib
++ libs="-lm"
++ pic=-fpic
++ ldflags="-Wl,-Bsymbolic -Wl,-soname,liblpsolve55.$so"
+ fi
+
++if [ "$OS" = "LINUX" ]; then
++ libs="$libs -ldl"
++fi
++
+ opts='-O3'
+
+-$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++$c -s $inline -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
+-ar rv liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
+-ranlib liblpsolve55.a
++$ar rv liblpsolve55.$a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
++$ranlib liblpsolve55.$a
+
+ if [ "$so" != "" ]
+ then
+- $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
+- $c -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
++ $c $pic -s $inline -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++ $c -shared $ldflags -o ${soprefix}lpsolve55.$so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` $libs
+ fi
+
+ rm *.o 2>/dev/null
+--- misc/build/lp_solve_5.5/lpsolve55/ccc.osx.orig Thu Jun 23 22:53:08 2005
++++ misc/build/lp_solve_5.5/lpsolve55/ccc.osx Sun May 22 11:19:48 2011
+@@ -1,23 +1,36 @@
+ src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
+-c=cc
++c=$CC
+
++if test -n "$verbose"; then
++ set -x
++fi
++
+ def=
+ so=
++extra_cflags=$EXTRA_CFLAGS
++extra_cdefs=$EXTRA_CDEFS
++extra_linkflags=$EXTRA_LINKFLAGS
++
+ if [ "$PLATFORM" = "SCO_UNIX" ]
+ then def='-DLoadInverseLib=0 -DLoadLanguageLib=0 -D__HYPER=long'
+ else dl=-ldl
+ so=y
+ fi
+
+-opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double'
++if [ "$HAVE_GCC_NO_LONG_DOUBLE" = "YES" ] ; then
++ opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double'
++else
++ opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME'
++fi
++
+
+-$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++$c $extra_cflags -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $extra_cdefs $src
+-libtool -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
++$LIBTOOL -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
+
+ if [ "$so" != "" ]
+ then
+- $c -fPIC -fno-common -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
+- $c -dynamiclib liblpsolve55.a -compatibility_version 5.5.0 -current_version 5.5.0 -o liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc
++ $c $extra_cflags -fPIC -fno-common -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $extra_cdefs $src
++ $c $extra_linkflags -dynamiclib liblpsolve55.a -compatibility_version 5.5.0 -current_version 5.5.0 -o liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc
+ fi
+
+ rm *.o 2>/dev/null
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,mdds))
+
+$(eval $(call gb_Module_add_targets,mdds,\
+ UnpackedTarball_mdds \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Multi-dimensional data structure (mdds) library, available from [http://code.google.com/p/multidimalgorithm/].
+
+mdds primarily provides data structures that are used by the calc
+core.
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,mdds))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+ external/mdds/mdds_0.6.0.patch \
+ external/mdds/mdds-c++98.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- include/mdds/multi_type_vector_itr.hpp
++++ include/mdds/multi_type_vector_itr.hpp
+@@ -139,14 +139,15 @@
+ typedef typename parent_type::size_type size_type;
+ typedef iterator_value_node<size_type, typename parent_type::element_block_type> node;
+
+- iterator_common_base() : m_cur_node(0, 0) {}
++ iterator_common_base() : m_cur_node(0, 0), m_singular(true) {}
+
+ iterator_common_base(
+ const base_iterator_type& pos, const base_iterator_type& end,
+ size_type start_pos, size_type block_index) :
+ m_cur_node(start_pos, block_index),
+ m_pos(pos),
+- m_end(end)
++ m_end(end),
++ m_singular(false)
+ {
+ if (m_pos != m_end)
+ update_node();
+@@ -154,9 +155,13 @@
+
+ iterator_common_base(const iterator_common_base& other) :
+ m_cur_node(other.m_cur_node),
+- m_pos(other.m_pos),
+- m_end(other.m_end)
++ m_singular(other.m_singular)
+ {
++ if (!m_singular)
++ {
++ m_pos = other.m_pos;
++ m_end = other.m_end;
++ }
+ }
+
+ void update_node()
+@@ -196,6 +201,7 @@
+ node m_cur_node;
+ base_iterator_type m_pos;
+ base_iterator_type m_end;
++ bool m_singular;
+
+ public:
+ bool operator== (const iterator_common_base& other) const
+@@ -218,8 +224,12 @@
+ iterator_common_base& operator= (const iterator_common_base& other)
+ {
+ m_cur_node = other.m_cur_node;
+- m_pos = other.m_pos;
+- m_end = other.m_end;
++ m_singular = other.m_singular;
++ if (!m_singular)
++ {
++ m_pos = other.m_pos;
++ m_end = other.m_end;
++ }
+ return *this;
+ }
+
+@@ -226,8 +236,22 @@
+ void swap(iterator_common_base& other)
+ {
+ m_cur_node.swap(other.m_cur_node);
+- std::swap(m_pos, other.m_pos);
+- std::swap(m_end, other.m_end);
++ std::swap(m_singular, other.m_singular);
++ if (!(m_singular || other.m_singular))
++ {
++ std::swap(m_pos, other.m_pos);
++ std::swap(m_end, other.m_end);
++ }
++ else if (!m_singular)
++ {
++ m_pos = other.m_pos;
++ m_end = other.m_end;
++ }
++ else if (!other.m_singular)
++ {
++ other.m_pos = m_pos;
++ other.m_end = m_end;
++ }
+ }
+
+ const node& get_node() const { return m_cur_node; }
--- /dev/null
+--- misc/mdds_0.6.0/include/mdds/mixed_type_matrix_def.inl 2011-07-13 13:26:27.000000000 -0600
++++ misc/build/mdds_0.6.0/include/mdds/mixed_type_matrix_def.inl 2011-07-20 02:02:21.164198900 -0600
+@@ -216,8 +216,8 @@
+ // assignment to self.
+ return;
+
+- size_t row_count = ::std::min(mp_storage->rows(), r.mp_storage->rows());
+- size_t col_count = ::std::min(mp_storage->cols(), r.mp_storage->cols());
++ size_t row_count = (::std::min)(mp_storage->rows(), r.mp_storage->rows());
++ size_t col_count = (::std::min)(mp_storage->cols(), r.mp_storage->cols());
+ for (size_t i = 0; i < row_count; ++i)
+ for (size_t j = 0; j < col_count; ++j)
+ mp_storage->get_element(i, j) = r.mp_storage->get_element(i, j);
+--- misc/mdds_0.6.0/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-13 13:26:27.000000000 -0600
++++ misc/build/mdds_0.6.0/include/mdds/mixed_type_matrix_storage_filled_linear.inl 2011-07-20 02:02:21.179798900 -0600
+@@ -354,8 +354,8 @@
+ }
+
+ array_type new_array(new_size, &m_init_elem);
+- size_t min_rows = ::std::min(row, m_rows);
+- size_t min_cols = ::std::min(col, m_cols);
++ size_t min_rows = (::std::min)(row, m_rows);
++ size_t min_cols = (::std::min)(col, m_cols);
+ for (size_t i = 0; i < min_rows; ++i)
+ {
+ for (size_t j = 0; j < min_cols; ++j)
+@@ -612,8 +612,8 @@
+ }
+
+ array_type new_array(new_size, element(0.0));
+- size_t min_rows = ::std::min(row, m_rows);
+- size_t min_cols = ::std::min(col, m_cols);
++ size_t min_rows = (::std::min)(row, m_rows);
++ size_t min_cols = (::std::min)(col, m_cols);
+ for (size_t i = 0; i < min_rows; ++i)
+ {
+ for (size_t j = 0; j < min_cols; ++j)
+--- misc/mdds_0.6.0/include/mdds/point_quad_tree.hpp 2011-07-13 13:26:27.000000000 -0600
++++ misc/build/mdds_0.6.0/include/mdds/point_quad_tree.hpp 2011-07-20 02:04:36.088835900 -0600
+@@ -623,10 +623,10 @@
+ template<typename _Key, typename _Data>
+ void point_quad_tree<_Key,_Data>::insert(key_type x, key_type y, data_type data)
+ {
+- m_xrange.first = ::std::min(m_xrange.first, x);
+- m_xrange.second = ::std::max(m_xrange.second, x);
+- m_yrange.first = ::std::min(m_yrange.first, y);
+- m_yrange.second = ::std::max(m_yrange.second, y);
++ m_xrange.first = (::std::min)(m_xrange.first, x);
++ m_xrange.second = (::std::max)(m_xrange.second, x);
++ m_yrange.first = (::std::min)(m_yrange.first, y);
++ m_yrange.second = (::std::max)(m_yrange.second, y);
+
+ if (!m_root)
+ {
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,external/jawt))
+
+$(eval $(call gb_CustomTarget_register_targets,external/jawt,\
+ jawt.def \
+ libjawt.dll.a \
+))
+
+ifeq ($(OS)-$(CPUNAME),WNT-X86_64)
+$(call gb_CustomTarget_get_workdir,external/jawt)/jawt.def:
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
+ echo EXPORTS > $@
+ echo "JAWT_GetAWT" >> $@
+else
+$(call gb_CustomTarget_get_workdir,external/jawt)/jawt.def:
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
+ echo EXPORTS > $@
+ echo "JAWT_GetAWT@8" >> $@
+endif
+
+$(call gb_CustomTarget_get_workdir,external/jawt)/libjawt.dll.a: $(call gb_CustomTarget_get_workdir,external/jawt)/jawt.def
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),DLT,1)
+ $(DLLTOOL) --input-def=$< --output-lib=$@ --dllname=jawt.dll
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,mingw-externals))
+
+ifeq ($(OS)$(COM),WNTGCC)
+$(eval $(call gb_Module_add_targets,mingw-externals,\
+ CustomTarget_jawt \
+ Package_mingw_dlls \
+ Package_mingw_gccdlls \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,mingw_dlls,$(MINGW_SYSROOT)/bin))
+
+$(eval $(call gb_Package_add_files,mingw_dlls,bin,\
+ $(sort $(MINGW_DLLS)) \
+))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,mingw_gccdlls,$(MINGW_SYSROOT)/bin))
+
+$(eval $(call gb_Package_set_outdir,mingw_gccdlls,$(INSTDIR)))
+
+$(eval $(call gb_Package_add_files,mingw_gccdlls,program,\
+ $(if $(MINGW_SHARED_GCCLIB),$(MINGW_GCCDLL)) \
+ $(if $(MINGW_SHARED_GXXLIB),$(MINGW_GXXDLL)) \
+))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExtensionPackageSet_ExtensionPackageSet,misc_extensions))
+
+ifneq ($(BARCODE_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Barcode,$(BARCODE_EXTENSION_PACK)))
+endif
+
+ifneq ($(DIAGRAM_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,SmART,$(DIAGRAM_EXTENSION_PACK)))
+endif
+
+ifneq ($(GOOGLE_DOCS_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,gdocs,$(GOOGLE_DOCS_EXTENSION_PACK)))
+endif
+
+ifneq ($(HUNART_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,hunart,$(HUNART_EXTENSION_PACK)))
+endif
+
+ifneq ($(NUMBERTEXT_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,numbertext,$(NUMBERTEXT_EXTENSION_PACK)))
+endif
+
+ifneq ($(SUNTEMPLATES_DE_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Sun_ODF_Template_Pack_de,$(SUNTEMPLATES_DE_PACK)))
+endif
+
+ifneq ($(SUNTEMPLATES_EN_US_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Sun_ODF_Template_Pack_en-US,$(SUNTEMPLATES_EN_US_PACK)))
+endif
+
+ifneq ($(SUNTEMPLATES_ES_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Sun_ODF_Template_Pack_es,$(SUNTEMPLATES_ES_PACK)))
+endif
+
+ifneq ($(SUNTEMPLATES_FR_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Sun_ODF_Template_Pack_fr,$(SUNTEMPLATES_FR_PACK)))
+endif
+
+ifneq ($(SUNTEMPLATES_HU_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Sun_ODF_Template_Pack_hu,$(SUNTEMPLATES_HU_PACK)))
+endif
+
+ifneq ($(SUNTEMPLATES_IT_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Sun_ODF_Template_Pack_it,$(SUNTEMPLATES_IT_PACK)))
+endif
+
+ifneq ($(TYPO_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,typo,$(TYPO_EXTENSION_PACK)))
+endif
+
+ifneq ($(VALIDATOR_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,Validator,$(VALIDATOR_EXTENSION_PACK)))
+endif
+
+ifneq ($(WATCH_WINDOW_EXTENSION_PACK),)
+$(eval $(call gb_ExtensionPackageSet_add_extension,misc_extensions,WatchWindow,$(WATCH_WINDOW_EXTENSION_PACK)))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,misc_extensions))
+
+$(eval $(call gb_Module_add_targets,misc_extensions,\
+ ExtensionPackageSet_misc_extensions \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+misc_extensions contains some extensions may be downloaded and bundled as-is
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_caladea,font_caladea))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_caladea,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ Caladea-Italic.ttf \
+ Caladea-Regular.ttf \
+ Caladea-BoldItalic.ttf \
+ Caladea-Bold.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_carlito,font_carlito))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_carlito,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ Carlito-BoldItalic.ttf \
+ Carlito-Regular.ttf \
+ Carlito-Italic.ttf \
+ Carlito-Bold.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_dejavu,font_dejavu))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_dejavu,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ ttf/DejaVuSans-Bold.ttf \
+ ttf/DejaVuSans-BoldOblique.ttf \
+ ttf/DejaVuSans-ExtraLight.ttf \
+ ttf/DejaVuSans-Oblique.ttf \
+ ttf/DejaVuSans.ttf \
+ ttf/DejaVuSansCondensed-Bold.ttf \
+ ttf/DejaVuSansCondensed-BoldOblique.ttf \
+ ttf/DejaVuSansCondensed-Oblique.ttf \
+ ttf/DejaVuSansCondensed.ttf \
+ ttf/DejaVuSansMono-Bold.ttf \
+ ttf/DejaVuSansMono-BoldOblique.ttf \
+ ttf/DejaVuSansMono-Oblique.ttf \
+ ttf/DejaVuSansMono.ttf \
+ ttf/DejaVuSerif-Bold.ttf \
+ ttf/DejaVuSerif-BoldItalic.ttf \
+ ttf/DejaVuSerif-Italic.ttf \
+ ttf/DejaVuSerif.ttf \
+ ttf/DejaVuSerifCondensed-Bold.ttf \
+ ttf/DejaVuSerifCondensed-BoldItalic.ttf \
+ ttf/DejaVuSerifCondensed-Italic.ttf \
+ ttf/DejaVuSerifCondensed.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_gentium,font_gentium))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_gentium,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ GenBasB.ttf \
+ GenBasBI.ttf \
+ GenBasI.ttf \
+ GenBasR.ttf \
+ GenBkBasB.ttf \
+ GenBkBasBI.ttf \
+ GenBkBasI.ttf \
+ GenBkBasR.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_liberation,font_liberation))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_liberation,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ LiberationMono-Bold.ttf \
+ LiberationMono-BoldItalic.ttf \
+ LiberationMono-Italic.ttf \
+ LiberationMono-Regular.ttf \
+ LiberationSans-Bold.ttf \
+ LiberationSans-BoldItalic.ttf \
+ LiberationSans-Italic.ttf \
+ LiberationSans-Regular.ttf \
+ LiberationSerif-Bold.ttf \
+ LiberationSerif-BoldItalic.ttf \
+ LiberationSerif-Italic.ttf \
+ LiberationSerif-Regular.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_liberation_narrow,font_liberation_narrow))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_liberation_narrow,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ LiberationSansNarrow-Bold.ttf \
+ LiberationSansNarrow-BoldItalic.ttf \
+ LiberationSansNarrow-Italic.ttf \
+ LiberationSansNarrow-Regular.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_libertineg,font_libertineg))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_libertineg,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ LinBiolinum_RB_G.ttf \
+ LinBiolinum_RI_G.ttf \
+ LinBiolinum_R_G.ttf \
+ LinLibertine_DR_G.ttf \
+ LinLibertine_RBI_G.ttf \
+ LinLibertine_RB_G.ttf \
+ LinLibertine_RI_G.ttf \
+ LinLibertine_RZI_G.ttf \
+ LinLibertine_RZ_G.ttf \
+ LinLibertine_R_G.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_opensans,font_opensans))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_opensans,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ OpenSans-BoldItalic.ttf \
+ OpenSans-Bold.ttf \
+ OpenSans-Italic.ttf \
+ OpenSans-Regular.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_ptserif,font_ptserif))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_ptserif,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ PT_Serif-Web-BoldItalic.ttf \
+ PT_Serif-Web-Bold.ttf \
+ PT_Serif-Web-Italic.ttf \
+ PT_Serif-Web-Regular.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_sourcecode,font_sourcecode))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_sourcecode,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ SourceCodePro-Bold.ttf \
+ SourceCodePro-Regular.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_sourcesans,font_sourcesans))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_sourcesans,$(LIBO_SHARE_FOLDER)/fonts/truetype,\
+ SourceSansPro-BlackIt.ttf \
+ SourceSansPro-Black.ttf \
+ SourceSansPro-BoldIt.ttf \
+ SourceSansPro-Bold.ttf \
+ SourceSansPro-ExtraLightIt.ttf \
+ SourceSansPro-ExtraLight.ttf \
+ SourceSansPro-It.ttf \
+ SourceSansPro-LightIt.ttf \
+ SourceSansPro-Light.ttf \
+ SourceSansPro-Regular.ttf \
+ SourceSansPro-SemiboldIt.ttf \
+ SourceSansPro-Semibold.ttf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,more_fonts))
+
+$(eval $(call gb_Module_add_targets,more_fonts,\
+ Package_conf \
+ ExternalPackage_caladea \
+ ExternalPackage_carlito \
+ ExternalPackage_dejavu \
+ ExternalPackage_gentium \
+ ExternalPackage_liberation \
+ ExternalPackage_liberation_narrow \
+ ExternalPackage_libertineg \
+ ExternalPackage_opensans \
+ ExternalPackage_ptserif \
+ ExternalPackage_sourcecode \
+ ExternalPackage_sourcesans \
+ UnpackedTarball_caladea \
+ UnpackedTarball_carlito \
+ UnpackedTarball_dejavu \
+ UnpackedTarball_gentium \
+ UnpackedTarball_liberation \
+ UnpackedTarball_liberation_narrow \
+ UnpackedTarball_libertineg \
+ UnpackedTarball_opensans \
+ UnpackedTarball_ptserif \
+ UnpackedTarball_sourcecode \
+ UnpackedTarball_sourcesans \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,more_fonts_conf,$(SRCDIR)/external/more_fonts/fonts))
+
+$(eval $(call gb_Package_add_file,more_fonts_conf,$(LIBO_SHARE_FOLDER)/fonts/truetype/fc_local.conf,fc_local.conf))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+This module packages some external fonts.
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_caladea))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_caladea,$(FONT_CALADEA_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_carlito))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_carlito,$(FONT_CARLITO_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_dejavu))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_dejavu,$(FONT_DEJAVU_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_gentium))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_gentium,$(FONT_GENTIUM_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_liberation))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_liberation,$(FONT_LIBERATION_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_liberation_narrow))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_liberation_narrow,$(FONT_LIBERATION_NARROW_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_libertineg))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_libertineg,$(FONT_LINLIBERTINEG_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_opensans))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_opensans,$(FONT_OPENSANS_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_ptserif))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_ptserif,$(FONT_PTSERIF_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_sourcecode))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_sourcecode,$(FONT_SOURCECODE_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_sourcesans))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,font_sourcesans,$(FONT_SOURCESANS_TARBALL)))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "/etc/fonts/conf.d/fonts.dtd">
+<fontconfig>
+
+ <!-- Alias similar/metric-compatible families from various sources: -->
+
+ <alias binding="same">
+ <family>Liberation Sans Narrow</family>
+ <default>
+ <family>Arial Narrow</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>Arial Narrow</family>
+ <accept>
+ <family>Liberation Sans Narrow</family>
+ </accept>
+ </alias>
+
+ <alias binding="same">
+ <family>Calibri</family>
+ <accept>
+ <family>Carlito</family>
+ </accept>
+ </alias>
+
+ <alias binding="same">
+ <family>Cambria</family>
+ <accept>
+ <family>Caladea</family>
+ </accept>
+ </alias>
+
+</fontconfig>
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,moz_runtime,mozruntime))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files_with_dir,moz_runtime,$(LIBO_BIN_FOLDER),\
+ components/addrbook.dll \
+ components/addrbook.xpt \
+ components/i18n.dll \
+ components/mork.dll \
+ components/mozldap.dll \
+ components/mozldap.xpt \
+ components/necko.dll \
+ components/necko_dns.xpt \
+ components/pipnss.dll \
+ components/pref.xpt \
+ components/profile.dll \
+ components/rdf.dll \
+ components/uconv.dll \
+ components/vcard.dll \
+ components/xpc3250.dll \
+ components/xpcom_base.xpt \
+ components/xpcom_compat_c.dll \
+ components/xpcom_components.xpt \
+ components/xpcom_ds.xpt \
+ components/xpcom_io.xpt \
+ components/xpcom_obsolete.xpt \
+ components/xpcom_thread.xpt \
+ components/xpcom_xpti.xpt \
+ components/xppref32.dll \
+ defaults/autoconfig/platform.js \
+ defaults/autoconfig/prefcalls.js \
+ defaults/pref/browser-prefs.js \
+ defaults/pref/mailnews.js \
+ defaults/pref/mdn.js \
+ defaults/pref/smime.js \
+ greprefs/all.js \
+ greprefs/security-prefs.js \
+ js3250.dll \
+ mozz.dll \
+ msgbsutl.dll \
+ nsldap32v50.dll \
+ nsldappr32v50.dll \
+ xpcom.dll \
+ xpcom_compat.dll \
+ xpcom_core.dll \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,moz))
+
+ifneq ($(WITH_MOZAB4WIN),)
+
+$(eval $(call gb_Module_add_targets,moz,\
+ ExternalPackage_runtime \
+ UnpackedTarball_moz_inc \
+ UnpackedTarball_moz_lib \
+ UnpackedTarball_mozruntime \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Used only for building Windows Address book connectivity.
+
+Rebuild moz whenever changes have been made in the nss module. Those libs are
+merged into mozruntime.zip which is built in this project.
+
+Please read, please read about [[nss]].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,moz_inc))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,moz_inc,$(MOZ_ZIP_INC),0))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,moz_lib))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,moz_lib,$(MOZ_ZIP_LIB),0))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,mozruntime))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,mozruntime,$(MOZ_ZIP_RUNTIME),0))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,msc-externals))
+
+$(eval $(call gb_Module_add_targets,msc-externals,\
+ $(if $(ENABLE_CRASHDUMP),Package_dbghelp) \
+ Package_msvc_dlls \
+ $(if $(WITH_MOZAB4WIN),Package_msvc80_dlls) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,dbghelp,$(TARFILE_LOCATION)))
+
+$(eval $(call gb_Package_add_file,dbghelp,$(LIBO_LIB_FOLDER)/dbghelp.dll,$(DBGHELP_DLL)))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,msvc80_dlls,$(MSVC80_DLL_PATH)))
+
+$(eval $(call gb_Package_add_files,msvc80_dlls,$(LIBO_LIB_FOLDER),\
+ $(MSVC80_DLLS) \
+))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,msvc_dlls,$(MSVC_DLL_PATH)))
+
+$(eval $(call gb_Package_add_files,msvc_dlls,program/shlxthdl,\
+ $(MSVC_DLLS) \
+))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
--- /dev/null
+module msc-externals copies the bundled MSVC runtime DLLs into instdir
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,mysqlcppconn))
+
+$(eval $(call gb_Library_use_unpacked,mysqlcppconn,mysqlcppconn))
+
+$(eval $(call gb_Library_use_externals,mysqlcppconn, \
+ boost_headers \
+ mariadb \
+))
+
+ifneq ($(OS)$(COM),WNTMSC)
+
+$(eval $(call gb_Library_add_libs,mysqlcppconn,\
+ $(if $(filter-out MACOSX,$(OS)),-ldl) \
+))
+
+endif
+
+$(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn))
+
+$(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp))
+
+$(eval $(call gb_Library_set_include,mysqlcppconn,\
+ $$(INCLUDE) \
+ -I$(call gb_UnpackedTarball_get_dir,mysqlcppconn) \
+ -I$(call gb_UnpackedTarball_get_dir,mysqlcppconn)/cppconn \
+))
+
+$(eval $(call gb_Library_add_defs,mysqlcppconn,\
+ -Dmysqlcppconn_EXPORTS \
+ $(if $(filter WNT,$(OS)),\
+ -DCPPDBC_WIN32 \
+ -D_CRT_SECURE_NO_WARNINGS \
+ -D_SCL_SECURE_NO_WARNINGS ) \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,mysqlcppconn,\
+ -lpthread \
+))
+endif
+
+$(eval $(call gb_Library_add_generated_exception_objects,mysqlcppconn,\
+ UnpackedTarball/mysqlcppconn/driver/mysql_art_resultset \
+ UnpackedTarball/mysqlcppconn/driver/mysql_art_rset_metadata \
+ UnpackedTarball/mysqlcppconn/driver/mysql_connection \
+ UnpackedTarball/mysqlcppconn/driver/mysql_debug \
+ UnpackedTarball/mysqlcppconn/driver/mysql_driver \
+ UnpackedTarball/mysqlcppconn/driver/mysql_metadata \
+ UnpackedTarball/mysqlcppconn/driver/mysql_parameter_metadata \
+ UnpackedTarball/mysqlcppconn/driver/mysql_prepared_statement \
+ UnpackedTarball/mysqlcppconn/driver/mysql_ps_resultset \
+ UnpackedTarball/mysqlcppconn/driver/mysql_ps_resultset_metadata \
+ UnpackedTarball/mysqlcppconn/driver/mysql_resultbind \
+ UnpackedTarball/mysqlcppconn/driver/mysql_resultset \
+ UnpackedTarball/mysqlcppconn/driver/mysql_resultset_metadata \
+ UnpackedTarball/mysqlcppconn/driver/mysql_statement \
+ UnpackedTarball/mysqlcppconn/driver/mysql_util \
+ UnpackedTarball/mysqlcppconn/driver/mysql_warning \
+ UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_client_api \
+ UnpackedTarball/mysqlcppconn/driver/nativeapi/library_loader \
+ UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_native_driver_wrapper \
+ UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_native_connection_wrapper \
+ UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_native_resultset_wrapper \
+ UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_native_statement_wrapper \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,mysqlcppconn))
+
+$(eval $(call gb_Module_add_targets,mysqlcppconn,\
+ UnpackedTarball_mysqlcppconn \
+ Library_mysqlcppconn \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://dev.mysql.com/downloads/connector/cpp/]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,mysqlcppconn))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,mysqlcppconn,$(MYSQLCPPCONN_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_file,mysqlcppconn,cppconn/config.h,external/mysqlcppconn/config.h))
+
+$(eval $(call gb_UnpackedTarball_add_file,mysqlcppconn,driver/nativeapi/binding_config.h,external/mysqlcppconn/binding_config.h))
+
+$(eval $(call gb_UnpackedTarball_add_patches,mysqlcppconn,\
+ external/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch \
+ external/mysqlcppconn/patches/default_to_protocol_tcp.patch \
+ external/mysqlcppconn/patches/warnings.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#define HAVE_DLFCN_H 1
+#define MYSQLCLIENT_STATIC_BINDING 1
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#include <sal/types.h>
+
+#define HAVE_FUNCTION_STRTOL 1
+#define HAVE_FUNCTION_STRTOUL 1
+#define HAVE_FUNCTION_STRTOL 1
+#define HAVE_FUNCTION_STRTOULL 1
+
+#if defined(MACOSX) || defined(SOLARIS) || defined(LINUX) || (defined _MSC_VER && _MSC_VER >= 1600)
+ #define HAVE_STDINT_H
+#ifndef _MSC_VER
+ #define HAVE_INTTYPES_H
+#endif
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H)
+
+// if we do not have the standard C99 integer types, then define them based on the respective SAL types
+#if !defined(_SYS_TYPES_H)
+typedef sal_Int8 int8_t;
+typedef sal_Int16 int16_t;
+typedef sal_Int32 int32_t;
+#endif // !defined(_SYS_TYPES_H)
+typedef sal_uInt8 uint8_t;
+typedef sal_uInt16 uint16_t;
+typedef sal_uInt32 uint32_t;
+typedef sal_Int64 int64_t;
+typedef sal_uInt64 uint64_t;
+#endif // !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--- /dev/null
+--- misc/mysql-connector-c++-1.1.0/driver/mysql_connection.cpp 2009-12-16 13:24:24.088933245 +0100
++++ misc/build/mysql-connector-c++-1.1.0/driver/mysql_connection.cpp 2009-12-16 13:24:15.666841004 +0100
+@@ -437,6 +437,9 @@
+ }
+ }
+
++ int default_protocol_tcp = MYSQL_PROTOCOL_TCP;
++ proxy->options(MYSQL_OPT_PROTOCOL, (const char *) &default_protocol_tcp);
++
+ #ifndef _WIN32
+ if (!hostName.compare(0, sizeof("unix://") - 1, "unix://")) {
+ protocol_tcp = false;
--- /dev/null
+--- misc/mysql-connector-c++-1.1.0/cppconn/build_config.h 2010-09-10 11:47:47.000000000 +0200
++++ misc/build/mysql-connector-c++-1.1.0/cppconn/build_config.h 2011-11-12 00:45:19.000000000 +0100
+@@ -25,25 +25,21 @@
+ #ifndef _SQL_BUILD_CONFIG_H_
+ #define _SQL_BUILD_CONFIG_H_
+
+-#ifndef CPPCONN_PUBLIC_FUNC
++#include <sal/types.h>
+
+-#if defined(_WIN32)
+ // mysqlcppconn_EXPORTS is added by cmake and defined for dynamic lib build only
+ #ifdef mysqlcppconn_EXPORTS
+- #define CPPCONN_PUBLIC_FUNC __declspec(dllexport)
++ #define CPPCONN_PUBLIC_FUNC SAL_DLLPUBLIC_EXPORT
+ #else
+ // this is for static build
+ #ifdef CPPCONN_LIB_BUILD
+ #define CPPCONN_PUBLIC_FUNC
+ #else
+ // this is for clients using dynamic lib
+- #define CPPCONN_PUBLIC_FUNC __declspec(dllimport)
++ #define CPPCONN_PUBLIC_FUNC SAL_DLLPUBLIC_IMPORT
+ #endif
+ #endif
+-#else
+- #define CPPCONN_PUBLIC_FUNC
+-#endif
+
+-#endif //#ifndef CPPCONN_PUBLIC_FUNC
++ #define CPPCONN_PUBLIC_EXCEPTION SAL_EXCEPTION_DLLPUBLIC_EXPORT
+
+ #endif //#ifndef _SQL_BUILD_CONFIG_H_
+--- misc/mysql-connector-c++-1.1.0/cppconn/exception.h 2009-08-20 17:51:23.000000000 +0200
++++ misc/build/mysql-connector-c++-1.1.0/cppconn/exception.h 2009-09-11 09:41:41.076379817 +0200
+@@ -37,7 +37,7 @@
+ #pragma warning(push)
+ #pragma warning(disable: 4275)
+ #endif
+-class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error
++class CPPCONN_PUBLIC_EXCEPTION SQLException : public std::runtime_error
+ {
+ #ifdef _WIN32
+ #pragma warning(pop)
+@@ -83,26 +83,26 @@
+ MEMORY_ALLOC_OPERATORS(SQLException)
+ };
+
+-struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException
++struct CPPCONN_PUBLIC_EXCEPTION MethodNotImplementedException : public SQLException
+ {
+ MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
+ MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {}
+ };
+
+-struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException
++struct CPPCONN_PUBLIC_EXCEPTION InvalidArgumentException : public SQLException
+ {
+ InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
+ InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {}
+ };
+
+-struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException
++struct CPPCONN_PUBLIC_EXCEPTION InvalidInstanceException : public SQLException
+ {
+ InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
+ InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {}
+ };
+
+
+-struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException
++struct CPPCONN_PUBLIC_EXCEPTION NonScrollableException : public SQLException
+ {
+ NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { }
+ NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {}
+--- misc/mysql-connector-c++-1.1.0/driver/mysql_debug.h 2009-08-13 17:13:46.000000000 +0200
++++ misc/build/mysql-connector-c++-1.1.0/driver/mysql_debug.h 2009-08-14 09:56:37.015625000 +0200
+@@ -25,16 +25,6 @@
+
+
+
+-#if defined(WE_HAVE_VARARGS_MACRO_SUPPORT) && (CPPCONN_TRACE_ENABLED || defined(SAL_DLLPRIVATE))
+- #define CPP_ENTER(msg) const boost::shared_ptr< MySQL_DebugLogger > __l = this->logger;(void)__l;\
+- MySQL_DebugEnterEvent __this_func(__LINE__, __FILE__, msg, this->logger)
+- #define CPP_ENTER_WL(l, msg) const boost::shared_ptr< MySQL_DebugLogger > __l = (l);(void)__l;\
+- MySQL_DebugEnterEvent __this_func(__LINE__, __FILE__, msg, (l))
+- #define CPP_INFO(msg) {if (__l) __l->log("INF", msg); }
+- #define CPP_INFO_FMT(...) {if (__l) __l->log_va("INF", __VA_ARGS__); }
+- #define CPP_ERR(msg) {if (__l) __l->log("ERR", msg); }
+- #define CPP_ERR_FMT(...) {if (__l) __l->log_va("ERR", __VA_ARGS__); }
+-#else
+ #define CPP_ENTER(msg)
+ #define CPP_ENTER_WL(l, msg)
+ #define CPP_INFO(msg)
+@@ -42,7 +32,6 @@
+ #define CPP_ENTER_WL(l, msg)
+ static inline void CPP_INFO_FMT(...) {}
+ static inline void CPP_ERR_FMT(...) {}
+-#endif
+
+ #include <stack>
+ #include "mysql_util.h"
+--- misc/mysql-connector-c++-1.1.0/driver/mysql_prepared_statement.cpp 2013-03-06 10:29:26.890721534 +0100
++++ misc/build/mysql-connector-c++-1.1.0/driver/mysql_prepared_statement.cpp 2013-03-06 10:32:02.979904080 +0100
+@@ -46,6 +46,10 @@
+
+ #include "mysql_debug.h"
+
++#ifndef CR_INVALID_BUFFER_USE
++#define CR_INVALID_BUFFER_USE 2035
++#endif
++
+
+ namespace sql
+ {
+
--- /dev/null
+--- cppconn/warning.h
++++ cppconn/warning.h
+@@ -59,7 +59,7 @@
+
+ virtual ~SQLWarning(){};
+
+- SQLWarning(const SQLWarning& e){};
++ SQLWarning(const SQLWarning&){};
+
+ private:
+ const SQLWarning & operator = (const SQLWarning & rhs);
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,mythes))
+
+$(eval $(call gb_ExternalProject_use_external,mythes,hunspell))
+
+$(eval $(call gb_ExternalProject_register_targets,mythes,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,mythes,build):
+ $(call gb_ExternalProject_run,build,\
+ LIBS="$(gb_STDLIBS) $(LIBS)" ./configure --disable-shared --with-pic \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,mythes))
+
+$(eval $(call gb_Module_add_targets,mythes,\
+ UnpackedTarball_mythes \
+))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_targets,mythes,\
+ StaticLibrary_mythes \
+))
+else
+$(eval $(call gb_Module_add_targets,mythes,\
+ ExternalProject_mythes \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Library for handling thesaurus files from [http://hunspell.sourceforge.net].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,mythes))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,mythes,mythes))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,mythes))
+
+$(eval $(call gb_StaticLibrary_add_generated_cxxobjects,mythes,\
+ UnpackedTarball/mythes/mythes \
+))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,mythes))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,mythes,$(MYTHES_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,mythes,\
+ external/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch \
+ external/mythes/mythes-1.2.0-android.patch \
+ external/mythes/mythes-ssizet.patch \
+ external/mythes/mythes-fdo48017-wfopen.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/mythes-1.2.3/config.sub 2010-02-27 16:52:52.000000000 +0100
++++ misc/build/mythes-1.2.3/config.sub 2011-09-26 23:39:04.000000000 +0200
+@@ -123,7 +123,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1294,7 +1294,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
--- /dev/null
+--- misc/mythes-1.2.3.orig/th_gen_idx.pl
++++ misc/build/mythes-1.2.3/th_gen_idx.pl
+@@ -1,11 +1,25 @@
+-#!/usr/bin/perl
+-
+-# perl program to take a thesaurus structured text data file
+-# and create the proper sorted index file (.idx)
++:
++eval 'exec perl -wS $0 ${1+"$@"}'
++ if 0;
++#
++# This file is part of the LibreOffice project.
++#
++# This Source Code Form is subject to the terms of the Mozilla Public
++# License, v. 2.0. If a copy of the MPL was not distributed with this
++# file, You can obtain one at http://mozilla.org/MPL/2.0/.
++#
++# This file incorporates work covered by the following license notice:
++#
++# Licensed to the Apache Software Foundation (ASF) under one or more
++# contributor license agreements. See the NOTICE file distributed
++# with this work for additional information regarding copyright
++# ownership. The ASF licenses this file to you under the Apache
++# License, Version 2.0 (the "License"); you may not use this file
++# except in compliance with the License. You may obtain a copy of
++# the License at http://www.apache.org/licenses/LICENSE-2.0 .
++#
+ #
+-# typically invoked as follows:
+-# cat th_en_US_new.dat | ./th_gen_idx.pl > th_en_US_new.idx
+ #
+
+ sub by_entry {
+ my ($aent, $aoff) = split('\|',$a);
+@@ -13,6 +34,27 @@ sub by_entry {
+ $aent cmp $bent;
+ }
+
++#FIXME: someone may want "infile" or even parameter parsing
++sub get_outfile {
++ my $next_is_file = 0;
++ foreach ( @ARGV ) {
++ if ( $next_is_file ) {
++ return $_
++ }
++ if ( $_ eq "-o" ) {
++ $next_is_file = 1;
++ }
++ }
++ return "";
++}
++
++sub usage {
++ print "usage:\n";
++ print "$0 -o outfile < input\n";
++
++ exit 99;
++}
++
+ # main routine
+ my $ne = 0; # number of entries in index
+ my @tindex=(); # the index itself
+@@ -24,6 +66,10 @@ my $nm=0; # number of meaning fo
+ my $meaning=""; # current meaning and synonyms
+ my $p; # misc uses
+ my $encoding; # encoding used by text file
++my $outfile = "";
++
++$outfile = get_outfile();
++usage() if ( $outfile eq "" );
+
+ # top line of thesaurus provides encoding
+ $encoding=<STDIN>;
+@@ -51,9 +97,13 @@ while ($rec=<STDIN>){
+ # now we have all of the information
+ # so sort it and then output the encoding, count and index data
+ @tindex = sort by_entry @tindex;
+-print STDOUT "$encoding\n";
+-print STDOUT "$ne\n";
++
++print "$outfile\n";
++open OUTFILE, ">$outfile" or die "ERROR: Can't open $outfile for writing!";
++print OUTFILE "$encoding\n";
++print OUTFILE "$ne\n";
+ foreach $one (@tindex) {
+- print STDOUT "$one\n";
++ print OUTFILE "$one\n";
+ }
++close OUTFILE;
+
--- /dev/null
+diff -u mythes/mythes.cxx build/mythes/mythes.cxx
+--- mythes/mythes.cxx 2014-05-22 00:27:38.508588487 +0200
++++ build/mythes/mythes.cxx 2014-05-22 10:07:06.107547417 +0200
+@@ -8,6 +8,11 @@
+
+ #include "mythes.hxx"
+
++#ifdef _WIN32
++#include <windows.h>
++#include <wchar.h>
++#endif
++
+ MyThes::MyThes(const char* idxpath, const char * datpath)
+ {
+ nw = 0;
+@@ -35,7 +40,7 @@
+ {
+
+ // open the index file
+- FILE * pifile = fopen(idxpath,"r");
++ FILE * pifile = myfopen(idxpath,"r");
+ if (!pifile) {
+ return 0;
+ }
+@@ -90,7 +95,7 @@
+ fclose(pifile);
+
+ /* next open the data file */
+- pdfile = fopen(datpath,"r");
++ pdfile = myfopen(datpath,"r");
+ if (!pdfile) {
+ return 0;
+ }
+@@ -373,3 +378,22 @@
+ return -1;
+ }
+
++FILE * MyThes::myfopen(const char * path, const char * mode) {
++#ifdef _WIN32
++#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
++ if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
++ int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
++ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
++ wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t));
++ FILE * f = NULL;
++ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
++ if (_wfullpath( buff2, buff, len ) != NULL) {
++ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++ }
++ free(buff);
++ free(buff2);
++ return f;
++ }
++#endif
++ return fopen(path, mode);
++}
+diff -u mythes/mythes.hxx build/mythes/mythes.hxx
+--- mythes/mythes.hxx 2010-03-04 12:56:23.000000000 +0100
++++ build/mythes/mythes.hxx 2014-05-22 10:11:14.363543731 +0200
+@@ -30,6 +30,7 @@
+ MyThes & operator = (const MyThes &);
+
+ public:
++ // use UTF-8 encoded paths in WIN32 environment
+ MyThes(const char* idxpath, const char* datpath);
+ ~MyThes();
+
+@@ -66,6 +67,9 @@
+ // return index of char in string
+ int mystr_indexOfChar(const char * d, int c);
+
++ // fopen or _wfopen
++ FILE * myfopen(const char * path, const char * mode);
++
+ };
+
+ #endif
--- /dev/null
+--- misc/mythes-1.2.3/mythes.cxx 2012-06-29 13:16:55.812939142 +0100
++++ misc/build/mythes-1.2.3/mythes.cxx 2012-06-29 13:17:21.159198507 +0100
+@@ -48,7 +48,7 @@
+ len = readLine(pifile,wrd,MAX_WD_LEN);
+ int idxsz = atoi(wrd);
+
+- if (idxsz <= 0 || idxsz > std::numeric_limits<ssize_t>::max() / sizeof(sizeof(char*))) {
++ if (idxsz <= 0 || idxsz > std::numeric_limits<int>::max() / sizeof(sizeof(char*))) {
+ fprintf(stderr,"Error - bad index %d\n", idxsz);
+ fclose(pifile);
+ return 0;
+@@ -176,7 +176,7 @@
+ return 0;
+ }
+ int nmeanings = atoi(buf+np+1);
+- if (nmeanings < 0 || nmeanings > std::numeric_limits<ssize_t>::max() / sizeof(mentry))
++ if (nmeanings < 0 || nmeanings > std::numeric_limits<int>::max() / sizeof(mentry))
+ nmeanings = 0;
+ *pme = (mentry*)(nmeanings ? malloc(nmeanings * sizeof(mentry)) : NULL);
+ if (!(*pme)) {
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,neon))
+
+$(eval $(call gb_Library_use_unpacked,neon,neon))
+
+$(eval $(call gb_Library_use_externals,neon,\
+ gnutls \
+ libxml2 \
+ libgcrypt \
+ openssl \
+ openssl_headers \
+ zlib \
+))
+
+$(eval $(call gb_Library_set_visibility_default,neon))
+
+# neon has its share of warning... let's spare use
+# the pointless spamming
+$(eval $(call gb_Library_add_cflags,neon,\
+ -w \
+))
+
+ifneq ($(debug),)
+$(eval $(call gb_Library_add_cflags,neon,\
+ -DNE_DEBUGGING \
+))
+endif
+
+$(eval $(call gb_Library_set_warnings_not_errors,neon))
+
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
+ UnpackedTarball/neon/src/ne_207 \
+ UnpackedTarball/neon/src/ne_acl3744 \
+ UnpackedTarball/neon/src/ne_alloc \
+ UnpackedTarball/neon/src/ne_auth \
+ UnpackedTarball/neon/src/ne_basic \
+ UnpackedTarball/neon/src/ne_compress \
+ UnpackedTarball/neon/src/ne_dates \
+ UnpackedTarball/neon/src/ne_i18n \
+ UnpackedTarball/neon/src/ne_locks \
+ UnpackedTarball/neon/src/ne_md5 \
+ UnpackedTarball/neon/src/ne_props \
+ UnpackedTarball/neon/src/ne_redirect \
+ UnpackedTarball/neon/src/ne_request \
+ UnpackedTarball/neon/src/ne_session \
+ UnpackedTarball/neon/src/ne_socket \
+ UnpackedTarball/neon/src/ne_socks \
+ UnpackedTarball/neon/src/ne_string \
+ UnpackedTarball/neon/src/ne_uri \
+ UnpackedTarball/neon/src/ne_utils \
+ UnpackedTarball/neon/src/ne_xml \
+ UnpackedTarball/neon/src/ne_xmlreq \
+))
+
+
+ifneq ($(DISABLE_OPENSSL),TRUE)
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
+ UnpackedTarball/neon/src/ne_openssl \
+))
+else
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
+ UnpackedTarball/neon/src/ne_gnutls \
+))
+endif
+
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_use_system_win32_libs,neon,\
+ ws2_32 \
+ crypt32 \
+))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_Library_add_ldflags,neon,\
+ /DEF:$(SRCDIR)/external/neon/neon.def \
+))
+endif
+
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
+ UnpackedTarball/neon/src/ne_sspi \
+))
+
+else
+ifneq ($(DISABLE_OPENSSL),TRUE)
+$(eval $(call gb_Library_add_generated_cobjects,neon,\
+ UnpackedTarball/neon/src/ne_ntlm \
+))
+endif
+
+endif
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,neon,\
+ -ldl \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,neon))
+
+$(eval $(call gb_Module_add_targets,neon,\
+ Library_neon \
+ UnpackedTarball_neon \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Web library to help deal with WebDAV or other protocols, from [http://www.webdav.org/neon/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,neon))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,neon,$(NEON_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_files,neon,src,\
+ external/neon/configs/config.h \
+))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,neon,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,neon,\
+ external/neon/neon.patch \
+ external/neon/neon_ne_set_request_flag.patch \
+ external/neon/neon_with_gnutls.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+/* Contents kept in sync with config.h.in from neon 0.29.5 */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Define to specific EGD socket path */
+/* #undef EGD_PATH */
+
+/* Define if EGD should be supported */
+/* #undef ENABLE_EGD */
+
+/* Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise */
+/* #undef GSS_C_NT_HOSTBASED_SERVICE */
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#ifdef UNX
+#define HAVE_ARPA_INET_H 1
+#endif
+
+/* Define to 1 if you have the `bind_textdomain_codeset' function. */
+/* #undef HAVE_BIND_TEXTDOMAIN_CODESET */
+
+/* Define to 1 if you have the `CRYPTO_set_idptr_callback' function. */
+/* #undef HAVE_CRYPTO_SET_IDPTR_CALLBACK */
+
+/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
+ don't. */
+#ifdef WIN32
+#define HAVE_DECL_H_ERRNO 1
+#endif
+
+/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
+ */
+#ifdef LINUX
+#define HAVE_DECL_STPCPY 1
+#endif
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#ifdef LINUX
+#define HAVE_DECL_STRERROR_R 1
+#endif
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#ifdef UNX
+#define HAVE_DLFCN_H 1
+#endif
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define if you have expat */
+/* #undef HAVE_EXPAT */
+
+/* Define to 1 if you have the `fcntl' function. */
+#ifdef UNX
+#define HAVE_FCNTL 1
+#endif
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#ifdef UNX
+#define HAVE_FCNTL_H 1
+#endif
+
+/* Define to 1 if you have the `fstat64' function. */
+#define HAVE_FSTAT64
+
+/* Define to 1 if you have the `gai_strerror' function. */
+#define HAVE_GAI_STRERROR 1
+
+/* Define to 1 if you have the `gethostname' function. */
+/* #undef HAVE_GETHOSTNAME */
+
+/* Define to 1 if you have the `getnameinfo' function. */
+/* #undef HAVE_GETNAMEINFO */
+
+/* Define to 1 if you have the `getsockopt' function. */
+#ifdef UNX
+#define HAVE_GETSOCKOPT 1
+#endif
+
+#ifdef DISABLE_OPENSSL
+/* Define if GnuTLS support is enabled */
+#define HAVE_GNUTLS
+
+/* Define to 1 if you have the `gnutls_certificate_get_x509_cas' function. */
+/* #undef HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS */
+
+/* Define to 1 if you have the `gnutls_certificate_verify_peers2' function. */
+#define HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS2
+
+/* Define to 1 if you have the `gnutls_session_get_data2' function. */
+#define HAVE_GNUTLS_SESSION_GET_DATA2
+
+/* Define to 1 if you have the `gnutls_sign_callback_set' function. */
+#define HAVE_GNUTLS_SIGN_CALLBACK_SET
+
+/* Define to 1 if you have the `gnutls_x509_dn_get_rdn_ava' function. */
+#define HAVE_GNUTLS_X509_DN_GET_RDN_AVA
+#endif /* DISABLE_OPENSSL */
+
+/* Define if GSSAPI support is enabled */
+/* #undef HAVE_GSSAPI */
+
+/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
+/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
+
+/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
+/* #undef HAVE_GSSAPI_GSSAPI_H */
+
+/* Define to 1 if you have the <gssapi.h> header file. */
+/* #undef HAVE_GSSAPI_H */
+
+/* Define to 1 if you have the `gss_init_sec_context' function. */
+/* #undef HAVE_GSS_INIT_SEC_CONTEXT */
+
+/* Define to 1 if you have the `hstrerror' function. */
+/* #undef HAVE_HSTRERROR */
+
+/* Define to 1 if you have the `iconv' function. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the <iconv.h> header file. */
+/* #undef HAVE_ICONV_H */
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#ifdef UNX
+#define HAVE_INET_NTOP 1
+#endif
+
+/* Define to 1 if you have the `inet_pton' function. */
+/* #undef HAVE_INET_PTON */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#ifdef UNX
+#define HAVE_INTTYPES_H 1
+#endif
+
+/* Define to 1 if you have the `isatty' function. */
+#define HAVE_ISATTY 1
+
+/* Define to 1 if you have the <libintl.h> header file. */
+/* #undef HAVE_LIBINTL_H */
+
+/* Define if libproxy is supported */
+/* #undef HAVE_LIBPROXY */
+
+/* Define if you have libxml */
+#define HAVE_LIBXML 1
+
+/* Define to 1 if you have the <libxml/parser.h> header file. */
+#define HAVE_LIBXML_PARSER_H 1
+
+/* Define to 1 if you have the <libxml/xmlversion.h> header file. */
+#define HAVE_LIBXML_XMLVERSION_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if you have the `lseek64' function. */
+#define HAVE_LSEEK64 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#ifdef UNX
+#define HAVE_NETDB_H 1
+#endif
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#ifdef UNX
+#define HAVE_NETINET_IN_H 1
+#endif
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#ifdef UNX
+#define HAVE_NETINET_TCP_H 1
+#endif
+
+#ifndef DISABLE_OPENSSL
+/* Define if NTLM is supported */
+#ifndef WIN32
+#define HAVE_NTLM 1
+#endif
+
+/* Define if OpenSSL support is enabled */
+#define HAVE_OPENSSL 1
+
+/* Define to 1 if you have the <openssl/opensslv.h> header file. */
+#define HAVE_OPENSSL_OPENSSLV_H 1
+
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
+#define HAVE_OPENSSL_SSL_H 1
+#endif /* !DISABLE_OPENSSL */
+
+/* Define if pakchois library supported */
+/* #undef HAVE_PAKCHOIS */
+
+/* Define to 1 if you have the `pipe' function. */
+#define HAVE_PIPE 1
+
+/* Define to 1 if you have the `poll' function. */
+#define HAVE_POLL 1
+
+/* Define to 1 if you have the `pthread_mutex_init' function. */
+/* #undef HAVE_PTHREAD_MUTEX_INIT */
+
+/* Define to 1 if you have the `pthread_mutex_lock' function. */
+/* #undef HAVE_PTHREAD_MUTEX_LOCK */
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setsockopt' function. */
+#if defined (LINUX) || defined (WIN32)
+#define HAVE_SETSOCKOPT 1
+#endif
+
+/* Define to 1 if you have the `setvbuf' function. */
+#define HAVE_SETVBUF 1
+
+/* Define to 1 if you have the `shutdown' function. */
+#ifdef LINUX
+#define HAVE_SHUTDOWN 1
+#endif
+
+/* Define to 1 if you have the `signal' function. */
+#define HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#ifdef UNX
+#define HAVE_SNPRINTF 1
+#endif
+
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#ifdef UNX
+#define HAVE_SOCKLEN_T 1
+#endif
+
+/* Define to 1 if you have the `SSL_SESSION_cmp' function. */
+/* #undef HAVE_SSL_SESSION_CMP */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `stpcpy' function. */
+#ifdef LINUX
+#define HAVE_STPCPY 1
+#endif
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#ifdef UNX
+#define HAVE_STRCASECMP 1
+#endif
+
+#ifdef WIN32
+#define strcasecmp strcmpi
+#endif
+
+/* Define to 1 if you have the `strerror_r' function. */
+#ifdef LINUX
+#define HAVE_STRERROR_R 1
+#endif
+
+/* Define to 1 if you have the <strings.h> header file. */
+#ifdef UNX
+#define HAVE_STRINGS_H 1
+#endif
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define HAVE_STRTOLL 1
+
+/* Define to 1 if you have the `strtoq' function. */
+/* #undef HAVE_STRTOQ */
+
+/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
+#ifdef LINUX
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+#endif
+
+/* Define to 1 if `__tm_gmtoff' is member of `struct tm'. */
+/* #undef HAVE_STRUCT_TM___TM_GMTOFF */
+
+/* Define to 1 if you have the <sys/limits.h> header file. */
+/* #undef HAVE_SYS_LIMITS_H */
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#ifdef UNX
+#define HAVE_SYS_POLL_H 1
+#endif
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#ifdef UNX
+#define HAVE_SYS_SELECT_H 1
+#endif
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#ifdef UNX
+#define HAVE_SYS_SOCKET_H 1
+#endif
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#ifdef UNX
+#define HAVE_SYS_TIME_H 1
+#endif
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if the timezone global is available */
+#ifndef MACOSX
+#define HAVE_TIMEZONE 1
+#endif
+
+/* Use trio printf replacement library */
+/* #undef HAVE_TRIO */
+
+/* Define to 1 if you have the <trio.h> header file. */
+/* #undef HAVE_TRIO_H */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#ifdef UNX
+#define HAVE_UNISTD_H 1
+#endif
+
+/* Define to 1 if you have the `usleep' function. */
+#ifdef UNX
+#define HAVE_USLEEP 1
+#endif
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#if defined( UNX ) || defined(_MSC_VER)
+#define HAVE_VSNPRINTF 1
+#endif
+
+#ifdef __MINGW32__
+#define vsnprintf _vsnprintf
+#endif
+
+/* Define to be location of localedir */
+/* #undef LOCALEDIR */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+/* #undef LT_OBJDIR */
+
+/* Defined when neon is built as a library */
+#define NEON_IS_LIBRARY 1
+
+/* Define to be the neon version string */
+#define NEON_VERSION "0.29.5"
+
+/* Define to enable debugging */
+/* #undef NE_DEBUGGING */
+
+/* Define to be printf format string for ne_off_t */
+/* #undef NE_FMT_NE_OFF_T */
+
+/* Define to be printf format string for off64_t */
+#define NE_FMT_OFF64_T "lld"
+
+/* Define to be printf format string for off_t */
+#define NE_FMT_OFF_T "ld"
+
+/* Define to be printf format string for size_t */
+#define NE_FMT_SIZE_T "u"
+
+/* Define to be printf format string for ssize_t */
+#define NE_FMT_SSIZE_T "d"
+
+/* Define to be printf format string for time_t */
+#define NE_FMT_TIME_T "ld"
+
+/* Define to be printf format string for XML_Size */
+/* #undef NE_FMT_XML_SIZE */
+
+/* Defined if DAV is supported */
+#define NE_HAVE_DAV 1
+
+/* Defined if I18N is supported */
+/* #undef NE_HAVE_I18N */
+
+/* Defined if IPV6 is supported */
+#define NE_HAVE_IPV6 1
+
+/* Defined if LFS is supported */
+#define NE_HAVE_LFS 1
+
+/* Defined if LIBPXY is supported */
+/* #undef NE_HAVE_LIBPXY */
+
+/* Defined if SSL is supported */
+#define NE_HAVE_SSL
+
+/* Defined if TS_SSL is supported */
+/* #undef NE_HAVE_TS_SSL */
+
+/* Defined if ZLIB is supported */
+#define NE_HAVE_ZLIB 1
+
+/* Define to be filename of an SSL CA root bundle */
+/* #undef NE_SSL_CA_BUNDLE */
+
+/* Define if poll() should be used */
+#ifdef UNX
+#define NE_USE_POLL 1
+#endif
+
+/* Define to be neon library major version */
+#define NE_VERSION_MAJOR (0)
+
+/* Define to be neon library minor version */
+#define NE_VERSION_MINOR (29)
+
+/* Define to be neon library patch version */
+#define NE_VERSION_PATCH (5)
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "neon@webdav.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "neon"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "neon 0.29.5"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "neon"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.29.5"
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `off64_t', as computed by sizeof. */
+#define SIZEOF_OFF64_T 8
+
+/* The size of `off_t', as computed by sizeof. */
+#define SIZEOF_OFF_T 4
+
+/* The size of `size_t', as computed by sizeof. */
+#define SIZEOF_SIZE_T 4
+
+/* The size of `ssize_t', as computed by sizeof. */
+#define SIZEOF_SSIZE_T 4
+
+/* The size of `time_t', as computed by sizeof. */
+#define SIZEOF_TIME_T 4
+
+/* The size of `XML_Size', as computed by sizeof. */
+/* #undef SIZEOF_XML_SIZE */
+
+/* Define to 1 if you have the ANSI C header files. */
+#ifdef SOLARIS
+#define STDC_HEADERS 1
+#endif
+
+/* Define to 1 if strerror_r returns char *. */
+#ifdef LINUX
+#define STRERROR_R_CHAR_P 1
+#endif
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if getaddrinfo supports AI_ADDRCONFIG */
+/* #undef USE_GAI_ADDRCONFIG */
+
+/* Define if getaddrinfo() should be used */
+#define USE_GETADDRINFO 1
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined (SOLARIS) && defined (SPARC)
+#define WORDS_BIGENDIAN 1
+#endif
+
+/* Always defined to enable GNU extensions */
+#define _GNU_SOURCE 1
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define if in_addr_t is not available */
+/* #undef in_addr_t */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#if defined (SOLARIS) && defined (__SUNPRO_C)
+#define inline
+#endif
+#endif
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define if socklen_t is not available */
+/* #undef socklen_t */
+
+/* MS IIS does not send Lock-Token response header after creation of a */
+/* new lock. This violates RFC, but... if we want to talk with this */
+/* beast we need a workaround */
+#define IIS_LOCK_BUG_WORKAROUND 1
+
+
+/* Enable leak-tracking versions of ne_*alloc when NEON_MEMLEAK is enabled */
+#ifdef NEON_MEMLEAK
+# include "memleak.h"
+#endif
+
+#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy)
+char *stpcpy(char *, const char *);
+#endif
+
+#ifdef WIN32
+
+#include <io.h>
+
+#define HAVE_MEMCPY 1
+
+#define strncasecmp strnicmp
+#define inline __inline
+#define WIN32_LEAN_AND_MEAN
+#define NOUSER
+#define NOGDI
+#define NONLS
+#define NOCRYPT
+
+#define HAVE_SSPI 1
+
+#endif
--- /dev/null
+LIBRARY "neon.dll"
+HEAPSIZE 0
+EXPORTS
+ ne_sspi_authenticate;
+ ne_sspi_clear_context;
+ ne_sspi_create_context;
+ ne_sspi_deinit;
+ ne_sspi_destroy_context;
+ ne_sspi_init;
+ ne__negotiate_ssl;
+ ne__ssl_exit;
+ ne__ssl_init;
+ ne_ssl_cert_cmp;
+ ne_ssl_cert_digest;
+ ne_ssl_cert_export;
+ ne_ssl_cert_free;
+ ne_ssl_cert_identity;
+ ne_ssl_cert_import;
+ ne_ssl_cert_issuer;
+ ne_ssl_cert_read;
+ ne_ssl_cert_signedby;
+ ne_ssl_cert_subject;
+ ne_ssl_cert_validity_time;
+ ne_ssl_cert_write;
+ ne_ssl_clicert_decrypt;
+ ne_ssl_clicert_encrypted;
+ ne_ssl_clicert_free;
+ ne_ssl_clicert_name;
+ ne_ssl_clicert_owner;
+ ne_ssl_clicert_read;
+ ne_ssl_context_create;
+ ne_ssl_context_destroy;
+ ne_ssl_context_keypair;
+ ne_ssl_context_set_flag;
+ ne_ssl_context_set_verify;
+ ne_ssl_context_trustcert;
+ ne_ssl_dname_cmp;
+ ne_ssl_readable_dname;
+ ne_ssl_set_clicert;
+ ne_ssl_trust_default_ca;
+ ne_xml_dispatch_request;
+ ne_xml_parse_response;
+ ne_xml_create;
+ ne_xml_currentline;
+ ne_xml_destroy;
+ ne_xml_doc_encoding;
+ ne_xml_failed;
+ ne_xml_get_attr;
+ ne_xml_get_error;
+ ne_xml_mapid;
+ ne_xml_parse;
+ ne_xml_parse_v;
+ ne_xml_push_handler;
+ ne_xml_resolve_nspace;
+ ne_xml_set_error;
+ ne_debug;
+ ne_debug_init;
+ ne_debug_mask;
+ ne_debug_stream;
+ ne_has_support;
+ ne_parse_statusline;
+ ne_version_match;
+ ne_version_string;
+ ne_path_childof;
+ ne_path_compare;
+ ne_path_escape;
+ ne_path_has_trailing_slash;
+ ne_path_parent;
+ ne_path_unescape;
+ ne_uri_cmp;
+ ne_uri_copy;
+ ne_uri_defaultport;
+ ne_uri_free;
+ ne_uri_parse;
+ ne_uri_resolve;
+ ne_uri_unparse;
+ ne_base64;
+ ne_buffer_altered;
+ ne_buffer_append;
+ ne_buffer_clear;
+ ne_buffer_concat;
+ ne_buffer_create;
+ ne_buffer_destroy;
+ ne_buffer_finish;
+ ne_buffer_grow;
+ ne_buffer_ncreate;
+ ne_buffer_snprintf;
+ ne_buffer_zappend;
+ ne_concat;
+ ne_qtoken;
+ ne_shave;
+ ne_snprintf;
+ ne_strcasecmp;
+ ne_strclean;
+ ne_strerror;
+ ne_strncasecmp;
+ ne_token;
+ ne_tolower_array;
+ ne_unbase64;
+ ne_vsnprintf;
+ ne__sock_sslsock;
+ ne_addr_destroy;
+ ne_addr_error;
+ ne_addr_first;
+ ne_addr_next;
+ ne_addr_resolve;
+ ne_addr_result;
+ ne_iaddr_cmp;
+ ne_iaddr_free;
+ ne_iaddr_make;
+ ne_iaddr_print;
+ ne_iaddr_reverse;
+ ne_iaddr_typeof;
+ ne_sock_accept;
+ ne_sock_accept_ssl;
+ ne_sock_block;
+ ne_sock_cipher;
+ ne_sock_close;
+ ne_sock_connect;
+ ne_sock_connect_ssl;
+ ne_sock_connect_timeout;
+ ne_sock_create;
+ ne_sock_error;
+ ne_sock_exit;
+ ne_sock_fd;
+ ne_sock_fullread;
+ ne_sock_fullwrite;
+ ne_sock_init;
+ ne_sock_peek;
+ ne_sock_peer;
+ ne_sock_prebind;
+ ne_sock_proxy;
+ ne_sock_read;
+ ne_sock_read_timeout;
+ ne_sock_readline;
+ ne_sock_sessid;
+ ne__ssl_set_verify_err;
+ ne_close_connection;
+ ne_fill_proxy_uri;
+ ne_fill_server_uri;
+ ne_get_error;
+ ne_get_scheme;
+ ne_get_server_hostport;
+ ne_get_session_flag;
+ ne_hook_close_conn;
+ ne_hook_create_request;
+ ne_hook_destroy_request;
+ ne_hook_destroy_session;
+ ne_hook_post_headers;
+ ne_hook_post_send;
+ ne_hook_pre_send;
+ ne_session_create;
+ ne_session_destroy;
+ ne_session_proxy;
+ ne_set_addrlist;
+ ne_set_connect_timeout;
+ ne_set_error;
+ ne_set_localaddr;
+ ne_set_notifier;
+ ne_set_progress;
+ ne_set_read_timeout;
+ ne_set_session_flag;
+ ne_set_session_private;
+ ne_set_useragent;
+ ne_ssl_cert_validity;
+ ne_ssl_provide_clicert;
+ ne_ssl_set_verify;
+ ne_ssl_trust_cert;
+ ne_unhook_close_conn;
+ ne_unhook_create_request;
+ ne_unhook_destroy_request;
+ ne_unhook_destroy_session;
+ ne_unhook_post_headers;
+ ne_unhook_post_send;
+ ne_unhook_pre_send;
+ ne_version_pre_http11;
+ ne_accept_2xx;
+ ne_accept_always;
+ ne_add_request_header;
+ ne_add_response_body_reader;
+ ne_begin_request;
+ ne_discard_response;
+ ne_end_request;
+ ne_get_request_flag;
+ ne_get_request_private;
+ ne_get_response_header;
+ ne_get_session;
+ ne_get_session_private;
+ ne_get_status;
+ ne_print_request_header;
+ ne_read_response_block;
+ ne_read_response_to_fd;
+ ne_request_create;
+ ne_request_destroy;
+ ne_request_dispatch;
+ ne_response_header_iterate;
+ ne_set_request_body_buffer;
+ ne_set_request_body_fd;
+ ne_set_request_body_provider;
+ ne_set_request_flag;
+ ne_set_request_private;
+ ne_redirect_location;
+ ne_redirect_register;
+ ne_propfind_allprop;
+ ne_propfind_create;
+ ne_propfind_current_private;
+ ne_propfind_destroy;
+ ne_propfind_get_parser;
+ ne_propfind_get_request;
+ ne_propfind_named;
+ ne_propfind_set_private;
+ ne_propnames;
+ ne_proppatch;
+ ne_propset_iterate;
+ ne_propset_lang;
+ ne_propset_private;
+ ne_propset_status;
+ ne_propset_value;
+ ne_simple_propfind;
+ ne_ascii_to_md5;
+ ne_md5_create_ctx;
+ ne_md5_destroy_ctx;
+ ne_md5_dup_ctx;
+ ne_md5_finish_ascii;
+ ne_md5_finish_ctx;
+ ne_md5_process_block;
+ ne_md5_process_bytes;
+ ne_md5_read_ctx;
+ ne_md5_reset_ctx;
+ ne_md5_stream;
+ ne_md5_to_ascii;
+ ne_lock;
+ ne_lock_copy;
+ ne_lock_create;
+ ne_lock_destroy;
+ ne_lock_discover;
+ ne_lock_free;
+ ne_lock_refresh;
+ ne_lock_using_parent;
+ ne_lock_using_resource;
+ ne_lockstore_add;
+ ne_lockstore_create;
+ ne_lockstore_destroy;
+ ne_lockstore_findbyuri;
+ ne_lockstore_first;
+ ne_lockstore_next;
+ ne_lockstore_register;
+ ne_lockstore_remove;
+ ne_unlock;
+ ne_i18n_init;
+ ne_asctime_parse;
+ ne_httpdate_parse;
+ ne_iso8601_parse;
+ ne_rfc1036_parse;
+ ne_rfc1123_date;
+ ne_rfc1123_parse;
+ ne_decompress_destroy;
+ ne_decompress_reader;
+ ne_add_depth_header;
+ ne_copy;
+ ne_delete;
+ ne_get;
+ ne_get_content_type;
+ ne_get_range;
+ ne_getmodtime;
+ ne_mkcol;
+ ne_move;
+ ne_options;
+ ne_options2;
+ ne_post;
+ ne_put;
+ ne_add_proxy_auth;
+ ne_add_server_auth;
+ ne_forget_auth;
+ ne_set_proxy_auth;
+ ne_set_server_auth;
+ ne_calloc;
+ ne_malloc;
+ ne_oom_callback;
+ ne_realloc;
+ ne_strdup;
+ ne_strndup;
+ ne_free;
+ ne_acl3744_set;
+ ne_207_create;
+ ne_207_destroy;
+ ne_207_get_current_propstat;
+ ne_207_get_current_response;
+ ne_207_set_propstat_handlers;
+ ne_207_set_response_handlers;
+ ne_accept_207;
+ ne_simple_request;
--- /dev/null
+--- src/ne_auth.c 2010-10-14 17:00:53.000000000 +0200
++++ src/ne_auth.c 2011-02-03 10:31:22.000000000 +0100
+@@ -367,7 +367,7 @@
+ static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt,
+ struct auth_challenge *chall, char *pwbuf)
+ {
+- if (chall->handler->creds(chall->handler->userdata, sess->realm,
++ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm,
+ chall->handler->attempt++, sess->username, pwbuf) == 0) {
+ return 0;
+ } else {
+@@ -385,15 +385,19 @@
+ {
+ char *tmp, password[NE_ABUFSIZ];
+
++#if 0 /* Workaround - IIS sends challenge without realm. */
++
+ /* Verify challenge... must have a realm */
+ if (parms->realm == NULL) {
+ challenge_error(errmsg, _("missing realm in Basic challenge"));
+ return -1;
+ }
++#endif
+
+ clean_session(sess);
+
+- sess->realm = ne_strdup(parms->realm);
++ if (parms->realm != NULL)
++ sess->realm = ne_strdup(parms->realm);
+
+ if (get_credentials(sess, errmsg, attempt, parms, password)) {
+ /* Failed to get credentials */
+@@ -610,10 +614,12 @@
+ return NULL;
+ }
+
+-static int continue_sspi(auth_session *sess, int ntlm, const char *hdr)
++static int continue_sspi(auth_session *sess, int ntlm, const char *hdr,
++ int attempt, struct auth_challenge *parms, ne_buffer **errmsg)
+ {
+ int status;
+ char *response = NULL;
++ char password[NE_ABUFSIZ];
+
+ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n");
+
+@@ -630,8 +636,17 @@
+ return status;
+ }
+ }
+-
+- status = ne_sspi_authenticate(sess->sspi_context, hdr, &response);
++
++ /* Authentification needs more than one http request.
++ * As long as authentification in progress use the existing credentials.
++ * Otherwise get new credentials.*/
++ if (!hdr)
++ if (get_credentials(sess, errmsg, attempt, parms, password)) {
++ /* Failed to get credentials */
++ return -1;
++ }
++
++ status = ne_sspi_authenticate(sess->sspi_context, hdr, &response, sess->username, password);
+ if (status) {
+ return status;
+ }
+@@ -651,7 +666,7 @@
+ {
+ int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
+
+- return continue_sspi(sess, ntlm, parms->opaque);
++ return continue_sspi(sess, ntlm, parms->opaque, attempt, parms, errmsg);
+ }
+
+ static int verify_sspi(struct auth_request *req, auth_session *sess,
+@@ -674,7 +689,7 @@
+ return NE_OK;
+ }
+
+- return continue_sspi(sess, ntlm, ptr);
++ return continue_sspi(sess, ntlm, ptr, 0, NULL, NULL);
+ }
+
+ #endif
+--- src/ne_auth.h 2009-09-01 22:13:12.000000000 +0200
++++ src/ne_auth.h 2011-02-03 10:26:20.000000000 +0100
+@@ -47,8 +47,8 @@
+ * Hint: if you just wish to attempt authentication just once (even if
+ * the user gets the username/password wrong), have the callback
+ * function use 'attempt' value as the function return value. */
+-typedef int (*ne_auth_creds)(void *userdata, const char *realm, int attempt,
+- char *username, char *password);
++typedef int (*ne_auth_creds)(void *userdata, const char * auth_protocol,
++ const char *realm, int attempt, char *username, char *password);
+
+ /* Set callbacks to provide credentials for server and proxy
+ * authentication, using the default set of authentication protocols.
+--- src/ne_defs.h 2010-01-11 23:57:34.000000000 +0100
++++ src/ne_defs.h 2011-02-03 10:26:20.000000000 +0100
+@@ -41,7 +41,7 @@
+ #endif
+
+ /* define ssize_t for Win32 */
+-#if defined(WIN32) && !defined(ssize_t)
++#if defined(WIN32) && !defined(ssize_t) && !defined(__MINGW32__)
+ #define ssize_t int
+ #endif
+
+--- src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100
++++ src/ne_locks.c 2011-02-03 10:26:21.000000000 +0100
+@@ -579,6 +579,23 @@
+ const char *token = ne_get_response_header(ctx->req, "Lock-Token");
+ /* at the root element; retrieve the Lock-Token header,
+ * and bail if it wasn't given. */
++#ifdef IIS_LOCK_BUG_WORKAROUND
++ /* MS IIS violates RFC 2518/4918. It does not send a Lock-Token response
++ header upon successful creation of a new lock. As a workaround, we
++ will try to pick the lock token from the response body (although
++ this is not 100% safe in case of multiple activelocks). */
++ if (token == NULL)
++ NE_DEBUG(NE_DBG_LOCKS,
++ "Ignoring missing LOCK response Lock-Token header\n");
++
++ if (token != NULL) {
++ if (token[0] == '<') token++;
++ ctx->token = ne_strdup(token);
++ ne_shave(ctx->token, ">");
++ NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n",
++ ctx->token);
++ }
++#else
+ if (token == NULL) {
+ ne_xml_set_error(ctx->parser,
+ _("LOCK response missing Lock-Token header"));
+@@ -590,12 +607,28 @@
+ ne_shave(ctx->token, ">");
+ NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n",
+ ctx->token);
++#endif
+ }
+
+ /* TODO: only accept 'prop' as root for LOCK response */
+ if (!can_accept(parent, id))
+ return NE_XML_DECLINE;
+
++#ifdef IIS_LOCK_BUG_WORKAROUND
++ if (id == ELM_activelock && ctx->found) {
++ /* Found another activelock... */
++ const char *token = ne_get_response_header(ctx->req, "Lock-Token");
++ if (token == NULL) {
++ /* Response contains more than one activelock and no Lock-Token
++ * response header. We are doomed. No safe workaround for IIS
++ * lock bug possible. */
++ ne_xml_set_error(ctx->parser,
++ _("LOCK response missing Lock-Token header and more than one activelock"));
++ return NE_XML_ABORT;
++ }
++ }
++#endif
++
+ if (id == ELM_activelock && !ctx->found) {
+ /* a new activelock */
+ ne_lock_free(&ctx->active);
+@@ -621,7 +654,12 @@
+ return -1;
+
+ if (state == ELM_activelock) {
++#ifdef IIS_LOCK_BUG_WORKAROUND
++ if (ctx->active.token) {
++ ctx->token = ne_strdup(ctx->active.token);
++#else
+ if (ctx->active.token && strcmp(ctx->active.token, ctx->token) == 0) {
++#endif
+ ctx->found = 1;
+ }
+ }
+--- src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200
++++ src/ne_sspi.c 2011-02-03 10:26:21.000000000 +0100
+@@ -206,6 +206,45 @@
+ }
+
+ /*
++ * Simplification wrapper arround AcquireCredentialsHandle as most of
++ * the parameters do not change.
++ */
++static int acquireCredentialsHandleForUsername(CredHandle * credentials, char *package, const char *username, const char *password)
++{
++ SECURITY_STATUS status;
++ TimeStamp timestamp;
++
++ const char *domain = "";
++
++ int rc, rcISC;
++ SecPkgInfo *secPackInfo;
++ SEC_WINNT_AUTH_IDENTITY *nameAndPwd = NULL;
++ int bytesReceived = 0, bytesSent = 0;
++
++ nameAndPwd = (SEC_WINNT_AUTH_IDENTITY *) malloc( sizeof(SEC_WINNT_AUTH_IDENTITY) );
++ memset( nameAndPwd, '\0', sizeof (*nameAndPwd) );
++ nameAndPwd->Domain = (unsigned char *) _strdup( domain? domain: "" );
++ nameAndPwd->DomainLength = domain? strlen( domain ): 0;
++ nameAndPwd->User = (unsigned char *) _strdup( username? username: "" );
++ nameAndPwd->UserLength = username? strlen( username ): 0;
++ nameAndPwd->Password = (unsigned char *) _strdup( password? password: "" );
++ nameAndPwd->PasswordLength = password? strlen( password ): 0;
++ nameAndPwd->Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
++
++ status = pSFT->AcquireCredentialsHandle( NULL, package, SECPKG_CRED_OUTBOUND,
++ NULL, nameAndPwd, NULL, NULL, credentials, ×tamp );
++
++ if (status != SEC_E_OK) {
++ NE_DEBUG(NE_DBG_HTTPAUTH,
++ "sspi: AcquireCredentialsHandle [fail] [%x].\n", status);
++ return -1;
++ }
++
++ return 0;
++}
++
++
++/*
+ * Wrapper arround initializeSecurityContext. Supplies several
+ * default parameters as well as logging in case of errors.
+ */
+@@ -483,7 +522,7 @@
+ * Processes received authentication tokens as well as supplies the
+ * response token.
+ */
+-int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken)
++int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken, const char* username, const char* password)
+ {
+ SecBufferDesc outBufferDesc;
+ SecBuffer outBuffer;
+@@ -561,13 +600,22 @@
+ /* Reset any existing context since we are starting over */
+ resetContext(sspiContext);
+
+- if (acquireCredentialsHandle
+- (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
+- freeBuffer(&outBufferDesc);
+- NE_DEBUG(NE_DBG_HTTPAUTH,
+- "sspi: acquireCredentialsHandle failed.\n");
+- return -1;
+- }
++ if (strlen(username) != 0) {
++ if (acquireCredentialsHandleForUsername
++ (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) {
++ freeBuffer(&outBufferDesc);
++ NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandleForUsername failed.\n");
++ return -1;
++ }
++ } else {
++ if (acquireCredentialsHandle
++ (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
++ freeBuffer(&outBufferDesc);
++ NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandle failed.\n");
++ return -1;
++ }
++ }
++
+
+ securityStatus =
+ initializeSecurityContext(&sspiContext->credentials, NULL,
+--- src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100
++++ src/ne_sspi.h 2011-02-03 10:26:21.000000000 +0100
+@@ -41,7 +41,7 @@
+ int ne_sspi_clear_context(void *context);
+
+ int ne_sspi_authenticate(void *context, const char *base64Token,
+- char **responseToken);
++ char **responseToken, const char* username, const char* password);
+
+ #endif /* HAVE_SSPI */
+
+--- src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100
++++ src/ne_uri.c 2011-02-03 10:26:21.000000000 +0100
+@@ -42,7 +42,7 @@
+ #include "ne_alloc.h"
+ #include "ne_uri.h"
+
+-/* URI ABNF from RFC 3986: */
++/* URI ABNF from RFC 3986: (TKR: SharePoint is contradictory to this RFC. So I fix it here. )*/
+
+ #define PS (0x0001) /* "+" */
+ #define PC (0x0002) /* "%" */
+@@ -67,6 +67,9 @@
+
+ #define OT (0x4000) /* others */
+
++/* TKR new symbol */
++#define WS (0x8000) /* Whitespaces ( Space, Tab ) */
++
+ #define URI_ALPHA (AL)
+ #define URI_DIGIT (DG)
+
+@@ -83,20 +86,21 @@
+ /* pchar = unreserved / pct-encoded / sub-delims / ":" / "@" */
+ #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT)
+ /* invented: segchar = pchar / "/" */
+-#define URI_SEGCHAR (URI_PCHAR | FS)
++/* (TKR) WS added */
++#define URI_SEGCHAR (URI_PCHAR | FS | WS)
+ /* query = *( pchar / "/" / "?" ) */
+ #define URI_QUERY (URI_PCHAR | FS | QU)
+ /* fragment == query */
+ #define URI_FRAGMENT URI_QUERY
+
+ /* any characters which should be path-escaped: */
+-#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | PC)
++#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | WS | PC)
+
+ static const unsigned int uri_chars[256] = {
+ /* 0xXX x0 x2 x4 x6 x8 xA xC xE */
+-/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
++/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, WS, OT, OT, OT, OT, OT, OT,
+ /* 1x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
+-/* 2x */ OT, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
++/* 2x */ WS, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
+ /* 3x */ DG, DG, DG, DG, DG, DG, DG, DG, DG, DG, CL, SD, OT, SD, OT, QU,
+ /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL,
+ /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US,
+--- src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100
++++ src/ne_utils.c 2011-02-03 10:26:21.000000000 +0100
+@@ -118,6 +118,9 @@
+ #ifdef HAVE_GNUTLS
+ ", GNU TLS " LIBGNUTLS_VERSION
+ #endif /* HAVE_GNUTLS */
++#ifdef HAVE_SSPI
++ ", SSPI"
++#endif /* HAVE_SSPI */
+ "."
+ ;
+
+@@ -137,7 +140,7 @@
+ switch (feature) {
+ #if defined(NE_HAVE_SSL) || defined(NE_HAVE_ZLIB) || defined(NE_HAVE_IPV6) \
+ || defined(NE_HAVE_SOCKS) || defined(NE_HAVE_LFS) \
+- || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N)
++ || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N) || defined(HAVE_SSPI)
+ #ifdef NE_HAVE_SSL
+ case NE_FEATURE_SSL:
+ #endif
+@@ -159,6 +162,9 @@
+ #ifdef NE_HAVE_I18N
+ case NE_FEATURE_I18N:
+ #endif
++#ifdef HAVE_SSPI
++ case NE_FEATURE_SSPI:
++#endif
+ return 1;
+ #endif /* NE_HAVE_* */
+ default:
+--- src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200
++++ src/ne_utils.h 2011-02-03 10:26:21.000000000 +0100
+@@ -54,6 +54,7 @@
+ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */
+ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */
+ #define NE_FEATURE_I18N (7) /* i18n error message support */
++#define NE_FEATURE_SSPI (8) /* NTLM/Negotiate authentication protocol via SSPI */
+
+ /* Returns non-zero if library is built with support for the given
+ * NE_FEATURE_* feature code 'code'. */
+--- src/ne_openssl.c
++++ src/ne_openssl.c
+@@ -41,6 +41,13 @@
+ #include <pthread.h>
+ #endif
+
++#ifdef WIN32
++#define X509_NAME WIN32_X509_NAME
++#include <windows.h>
++#include <wincrypt.h>
++#undef X509_NAME
++#endif
++
+ #include "ne_ssl.h"
+ #include "ne_string.h"
+ #include "ne_session.h"
+@@ -798,6 +798,31 @@
+ X509_STORE_load_locations(store, NE_SSL_CA_BUNDLE, NULL);
+ #else
+ X509_STORE_set_default_paths(store);
++#ifdef WIN32
++ {
++ HCERTSTORE hStore;
++ PCCERT_CONTEXT pContext = NULL;
++ X509 *x509;
++
++ hStore = CertOpenSystemStore(0, "ROOT");
++ if (hStore)
++ {
++ while (pContext = CertEnumCertificatesInStore(hStore, pContext))
++ {
++ x509 = d2i_X509(NULL, &pContext->pbCertEncoded, pContext->cbCertEncoded);
++ if (x509)
++ {
++ X509_STORE_add_cert(store, x509);
++ X509_free(x509);
++ }
++ }
++ }
++
++ CertFreeCertificateContext(pContext);
++ CertCloseStore(hStore, 0);
++ }
++#endif
++
+ #endif
+ }
+
--- /dev/null
+--- src/ne_request.c 2010-09-28 13:57:26.000000000 +0200
++++ src/ne_request.c 2011-05-18 12:39:05.134445529 +0200
+@@ -529,7 +529,7 @@
+
+ void ne_set_request_flag(ne_request *req, ne_request_flag flag, int value)
+ {
+- if (flag < NE_SESSFLAG_LAST) {
++ if (flag < NE_REQFLAG_LAST) {
+ req->flags[flag] = value;
+ }
+ }
--- /dev/null
+--- src/ne_gnutls.c 2009-12-02 23:40:41.000000000 +0200
++++ src/ne_gnutls.c 2013-03-29 13:41:00.429857276 +0200
+@@ -48,6 +48,26 @@
+ #include <iconv.h>
+ #endif
+
++
++/* GnuTLS removed these symbols from 2.99.0.
++ *
++ * This is a dodgy solution to avoid further patching of neon
++ * sources */
++#if LIBGNUTLS_VERSION_NUMBER >= 0x026300
++# define gnutls_pkcs12 gnutls_pkcs12_t
++# define gnutls_pkcs12_bag gnutls_pkcs12_bag_t
++# define gnutls_pkcs12_bag_type gnutls_pkcs12_bag_type_t
++# define gnutls_certificate_verify_peers(_ssl) ({ \
++ int __status_ ## __LINE__ = 0; \
++ gnutls_certificate_verify_peers2((_ssl), &__status_ ## __LINE__) == 0 \
++ ? __status_ ## __LINE__ : -1; \
++ })
++#elif LIBGNUTLS_VERSION_NUMBER >= 0x020303
++/* GnuTLS had these symbols since 2.3.3. */
++# define HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS
++#endif /* LIBGNUTLS_VERSION_NUMBER */
++
++
+ #include "ne_ssl.h"
+ #include "ne_string.h"
+ #include "ne_session.h"
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,np_sdk))
+
+ifneq ($(ENABLE_NPAPI_FROM_BROWSER)$(ENABLE_NPAPI_INTO_BROWSER),)
+
+ifeq ($(ENABLE_NPAPI_INTO_BROWSER),TRUE)
+$(eval $(call gb_Module_add_targets,np_sdk,\
+ StaticLibrary_nputils \
+))
+endif
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Netscape Plugin SDK. Header to build Mozilla plugins.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,nputils))
+
+$(eval $(call gb_StaticLibrary_use_externals,nputils,\
+ npapi_headers \
+))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_StaticLibrary_add_defs,nputils,\
+ -DNO_X11 \
+))
+endif
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_exception_objects,nputils,\
+ external/np_sdk/npsdk/npwin \
+))
+else
+$(eval $(call gb_StaticLibrary_add_cobjects,nputils,\
+ external/np_sdk/npsdk/npunix \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Please be apprised of the following Legal Notices:
+
+A) The U.S. District Court for the Eastern District of Virginia has
+ruled that the Netscape Navigator code does not infringe Wang's U.S.
+Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
+Videotex as defined by the '669 patent; 2) web servers are not central
+suppliers; and 3) Navigator does not "connect," as defined by the '669
+Patent, to web servers on the Internet. Wang may appeal this decision to
+the Federal Circuit. Wang contended that its Patent disclosing a
+"Videotext" system, is infringed by the following functionality in the
+Netscape Navigator code: 1) the animated logo and status line indicators
+--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
+23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
+Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
+extensions --See Claim 38
+
+B) Intermind owns pending U.S. patent applications on communications
+systems which employ metadata ("channel objects") to define a control
+structure for information transfer. The Netscape code does not infringe
+as released; however, modifications which utilize channel objects as
+described by Intermind should be considered carefully. The following is
+a statement from Intermind: "Intermind's claims fundamentally involve
+the use of a control structure to automate communications. ...The
+essence of Intermind's top claim is that two devices sender and
+receiver have persistent storage, communicate over a network,
+and exchange a control structure including metadata which describes: 1)
+what information is to be updated, 2) when to update this information,
+and 3) how to transfer the updated information. In addition, at least
+the receiving device must be able to process the metadata in order to
+perform the update determination and transfer. Any digital
+communications system which incorporates all of these elements will be
+covered by Intermind's patents." See Intermind.com.
+
+C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
+disclose data compression methods implementing an LZS compression
+algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
+Stac Patents"). The Netscape Communicator code does not perform
+compression. If you modify the Netscape source code to perform
+compression, please take notice of the Stac Patents.
+
+D) Netscape Communications Corporation ("Netscape") does not guarantee
+that any source code or executable code available from the mozilla.org
+domain is Year 2000 compliant.
--- /dev/null
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
+
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is ______________________________________.
+
+ The Initial Developer of the Original Code is ________________________.
+ Portions created by ______________________ are Copyright (C) ______
+ _______________________. All Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the terms
+ of the _____ license (the "[___] License"), in which case the
+ provisions of [______] License are applicable instead of those
+ above. If you wish to allow use of your version of this file only
+ under the terms of the [____] License and not to allow others to use
+ your version of this file under the MPL, indicate your decision by
+ deleting the provisions above and replace them with the notice and
+ other provisions required by the [___] License. If you do not delete
+ the provisions above, a recipient may use your version of this file
+ under either the MPL or the [___] License."
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
+
+ ----------------------------------------------------------------------
+
+ AMENDMENTS
+
+ The Netscape Public License Version 1.1 ("NPL") consists of the
+ Mozilla Public License Version 1.1 with the following Amendments,
+ including Exhibit A-Netscape Public License. Files identified with
+ "Exhibit A-Netscape Public License" are governed by the Netscape
+ Public License Version 1.1.
+
+ Additional Terms applicable to the Netscape Public License.
+ I. Effect.
+ These additional terms described in this Netscape Public
+ License -- Amendments shall apply to the Mozilla Communicator
+ client code and to all Covered Code under this License.
+
+ II. "Netscape's Branded Code" means Covered Code that Netscape
+ distributes and/or permits others to distribute under one or more
+ trademark(s) which are controlled by Netscape but which are not
+ licensed for use under this License.
+
+ III. Netscape and logo.
+ This License does not grant any rights to use the trademarks
+ "Netscape", the "Netscape N and horizon" logo or the "Netscape
+ lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript",
+ "Smart Browsing" even if such marks are included in the Original
+ Code or Modifications.
+
+ IV. Inability to Comply Due to Contractual Obligation.
+ Prior to licensing the Original Code under this License, Netscape
+ has licensed third party code for use in Netscape's Branded Code.
+ To the extent that Netscape is limited contractually from making
+ such third party code available under this License, Netscape may
+ choose to reintegrate such code into Covered Code without being
+ required to distribute such code in Source Code form, even if
+ such code would otherwise be considered "Modifications" under
+ this License.
+
+ V. Use of Modifications and Covered Code by Initial Developer.
+ V.1. In General.
+ The obligations of Section 3 apply to Netscape, except to
+ the extent specified in this Amendment, Section V.2 and V.3.
+
+ V.2. Other Products.
+ Netscape may include Covered Code in products other than the
+ Netscape's Branded Code which are released by Netscape
+ during the two (2) years following the release date of the
+ Original Code, without such additional products becoming
+ subject to the terms of this License, and may license such
+ additional products on different terms from those contained
+ in this License.
+
+ V.3. Alternative Licensing.
+ Netscape may license the Source Code of Netscape's Branded
+ Code, including Modifications incorporated therein, without
+ such Netscape Branded Code becoming subject to the terms of
+ this License, and may license such Netscape Branded Code on
+ different terms from those contained in this License.
+
+ VI. Litigation.
+ Notwithstanding the limitations of Section 11 above, the
+ provisions regarding litigation in Section 11(a), (b) and (c) of
+ the License shall apply to all disputes relating to this License.
+
+ EXHIBIT A-Netscape Public License.
+
+ "The contents of this file are subject to the Netscape Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/NPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is Mozilla Communicator client code, released
+ March 31, 1998.
+
+ The Initial Developer of the Original Code is Netscape
+ Communications Corporation. Portions created by Netscape are
+ Copyright (C) 1998-1999 Netscape Communications Corporation. All
+ Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the
+ terms of the _____ license (the "[___] License"), in which case
+ the provisions of [______] License are applicable instead of
+ those above. If you wish to allow use of your version of this
+ file only under the terms of the [____] License and not to allow
+ others to use your version of this file under the NPL, indicate
+ your decision by deleting the provisions above and replace them
+ with the notice and other provisions required by the [___]
+ License. If you do not delete the provisions above, a recipient
+ may use your version of this file under either the NPL or the
+ [___] License."
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef npapi_h_
+#define npapi_h_
+
+#if defined(__OS2__)
+#pragma pack(1)
+#endif
+
+#include "nptypes.h"
+
+#if defined(__OS2__) || defined(OS2)
+#ifndef XP_OS2
+#define XP_OS2 1
+#endif
+#endif
+
+#if defined(_WIN32) && !defined(__SYMBIAN32__)
+#include <windef.h>
+#ifndef XP_WIN
+#define XP_WIN 1
+#endif
+#endif
+
+#if defined(__SYMBIAN32__)
+#ifndef XP_SYMBIAN
+#define XP_SYMBIAN 1
+#undef XP_WIN
+#endif
+#endif
+
+#if defined(__APPLE_CC__) && !defined(XP_UNIX)
+#ifndef XP_MACOSX
+#define XP_MACOSX 1
+#endif
+#endif
+
+#if defined(XP_MACOSX) && defined(__LP64__)
+#define NP_NO_QUICKDRAW
+#define NP_NO_CARBON
+#endif
+
+#if defined(XP_MACOSX)
+#include <ApplicationServices/ApplicationServices.h>
+#include <OpenGL/OpenGL.h>
+#ifndef NP_NO_CARBON
+#include <Carbon/Carbon.h>
+#endif
+#endif
+
+#if defined(XP_UNIX)
+#include <stdio.h>
+#if defined(MOZ_X11)
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
+#endif
+
+#if defined(XP_SYMBIAN)
+#include <QEvent>
+#include <QRegion>
+#endif
+
+/*----------------------------------------------------------------------*/
+/* Plugin Version Constants */
+/*----------------------------------------------------------------------*/
+
+#define NP_VERSION_MAJOR 0
+#define NP_VERSION_MINOR 27
+
+
+/* The OS/2 version of Netscape uses RC_DATA to define the
+ mime types, file extensions, etc that are required.
+ Use a vertical bar to separate types, end types with \0.
+ FileVersion and ProductVersion are 32bit ints, all other
+ entries are strings that MUST be terminated with a \0.
+
+AN EXAMPLE:
+
+RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
+
+RCDATA NP_INFO_MIMEType { "video/x-video|",
+ "video/x-flick\0" }
+RCDATA NP_INFO_FileExtents { "avi|",
+ "flc\0" }
+RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
+ "MMOS2 Flc/Fli player(*.flc)\0" }
+
+RCDATA NP_INFO_FileVersion { 1,0,0,1 }
+RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
+RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
+RCDATA NP_INFO_InternalName { "NPAVI32\0" )
+RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
+RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
+RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
+*/
+/* RC_DATA types for version info - required */
+#define NP_INFO_ProductVersion 1
+#define NP_INFO_MIMEType 2
+#define NP_INFO_FileOpenName 3
+#define NP_INFO_FileExtents 4
+/* RC_DATA types for version info - used if found */
+#define NP_INFO_FileDescription 5
+#define NP_INFO_ProductName 6
+/* RC_DATA types for version info - optional */
+#define NP_INFO_CompanyName 7
+#define NP_INFO_FileVersion 8
+#define NP_INFO_InternalName 9
+#define NP_INFO_LegalCopyright 10
+#define NP_INFO_OriginalFilename 11
+
+#ifndef RC_INVOKED
+
+/*----------------------------------------------------------------------*/
+/* Definition of Basic Types */
+/*----------------------------------------------------------------------*/
+
+typedef unsigned char NPBool;
+typedef int16_t NPError;
+typedef int16_t NPReason;
+typedef char* NPMIMEType;
+
+/*----------------------------------------------------------------------*/
+/* Structures and definitions */
+/*----------------------------------------------------------------------*/
+
+#if !defined(__LP64__)
+#if defined(XP_MACOSX)
+#pragma options align=mac68k
+#endif
+#endif /* __LP64__ */
+
+/*
+ * NPP is a plug-in's opaque instance handle
+ */
+typedef struct _NPP
+{
+ void* pdata; /* plug-in private data */
+ void* ndata; /* netscape private data */
+} NPP_t;
+
+typedef NPP_t* NPP;
+
+typedef struct _NPStream
+{
+ void* pdata; /* plug-in private data */
+ void* ndata; /* netscape private data */
+ const char* url;
+ uint32_t end;
+ uint32_t lastmodified;
+ void* notifyData;
+ const char* headers; /* Response headers from host.
+ * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
+ * Used for HTTP only; NULL for non-HTTP.
+ * Available from NPP_NewStream onwards.
+ * Plugin should copy this data before storing it.
+ * Includes HTTP status line and all headers,
+ * preferably verbatim as received from server,
+ * headers formatted as in HTTP ("Header: Value"),
+ * and newlines (\n, NOT \r\n) separating lines.
+ * Terminated by \n\0 (NOT \n\n\0). */
+} NPStream;
+
+typedef struct _NPByteRange
+{
+ int32_t offset; /* negative offset means from the end */
+ uint32_t length;
+ struct _NPByteRange* next;
+} NPByteRange;
+
+typedef struct _NPSavedData
+{
+ int32_t len;
+ void* buf;
+} NPSavedData;
+
+typedef struct _NPRect
+{
+ uint16_t top;
+ uint16_t left;
+ uint16_t bottom;
+ uint16_t right;
+} NPRect;
+
+typedef struct _NPSize
+{
+ int32_t width;
+ int32_t height;
+} NPSize;
+
+typedef enum {
+ NPFocusNext = 0,
+ NPFocusPrevious = 1
+} NPFocusDirection;
+
+/* Return values for NPP_HandleEvent */
+#define kNPEventNotHandled 0
+#define kNPEventHandled 1
+/* Exact meaning must be spec'd in event model. */
+#define kNPEventStartIME 2
+
+#if defined(XP_UNIX)
+/*
+ * Unix specific structures and definitions
+ */
+
+/*
+ * Callback Structures.
+ *
+ * These are used to pass additional platform specific information.
+ */
+enum {
+ NP_SETWINDOW = 1,
+ NP_PRINT
+};
+
+typedef struct
+{
+ int32_t type;
+} NPAnyCallbackStruct;
+
+typedef struct
+{
+ int32_t type;
+#if defined(MOZ_X11)
+ Display* display;
+ Visual* visual;
+ Colormap colormap;
+ unsigned int depth;
+#endif
+} NPSetWindowCallbackStruct;
+
+typedef struct
+{
+ int32_t type;
+ FILE* fp;
+} NPPrintCallbackStruct;
+
+#endif /* XP_UNIX */
+
+#if defined(XP_MACOSX)
+typedef enum {
+#ifndef NP_NO_QUICKDRAW
+ NPDrawingModelQuickDraw = 0,
+#endif
+ NPDrawingModelCoreGraphics = 1,
+ NPDrawingModelOpenGL = 2,
+ NPDrawingModelCoreAnimation = 3,
+ NPDrawingModelInvalidatingCoreAnimation = 4
+} NPDrawingModel;
+
+typedef enum {
+#ifndef NP_NO_CARBON
+ NPEventModelCarbon = 0,
+#endif
+ NPEventModelCocoa = 1
+} NPEventModel;
+#endif
+
+/*
+ * The following masks are applied on certain platforms to NPNV and
+ * NPPV selectors that pass around pointers to COM interfaces. Newer
+ * compilers on some platforms may generate vtables that are not
+ * compatible with older compilers. To prevent older plugins from
+ * not understanding a new browser's ABI, these masks change the
+ * values of those selectors on those platforms. To remain backwards
+ * compatible with different versions of the browser, plugins can
+ * use these masks to dynamically determine and use the correct C++
+ * ABI that the browser is expecting. This does not apply to Windows
+ * as Microsoft's COM ABI will likely not change.
+ */
+
+#define NP_ABI_GCC3_MASK 0x10000000
+/*
+ * gcc 3.x generated vtables on UNIX and OSX are incompatible with
+ * previous compilers.
+ */
+#if defined(XP_UNIX) && defined(__GNUC__)
+#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
+#else
+#define _NP_ABI_MIXIN_FOR_GCC3 0
+#endif
+
+#if defined(XP_MACOSX)
+#define NP_ABI_MACHO_MASK 0x01000000
+#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
+#else
+#define _NP_ABI_MIXIN_FOR_MACHO 0
+#endif
+
+#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
+
+/*
+ * List of variable names for which NPP_GetValue shall be implemented
+ */
+typedef enum {
+ NPPVpluginNameString = 1,
+ NPPVpluginDescriptionString,
+ NPPVpluginWindowBool,
+ NPPVpluginTransparentBool,
+ NPPVjavaClass,
+ NPPVpluginWindowSize,
+ NPPVpluginTimerInterval,
+ NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
+ NPPVpluginScriptableIID = 11,
+ NPPVjavascriptPushCallerBool = 12,
+ NPPVpluginKeepLibraryInMemory = 13,
+ NPPVpluginNeedsXEmbed = 14,
+
+ /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14.
+ */
+ NPPVpluginScriptableNPObject = 15,
+
+ /* Get the plugin value (as \0-terminated UTF-8 string data) for
+ * form submission if the plugin is part of a form. Use
+ * NPN_MemAlloc() to allocate memory for the string data. Introduced
+ * in NPAPI minor version 15.
+ */
+ NPPVformValue = 16,
+
+ NPPVpluginUrlRequestsDisplayedBool = 17,
+
+ /* Checks if the plugin is interested in receiving the http body of
+ * all http requests (including failed ones, http status != 200).
+ */
+ NPPVpluginWantsAllNetworkStreams = 18,
+
+ /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
+ NPPVpluginNativeAccessibleAtkPlugId = 19,
+
+ /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
+ NPPVpluginCancelSrcStream = 20,
+
+ NPPVSupportsAdvancedKeyHandling = 21
+
+#if defined(XP_MACOSX)
+ /* Used for negotiating drawing models */
+ , NPPVpluginDrawingModel = 1000
+ /* Used for negotiating event models */
+ , NPPVpluginEventModel = 1001
+ /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
+ , NPPVpluginCoreAnimationLayer = 1003
+#endif
+
+#if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
+ , NPPVpluginWindowlessLocalBool = 2002
+#endif
+} NPPVariable;
+
+/*
+ * List of variable names for which NPN_GetValue should be implemented.
+ */
+typedef enum {
+ NPNVxDisplay = 1,
+ NPNVxtAppContext,
+ NPNVnetscapeWindow,
+ NPNVjavascriptEnabledBool,
+ NPNVasdEnabledBool,
+ NPNVisOfflineBool,
+
+ NPNVserviceManager = (10 | NP_ABI_MASK),
+ NPNVDOMElement = (11 | NP_ABI_MASK),
+ NPNVDOMWindow = (12 | NP_ABI_MASK),
+ NPNVToolkit = (13 | NP_ABI_MASK),
+ NPNVSupportsXEmbedBool = 14,
+
+ /* Get the NPObject wrapper for the browser window. */
+ NPNVWindowNPObject = 15,
+
+ /* Get the NPObject wrapper for the plugins DOM element. */
+ NPNVPluginElementNPObject = 16,
+
+ NPNVSupportsWindowless = 17,
+
+ NPNVprivateModeBool = 18,
+
+ NPNVsupportsAdvancedKeyHandling = 21
+
+#if defined(XP_MACOSX)
+ /* Used for negotiating drawing models */
+ , NPNVpluginDrawingModel = 1000
+#ifndef NP_NO_QUICKDRAW
+ , NPNVsupportsQuickDrawBool = 2000
+#endif
+ , NPNVsupportsCoreGraphicsBool = 2001
+ , NPNVsupportsOpenGLBool = 2002
+ , NPNVsupportsCoreAnimationBool = 2003
+ , NPNVsupportsInvalidatingCoreAnimationBool = 2004
+#ifndef NP_NO_CARBON
+ , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
+#endif
+ , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
+ , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
+ Cocoa text input specification. */
+#endif
+#if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
+ , NPNVSupportsWindowlessLocal = 2002
+#endif
+} NPNVariable;
+
+typedef enum {
+ NPNURLVCookie = 501,
+ NPNURLVProxy
+} NPNURLVariable;
+
+/*
+ * The type of Toolkit the widgets use
+ */
+typedef enum {
+ NPNVGtk12 = 1,
+ NPNVGtk2
+} NPNToolkitType;
+
+/*
+ * The type of a NPWindow - it specifies the type of the data structure
+ * returned in the window field.
+ */
+typedef enum {
+ NPWindowTypeWindow = 1,
+ NPWindowTypeDrawable
+} NPWindowType;
+
+typedef struct _NPWindow
+{
+ void* window; /* Platform specific window handle */
+ /* OS/2: x - Position of bottom left corner */
+ /* OS/2: y - relative to visible netscape window */
+ int32_t x; /* Position of top left corner relative */
+ int32_t y; /* to a netscape page. */
+ uint32_t width; /* Maximum window size */
+ uint32_t height;
+ NPRect clipRect; /* Clipping rectangle in port coordinates */
+#if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
+ void * ws_info; /* Platform-dependent additional data */
+#endif /* XP_UNIX */
+ NPWindowType type; /* Is this a window or a drawable? */
+} NPWindow;
+
+typedef struct _NPImageExpose
+{
+ char* data; /* image pointer */
+ int32_t stride; /* Stride of data image pointer */
+ int32_t depth; /* Depth of image pointer */
+ int32_t x; /* Expose x */
+ int32_t y; /* Expose y */
+ uint32_t width; /* Expose width */
+ uint32_t height; /* Expose height */
+ NPSize dataSize; /* Data buffer size */
+ float translateX; /* translate X matrix value */
+ float translateY; /* translate Y matrix value */
+ float scaleX; /* scale X matrix value */
+ float scaleY; /* scale Y matrix value */
+} NPImageExpose;
+
+typedef struct _NPFullPrint
+{
+ NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
+ NPBool printOne; /* TRUE if plugin should print one copy to default
+ printer */
+ void* platformPrint; /* Platform-specific printing info */
+} NPFullPrint;
+
+typedef struct _NPEmbedPrint
+{
+ NPWindow window;
+ void* platformPrint; /* Platform-specific printing info */
+} NPEmbedPrint;
+
+typedef struct _NPPrint
+{
+ uint16_t mode; /* NP_FULL or NP_EMBED */
+ union
+ {
+ NPFullPrint fullPrint; /* if mode is NP_FULL */
+ NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
+ } print;
+} NPPrint;
+
+#if defined(XP_MACOSX)
+#ifndef NP_NO_CARBON
+typedef EventRecord NPEvent;
+#endif
+#elif defined(XP_SYMBIAN)
+typedef QEvent NPEvent;
+#elif defined(XP_WIN)
+typedef struct _NPEvent
+{
+ uint16_t event;
+ uintptr_t wParam;
+ uintptr_t lParam;
+} NPEvent;
+#elif defined(XP_OS2)
+typedef struct _NPEvent
+{
+ uint32_t event;
+ uint32_t wParam;
+ uint32_t lParam;
+} NPEvent;
+#elif defined(XP_UNIX) && defined(MOZ_X11)
+typedef XEvent NPEvent;
+#else
+typedef void* NPEvent;
+#endif
+
+#if defined(XP_MACOSX)
+typedef void* NPRegion;
+#ifndef NP_NO_QUICKDRAW
+typedef RgnHandle NPQDRegion;
+#endif
+typedef CGPathRef NPCGRegion;
+#elif defined(XP_WIN)
+typedef HRGN NPRegion;
+#elif defined(XP_UNIX) && defined(MOZ_X11)
+typedef Region NPRegion;
+#elif defined(XP_SYMBIAN)
+typedef QRegion* NPRegion;
+#else
+typedef void *NPRegion;
+#endif
+
+typedef struct _NPNSString NPNSString;
+typedef struct _NPNSWindow NPNSWindow;
+typedef struct _NPNSMenu NPNSMenu;
+
+#if defined(XP_MACOSX)
+typedef NPNSMenu NPMenu;
+#else
+typedef void *NPMenu;
+#endif
+
+typedef enum {
+ NPCoordinateSpacePlugin = 1,
+ NPCoordinateSpaceWindow,
+ NPCoordinateSpaceFlippedWindow,
+ NPCoordinateSpaceScreen,
+ NPCoordinateSpaceFlippedScreen
+} NPCoordinateSpace;
+
+#if defined(XP_MACOSX)
+
+#ifndef NP_NO_QUICKDRAW
+typedef struct NP_Port
+{
+ CGrafPtr port;
+ int32_t portx; /* position inside the topmost window */
+ int32_t porty;
+} NP_Port;
+#endif /* NP_NO_QUICKDRAW */
+
+/*
+ * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
+ * as its drawing model.
+ */
+
+typedef struct NP_CGContext
+{
+ CGContextRef context;
+ void *window; /* A WindowRef under the Carbon event model. */
+} NP_CGContext;
+
+/*
+ * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
+ * drawing model.
+ */
+
+typedef struct NP_GLContext
+{
+ CGLContextObj context;
+#ifdef NP_NO_CARBON
+ NPNSWindow *window;
+#else
+ void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */
+#endif
+} NP_GLContext;
+
+typedef enum {
+ NPCocoaEventDrawRect = 1,
+ NPCocoaEventMouseDown,
+ NPCocoaEventMouseUp,
+ NPCocoaEventMouseMoved,
+ NPCocoaEventMouseEntered,
+ NPCocoaEventMouseExited,
+ NPCocoaEventMouseDragged,
+ NPCocoaEventKeyDown,
+ NPCocoaEventKeyUp,
+ NPCocoaEventFlagsChanged,
+ NPCocoaEventFocusChanged,
+ NPCocoaEventWindowFocusChanged,
+ NPCocoaEventScrollWheel,
+ NPCocoaEventTextInput
+} NPCocoaEventType;
+
+typedef struct _NPCocoaEvent {
+ NPCocoaEventType type;
+ uint32_t version;
+ union {
+ struct {
+ uint32_t modifierFlags;
+ double pluginX;
+ double pluginY;
+ int32_t buttonNumber;
+ int32_t clickCount;
+ double deltaX;
+ double deltaY;
+ double deltaZ;
+ } mouse;
+ struct {
+ uint32_t modifierFlags;
+ NPNSString *characters;
+ NPNSString *charactersIgnoringModifiers;
+ NPBool isARepeat;
+ uint16_t keyCode;
+ } key;
+ struct {
+ CGContextRef context;
+ double x;
+ double y;
+ double width;
+ double height;
+ } draw;
+ struct {
+ NPBool hasFocus;
+ } focus;
+ struct {
+ NPNSString *text;
+ } text;
+ } data;
+} NPCocoaEvent;
+
+#ifndef NP_NO_CARBON
+/* Non-standard event types that can be passed to HandleEvent */
+enum NPEventType {
+ NPEventType_GetFocusEvent = (osEvt + 16),
+ NPEventType_LoseFocusEvent,
+ NPEventType_AdjustCursorEvent,
+ NPEventType_MenuCommandEvent,
+ NPEventType_ClippingChangedEvent,
+ NPEventType_ScrollingBeginsEvent = 1000,
+ NPEventType_ScrollingEndsEvent
+};
+#endif /* NP_NO_CARBON */
+
+#endif /* XP_MACOSX */
+
+/*
+ * Values for mode passed to NPP_New:
+ */
+#define NP_EMBED 1
+#define NP_FULL 2
+
+/*
+ * Values for stream type passed to NPP_NewStream:
+ */
+#define NP_NORMAL 1
+#define NP_SEEK 2
+#define NP_ASFILE 3
+#define NP_ASFILEONLY 4
+
+#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
+
+/*
+ * Flags for NPP_ClearSiteData.
+ */
+#define NP_CLEAR_ALL 0
+#define NP_CLEAR_CACHE (1 << 0)
+
+#if !defined(__LP64__)
+#if defined(XP_MACOSX)
+#pragma options align=reset
+#endif
+#endif /* __LP64__ */
+
+/*----------------------------------------------------------------------*/
+/* Error and Reason Code definitions */
+/*----------------------------------------------------------------------*/
+
+/*
+ * Values of type NPError:
+ */
+#define NPERR_BASE 0
+#define NPERR_NO_ERROR (NPERR_BASE + 0)
+#define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
+#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
+#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
+#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
+#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
+#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
+#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
+#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
+#define NPERR_INVALID_PARAM (NPERR_BASE + 9)
+#define NPERR_INVALID_URL (NPERR_BASE + 10)
+#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
+#define NPERR_NO_DATA (NPERR_BASE + 12)
+#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
+#define NPERR_TIME_RANGE_NOT_SUPPORTED (NPERR_BASE + 14)
+#define NPERR_MALFORMED_SITE (NPERR_BASE + 15)
+
+/*
+ * Values of type NPReason:
+ */
+#define NPRES_BASE 0
+#define NPRES_DONE (NPRES_BASE + 0)
+#define NPRES_NETWORK_ERR (NPRES_BASE + 1)
+#define NPRES_USER_BREAK (NPRES_BASE + 2)
+
+/*
+ * Version feature information
+ */
+#define NPVERS_HAS_STREAMOUTPUT 8
+#define NPVERS_HAS_NOTIFICATION 9
+#define NPVERS_HAS_LIVECONNECT 9
+#define NPVERS_68K_HAS_LIVECONNECT 11
+#define NPVERS_HAS_WINDOWLESS 11
+#define NPVERS_HAS_XPCONNECT_SCRIPTING 13
+#define NPVERS_HAS_NPRUNTIME_SCRIPTING 14
+#define NPVERS_HAS_FORM_VALUES 15
+#define NPVERS_HAS_POPUPS_ENABLED_STATE 16
+#define NPVERS_HAS_RESPONSE_HEADERS 17
+#define NPVERS_HAS_NPOBJECT_ENUM 18
+#define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
+#define NPVERS_HAS_ALL_NETWORK_STREAMS 20
+#define NPVERS_HAS_URL_AND_AUTH_INFO 21
+#define NPVERS_HAS_PRIVATE_MODE 22
+#define NPVERS_MACOSX_HAS_COCOA_EVENTS 23
+#define NPVERS_HAS_ADVANCED_KEY_HANDLING 25
+#define NPVERS_HAS_URL_REDIRECT_HANDLING 26
+#define NPVERS_HAS_CLEAR_SITE_DATA 27
+
+/*----------------------------------------------------------------------*/
+/* Function Prototypes */
+/*----------------------------------------------------------------------*/
+
+#if defined(__OS2__)
+#define NP_LOADDS _System
+#else
+#define NP_LOADDS
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* NPP_* functions are provided by the plugin and called by the navigator. */
+
+const char* NPP_GetMIMEDescription(void);
+NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
+ uint16_t mode, int16_t argc, char* argn[],
+ char* argv[], NPSavedData* saved);
+NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
+NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
+NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
+ NPStream* stream, NPBool seekable,
+ uint16_t* stype);
+NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
+ NPReason reason);
+int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
+int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
+ int32_t len, void* buffer);
+void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
+ const char* fname);
+void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
+int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
+void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
+ NPReason reason, void* notifyData);
+NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
+NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
+NPBool NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction);
+void NP_LOADDS NPP_LostFocus(NPP instance);
+void NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData);
+NPError NP_LOADDS NPP_ClearSiteData(const char* site, uint64_t flags, uint64_t maxAge);
+char** NP_LOADDS NPP_GetSitesWithData(void);
+
+/* NPN_* functions are provided by the navigator and called by the plugin. */
+void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
+ int* netscape_major, int* netscape_minor);
+NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
+ const char* target, void* notifyData);
+NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
+ const char* target);
+NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
+ const char* target, uint32_t len,
+ const char* buf, NPBool file,
+ void* notifyData);
+NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
+ const char* target, uint32_t len,
+ const char* buf, NPBool file);
+NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
+NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
+ const char* target, NPStream** stream);
+int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,
+ void* buffer);
+NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream,
+ NPReason reason);
+void NP_LOADDS NPN_Status(NPP instance, const char* message);
+const char* NP_LOADDS NPN_UserAgent(NPP instance);
+void* NP_LOADDS NPN_MemAlloc(uint32_t size);
+void NP_LOADDS NPN_MemFree(void* ptr);
+uint32_t NP_LOADDS NPN_MemFlush(uint32_t size);
+void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
+NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable,
+ void *value);
+NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable,
+ void *value);
+void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
+void NP_LOADDS NPN_InvalidateRegion(NPP instance,
+ NPRegion invalidRegion);
+void NP_LOADDS NPN_ForceRedraw(NPP instance);
+void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
+void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
+void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,
+ void (*func) (void *),
+ void *userData);
+NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
+ const char *url, char **value,
+ uint32_t *len);
+NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
+ const char *url, const char *value,
+ uint32_t len);
+NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance,
+ const char *protocol,
+ const char *host, int32_t port,
+ const char *scheme,
+ const char *realm,
+ char **username, uint32_t *ulen,
+ char **password,
+ uint32_t *plen);
+uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
+void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
+NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
+NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
+NPBool NP_LOADDS NPN_HandleEvent(NPP instance, void *event, NPBool handled);
+NPBool NP_LOADDS NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
+void NP_LOADDS NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+#endif /* RC_INVOKED */
+#if defined(__OS2__)
+#pragma pack()
+#endif
+
+#endif /* npapi_h_ */
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef npfunctions_h_
+#define npfunctions_h_
+
+#ifdef __OS2__
+#pragma pack(1)
+#define NP_LOADDS _System
+#else
+#define NP_LOADDS
+#endif
+
+#include "npapi.h"
+#include "npruntime.h"
+
+typedef NPError (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
+typedef NPError (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
+typedef NPError (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
+typedef NPError (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
+typedef NPError (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
+typedef int32_t (* NP_LOADDS NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
+typedef int32_t (* NP_LOADDS NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
+typedef void (* NP_LOADDS NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
+typedef void (* NP_LOADDS NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
+typedef int16_t (* NP_LOADDS NPP_HandleEventProcPtr)(NPP instance, void* event);
+typedef void (* NP_LOADDS NPP_URLNotifyProcPtr)(NPP instance, const char* url, NPReason reason, void* notifyData);
+/* Any NPObjects returned to the browser via NPP_GetValue should be retained
+ by the plugin on the way out. The browser is responsible for releasing. */
+typedef NPError (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
+typedef NPError (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
+typedef NPBool (* NP_LOADDS NPP_GotFocusPtr)(NPP instance, NPFocusDirection direction);
+typedef void (* NP_LOADDS NPP_LostFocusPtr)(NPP instance);
+typedef void (* NP_LOADDS NPP_URLRedirectNotifyPtr)(NPP instance, const char* url, int32_t status, void* notifyData);
+typedef NPError (* NP_LOADDS NPP_ClearSiteDataPtr)(const char* site, uint64_t flags, uint64_t maxAge);
+typedef char** (* NP_LOADDS NPP_GetSitesWithDataPtr)(void);
+
+typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
+typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
+typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* url, const char* window, void* notifyData);
+typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData);
+typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* url, const char* window);
+typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file);
+typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
+typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
+typedef int32_t (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32_t len, void* buffer);
+typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
+typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message);
+/* Browser manages the lifetime of the buffer returned by NPN_UserAgent, don't
+ depend on it sticking around and don't free it. */
+typedef const char* (*NPN_UserAgentProcPtr)(NPP instance);
+typedef void* (*NPN_MemAllocProcPtr)(uint32_t size);
+typedef void (*NPN_MemFreeProcPtr)(void* ptr);
+typedef uint32_t (*NPN_MemFlushProcPtr)(uint32_t size);
+typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
+typedef void* (*NPN_GetJavaEnvProcPtr)(void);
+typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance);
+typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
+typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
+typedef void (*NPN_ForceRedrawProcPtr)(NPP instance);
+typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr)(const NPUTF8* name);
+typedef void (*NPN_GetStringIdentifiersProcPtr)(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers);
+typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr)(int32_t intid);
+typedef bool (*NPN_IdentifierIsStringProcPtr)(NPIdentifier identifier);
+typedef NPUTF8* (*NPN_UTF8FromIdentifierProcPtr)(NPIdentifier identifier);
+typedef int32_t (*NPN_IntFromIdentifierProcPtr)(NPIdentifier identifier);
+typedef NPObject* (*NPN_CreateObjectProcPtr)(NPP npp, NPClass *aClass);
+typedef NPObject* (*NPN_RetainObjectProcPtr)(NPObject *obj);
+typedef void (*NPN_ReleaseObjectProcPtr)(NPObject *obj);
+typedef bool (*NPN_InvokeProcPtr)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result);
+typedef bool (*NPN_InvokeDefaultProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
+typedef bool (*NPN_EvaluateProcPtr)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
+typedef bool (*NPN_GetPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
+typedef bool (*NPN_SetPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
+typedef bool (*NPN_RemovePropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
+typedef bool (*NPN_HasPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
+typedef bool (*NPN_HasMethodProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
+typedef void (*NPN_ReleaseVariantValueProcPtr)(NPVariant *variant);
+typedef void (*NPN_SetExceptionProcPtr)(NPObject *obj, const NPUTF8 *message);
+typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP npp, NPBool enabled);
+typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP npp);
+typedef bool (*NPN_EnumerateProcPtr)(NPP npp, NPObject *obj, NPIdentifier **identifier, uint32_t *count);
+typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance, void (*func)(void *), void *userData);
+typedef bool (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
+typedef NPError (*NPN_GetValueForURLPtr)(NPP npp, NPNURLVariable variable, const char *url, char **value, uint32_t *len);
+typedef NPError (*NPN_SetValueForURLPtr)(NPP npp, NPNURLVariable variable, const char *url, const char *value, uint32_t len);
+typedef NPError (*NPN_GetAuthenticationInfoPtr)(NPP npp, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen);
+typedef uint32_t (*NPN_ScheduleTimerPtr)(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
+typedef void (*NPN_UnscheduleTimerPtr)(NPP instance, uint32_t timerID);
+typedef NPError (*NPN_PopUpContextMenuPtr)(NPP instance, NPMenu* menu);
+typedef NPBool (*NPN_ConvertPointPtr)(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
+typedef NPBool (*NPN_HandleEventPtr)(NPP instance, void *event, NPBool handled);
+typedef NPBool (*NPN_UnfocusInstancePtr)(NPP instance, NPFocusDirection direction);
+typedef void (*NPN_URLRedirectResponsePtr)(NPP instance, void* notifyData, NPBool allow);
+
+typedef struct _NPPluginFuncs {
+ uint16_t size;
+ uint16_t version;
+ NPP_NewProcPtr newp;
+ NPP_DestroyProcPtr destroy;
+ NPP_SetWindowProcPtr setwindow;
+ NPP_NewStreamProcPtr newstream;
+ NPP_DestroyStreamProcPtr destroystream;
+ NPP_StreamAsFileProcPtr asfile;
+ NPP_WriteReadyProcPtr writeready;
+ NPP_WriteProcPtr write;
+ NPP_PrintProcPtr print;
+ NPP_HandleEventProcPtr event;
+ NPP_URLNotifyProcPtr urlnotify;
+ void* javaClass;
+ NPP_GetValueProcPtr getvalue;
+ NPP_SetValueProcPtr setvalue;
+ NPP_GotFocusPtr gotfocus;
+ NPP_LostFocusPtr lostfocus;
+ NPP_URLRedirectNotifyPtr urlredirectnotify;
+ NPP_ClearSiteDataPtr clearsitedata;
+ NPP_GetSitesWithDataPtr getsiteswithdata;
+} NPPluginFuncs;
+
+typedef struct _NPNetscapeFuncs {
+ uint16_t size;
+ uint16_t version;
+ NPN_GetURLProcPtr geturl;
+ NPN_PostURLProcPtr posturl;
+ NPN_RequestReadProcPtr requestread;
+ NPN_NewStreamProcPtr newstream;
+ NPN_WriteProcPtr write;
+ NPN_DestroyStreamProcPtr destroystream;
+ NPN_StatusProcPtr status;
+ NPN_UserAgentProcPtr uagent;
+ NPN_MemAllocProcPtr memalloc;
+ NPN_MemFreeProcPtr memfree;
+ NPN_MemFlushProcPtr memflush;
+ NPN_ReloadPluginsProcPtr reloadplugins;
+ NPN_GetJavaEnvProcPtr getJavaEnv;
+ NPN_GetJavaPeerProcPtr getJavaPeer;
+ NPN_GetURLNotifyProcPtr geturlnotify;
+ NPN_PostURLNotifyProcPtr posturlnotify;
+ NPN_GetValueProcPtr getvalue;
+ NPN_SetValueProcPtr setvalue;
+ NPN_InvalidateRectProcPtr invalidaterect;
+ NPN_InvalidateRegionProcPtr invalidateregion;
+ NPN_ForceRedrawProcPtr forceredraw;
+ NPN_GetStringIdentifierProcPtr getstringidentifier;
+ NPN_GetStringIdentifiersProcPtr getstringidentifiers;
+ NPN_GetIntIdentifierProcPtr getintidentifier;
+ NPN_IdentifierIsStringProcPtr identifierisstring;
+ NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
+ NPN_IntFromIdentifierProcPtr intfromidentifier;
+ NPN_CreateObjectProcPtr createobject;
+ NPN_RetainObjectProcPtr retainobject;
+ NPN_ReleaseObjectProcPtr releaseobject;
+ NPN_InvokeProcPtr invoke;
+ NPN_InvokeDefaultProcPtr invokeDefault;
+ NPN_EvaluateProcPtr evaluate;
+ NPN_GetPropertyProcPtr getproperty;
+ NPN_SetPropertyProcPtr setproperty;
+ NPN_RemovePropertyProcPtr removeproperty;
+ NPN_HasPropertyProcPtr hasproperty;
+ NPN_HasMethodProcPtr hasmethod;
+ NPN_ReleaseVariantValueProcPtr releasevariantvalue;
+ NPN_SetExceptionProcPtr setexception;
+ NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
+ NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
+ NPN_EnumerateProcPtr enumerate;
+ NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
+ NPN_ConstructProcPtr construct;
+ NPN_GetValueForURLPtr getvalueforurl;
+ NPN_SetValueForURLPtr setvalueforurl;
+ NPN_GetAuthenticationInfoPtr getauthenticationinfo;
+ NPN_ScheduleTimerPtr scheduletimer;
+ NPN_UnscheduleTimerPtr unscheduletimer;
+ NPN_PopUpContextMenuPtr popupcontextmenu;
+ NPN_ConvertPointPtr convertpoint;
+ NPN_HandleEventPtr handleevent;
+ NPN_UnfocusInstancePtr unfocusinstance;
+ NPN_URLRedirectResponsePtr urlredirectresponse;
+} NPNetscapeFuncs;
+
+#ifdef XP_MACOSX
+/*
+ * Mac OS X version(s) of NP_GetMIMEDescription(const char *)
+ * These can be called to retrieve MIME information from the plugin dynamically
+ *
+ * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
+ * to get mime info from the plugin only on OSX and may not be supported
+ * in future version -- use NP_GetMIMEDescription instead
+ */
+enum
+{
+ kBPSupportedMIMETypesStructVers_1 = 1
+};
+typedef struct _BPSupportedMIMETypes
+{
+ SInt32 structVersion; /* struct version */
+ Handle typeStrings; /* STR# formated handle, allocated by plug-in */
+ Handle infoStrings; /* STR# formated handle, allocated by plug-in */
+} BPSupportedMIMETypes;
+OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
+#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
+typedef const char* (*NP_GetMIMEDescriptionProcPtr)(void);
+typedef OSErr (*BP_GetSupportedMIMETypesProcPtr)(BPSupportedMIMETypes*, UInt32);
+#endif
+
+#if defined(_WIN32)
+#define OSCALL WINAPI
+#else
+#if defined(__OS2__)
+#define OSCALL _System
+#else
+#define OSCALL
+#endif
+#endif
+
+#if defined(XP_UNIX)
+#if defined(__GNUC__)
+#define NP_VISIBILITY_DEFAULT __attribute__((visibility("default")))
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+#define NP_VISIBILITY_DEFAULT __global
+#else
+#define NP_VISIBILITY_DEFAULT
+#endif
+#define NP_EXPORT(__type) NP_VISIBILITY_DEFAULT __type
+#endif
+
+#if defined(_WIN32) || defined (__OS2__)
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* plugin meta member functions */
+#if defined(__OS2__)
+typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */
+ char *pMimeTypes;
+ char *pFileExtents;
+ char *pFileOpenTemplate;
+ char *pProductName;
+ char *pProductDescription;
+ unsigned long dwProductVersionMS;
+ unsigned long dwProductVersionLS;
+} NPPluginData;
+typedef NPError (*NP_GetPluginDataFunc)(NPPluginData*);
+NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
+#endif
+typedef NPError (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*);
+NPError OSCALL NP_Initialize(NPNetscapeFuncs* bFuncs);
+typedef NPError (*NP_ShutdownFunc)(void);
+NPError OSCALL NP_Shutdown(void);
+typedef char* (*NP_GetMIMEDescriptionFunc)(void);
+char* NP_GetMIMEDescription(void);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#if defined(__OS2__)
+#pragma pack()
+#endif
+
+#ifdef XP_UNIX
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef char* (*NP_GetPluginVersionFunc)(void);
+NP_EXPORT(char*) NP_GetPluginVersion(void);
+typedef char* (*NP_GetMIMEDescriptionFunc)(void);
+NP_EXPORT(char*) NP_GetMIMEDescription(void);
+#ifdef XP_MACOSX
+typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*);
+NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
+typedef NPError (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+NP_EXPORT(NPError) NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+#else
+typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
+NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
+#endif
+typedef NPError (*NP_ShutdownFunc)(void);
+NP_EXPORT(NPError) NP_Shutdown(void);
+typedef NPError (*NP_GetValueFunc)(void *, NPPVariable, void *);
+NP_EXPORT(NPError) NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif /* npfunctions_h_ */
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
+ * Foundation ("Mozilla") nor the names of their contributors may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR
+ * THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#ifndef _NP_RUNTIME_H_
+#define _NP_RUNTIME_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "nptypes.h"
+
+/*
+ This API is used to facilitate binding code written in C to script
+ objects. The API in this header does not assume the presence of a
+ user agent. That is, it can be used to bind C code to scripting
+ environments outside of the context of a user agent.
+
+ However, the normal use of the this API is in the context of a
+ scripting environment running in a browser or other user agent.
+ In particular it is used to support the extended Netscape
+ script-ability API for plugins (NP-SAP). NP-SAP is an extension
+ of the Netscape plugin API. As such we have adopted the use of
+ the "NP" prefix for this API.
+
+ The following NP{N|P}Variables were added to the Netscape plugin
+ API (in npapi.h):
+
+ NPNVWindowNPObject
+ NPNVPluginElementNPObject
+ NPPVpluginScriptableNPObject
+
+ These variables are exposed through NPN_GetValue() and
+ NPP_GetValue() (respectively) and are used to establish the
+ initial binding between the user agent and native code. The DOM
+ objects in the user agent can be examined and manipulated using
+ the NPN_ functions that operate on NPObjects described in this
+ header.
+
+ To the extent possible the assumptions about the scripting
+ language used by the scripting environment have been minimized.
+*/
+
+#define NP_BEGIN_MACRO do {
+#define NP_END_MACRO } while (0)
+
+/*
+ Objects (non-primitive data) passed between 'C' and script is
+ always wrapped in an NPObject. The 'interface' of an NPObject is
+ described by an NPClass.
+*/
+typedef struct NPObject NPObject;
+typedef struct NPClass NPClass;
+
+typedef char NPUTF8;
+typedef struct _NPString {
+ const NPUTF8 *UTF8Characters;
+ uint32_t UTF8Length;
+} NPString;
+
+typedef enum {
+ NPVariantType_Void,
+ NPVariantType_Null,
+ NPVariantType_Bool,
+ NPVariantType_Int32,
+ NPVariantType_Double,
+ NPVariantType_String,
+ NPVariantType_Object
+} NPVariantType;
+
+typedef struct _NPVariant {
+ NPVariantType type;
+ union {
+ bool boolValue;
+ int32_t intValue;
+ double doubleValue;
+ NPString stringValue;
+ NPObject *objectValue;
+ } value;
+} NPVariant;
+
+/*
+ NPN_ReleaseVariantValue is called on all 'out' parameters
+ references. Specifically it is to be called on variants that own
+ their value, as is the case with all non-const NPVariant*
+ arguments after a successful call to any methods (except this one)
+ in this API.
+
+ After calling NPN_ReleaseVariantValue, the type of the variant
+ will be NPVariantType_Void.
+*/
+void NPN_ReleaseVariantValue(NPVariant *variant);
+
+#define NPVARIANT_IS_VOID(_v) ((_v).type == NPVariantType_Void)
+#define NPVARIANT_IS_NULL(_v) ((_v).type == NPVariantType_Null)
+#define NPVARIANT_IS_BOOLEAN(_v) ((_v).type == NPVariantType_Bool)
+#define NPVARIANT_IS_INT32(_v) ((_v).type == NPVariantType_Int32)
+#define NPVARIANT_IS_DOUBLE(_v) ((_v).type == NPVariantType_Double)
+#define NPVARIANT_IS_STRING(_v) ((_v).type == NPVariantType_String)
+#define NPVARIANT_IS_OBJECT(_v) ((_v).type == NPVariantType_Object)
+
+#define NPVARIANT_TO_BOOLEAN(_v) ((_v).value.boolValue)
+#define NPVARIANT_TO_INT32(_v) ((_v).value.intValue)
+#define NPVARIANT_TO_DOUBLE(_v) ((_v).value.doubleValue)
+#define NPVARIANT_TO_STRING(_v) ((_v).value.stringValue)
+#define NPVARIANT_TO_OBJECT(_v) ((_v).value.objectValue)
+
+#define VOID_TO_NPVARIANT(_v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_Void; \
+ (_v).value.objectValue = NULL; \
+NP_END_MACRO
+
+#define NULL_TO_NPVARIANT(_v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_Null; \
+ (_v).value.objectValue = NULL; \
+NP_END_MACRO
+
+#define BOOLEAN_TO_NPVARIANT(_val, _v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_Bool; \
+ (_v).value.boolValue = !!(_val); \
+NP_END_MACRO
+
+#define INT32_TO_NPVARIANT(_val, _v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_Int32; \
+ (_v).value.intValue = _val; \
+NP_END_MACRO
+
+#define DOUBLE_TO_NPVARIANT(_val, _v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_Double; \
+ (_v).value.doubleValue = _val; \
+NP_END_MACRO
+
+#define STRINGZ_TO_NPVARIANT(_val, _v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_String; \
+ NPString str = { _val, (uint32_t)(strlen(_val)) }; \
+ (_v).value.stringValue = str; \
+NP_END_MACRO
+
+#define STRINGN_TO_NPVARIANT(_val, _len, _v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_String; \
+ NPString str = { _val, (uint32_t)(_len) }; \
+ (_v).value.stringValue = str; \
+NP_END_MACRO
+
+#define OBJECT_TO_NPVARIANT(_val, _v) \
+NP_BEGIN_MACRO \
+ (_v).type = NPVariantType_Object; \
+ (_v).value.objectValue = _val; \
+NP_END_MACRO
+
+
+/*
+ Type mappings (JavaScript types have been used for illustration
+ purposes):
+
+ JavaScript to C (NPVariant with type:)
+ undefined NPVariantType_Void
+ null NPVariantType_Null
+ Boolean NPVariantType_Bool
+ Number NPVariantType_Double or NPVariantType_Int32
+ String NPVariantType_String
+ Object NPVariantType_Object
+
+ C (NPVariant with type:) to JavaScript
+ NPVariantType_Void undefined
+ NPVariantType_Null null
+ NPVariantType_Bool Boolean
+ NPVariantType_Int32 Number
+ NPVariantType_Double Number
+ NPVariantType_String String
+ NPVariantType_Object Object
+*/
+
+typedef void *NPIdentifier;
+
+/*
+ NPObjects have methods and properties. Methods and properties are
+ identified with NPIdentifiers. These identifiers may be reflected
+ in script. NPIdentifiers can be either strings or integers, IOW,
+ methods and properties can be identified by either strings or
+ integers (i.e. foo["bar"] vs foo[1]). NPIdentifiers can be
+ compared using ==. In case of any errors, the requested
+ NPIdentifier(s) will be NULL. NPIdentifier lifetime is controlled
+ by the browser. Plugins do not need to worry about memory management
+ with regards to NPIdentifiers.
+*/
+NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name);
+void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
+ NPIdentifier *identifiers);
+NPIdentifier NPN_GetIntIdentifier(int32_t intid);
+bool NPN_IdentifierIsString(NPIdentifier identifier);
+
+/*
+ The NPUTF8 returned from NPN_UTF8FromIdentifier SHOULD be freed.
+*/
+NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier);
+
+/*
+ Get the integer represented by identifier. If identifier is not an
+ integer identifier, the behaviour is undefined.
+*/
+int32_t NPN_IntFromIdentifier(NPIdentifier identifier);
+
+/*
+ NPObject behavior is implemented using the following set of
+ callback functions.
+
+ The NPVariant *result argument of these functions (where
+ applicable) should be released using NPN_ReleaseVariantValue().
+*/
+typedef NPObject *(*NPAllocateFunctionPtr)(NPP npp, NPClass *aClass);
+typedef void (*NPDeallocateFunctionPtr)(NPObject *npobj);
+typedef void (*NPInvalidateFunctionPtr)(NPObject *npobj);
+typedef bool (*NPHasMethodFunctionPtr)(NPObject *npobj, NPIdentifier name);
+typedef bool (*NPInvokeFunctionPtr)(NPObject *npobj, NPIdentifier name,
+ const NPVariant *args, uint32_t argCount,
+ NPVariant *result);
+typedef bool (*NPInvokeDefaultFunctionPtr)(NPObject *npobj,
+ const NPVariant *args,
+ uint32_t argCount,
+ NPVariant *result);
+typedef bool (*NPHasPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name);
+typedef bool (*NPGetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name,
+ NPVariant *result);
+typedef bool (*NPSetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name,
+ const NPVariant *value);
+typedef bool (*NPRemovePropertyFunctionPtr)(NPObject *npobj,
+ NPIdentifier name);
+typedef bool (*NPEnumerationFunctionPtr)(NPObject *npobj, NPIdentifier **value,
+ uint32_t *count);
+typedef bool (*NPConstructFunctionPtr)(NPObject *npobj,
+ const NPVariant *args,
+ uint32_t argCount,
+ NPVariant *result);
+
+/*
+ NPObjects returned by create, retain, invoke, and getProperty pass
+ a reference count to the caller. That is, the callee adds a
+ reference count which passes to the caller. It is the caller's
+ responsibility to release the returned object.
+
+ NPInvokeFunctionPtr function may return 0 to indicate a void
+ result.
+
+ NPInvalidateFunctionPtr is called by the scripting environment
+ when the native code is shutdown. Any attempt to message a
+ NPObject instance after the invalidate callback has been
+ called will result in undefined behavior, even if the native code
+ is still retaining those NPObject instances. (The runtime
+ will typically return immediately, with 0 or NULL, from an attempt
+ to dispatch to a NPObject, but this behavior should not be
+ depended upon.)
+
+ The NPEnumerationFunctionPtr function may pass an array of
+ NPIdentifiers back to the caller. The callee allocs the memory of
+ the array using NPN_MemAlloc(), and it's the caller's responsibility
+ to release it using NPN_MemFree().
+*/
+struct NPClass
+{
+ uint32_t structVersion;
+ NPAllocateFunctionPtr allocate;
+ NPDeallocateFunctionPtr deallocate;
+ NPInvalidateFunctionPtr invalidate;
+ NPHasMethodFunctionPtr hasMethod;
+ NPInvokeFunctionPtr invoke;
+ NPInvokeDefaultFunctionPtr invokeDefault;
+ NPHasPropertyFunctionPtr hasProperty;
+ NPGetPropertyFunctionPtr getProperty;
+ NPSetPropertyFunctionPtr setProperty;
+ NPRemovePropertyFunctionPtr removeProperty;
+ NPEnumerationFunctionPtr enumerate;
+ NPConstructFunctionPtr construct;
+};
+
+#define NP_CLASS_STRUCT_VERSION 3
+
+#define NP_CLASS_STRUCT_VERSION_ENUM 2
+#define NP_CLASS_STRUCT_VERSION_CTOR 3
+
+#define NP_CLASS_STRUCT_VERSION_HAS_ENUM(npclass) \
+ ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM)
+
+#define NP_CLASS_STRUCT_VERSION_HAS_CTOR(npclass) \
+ ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR)
+
+struct NPObject {
+ NPClass *_class;
+ uint32_t referenceCount;
+ /*
+ * Additional space may be allocated here by types of NPObjects
+ */
+};
+
+/*
+ If the class has an allocate function, NPN_CreateObject invokes
+ that function, otherwise a NPObject is allocated and
+ returned. This method will initialize the referenceCount member of
+ the NPObject to 1.
+*/
+NPObject *NPN_CreateObject(NPP npp, NPClass *aClass);
+
+/*
+ Increment the NPObject's reference count.
+*/
+NPObject *NPN_RetainObject(NPObject *npobj);
+
+/*
+ Decremented the NPObject's reference count. If the reference
+ count goes to zero, the class's destroy function is invoke if
+ specified, otherwise the object is freed directly.
+*/
+void NPN_ReleaseObject(NPObject *npobj);
+
+/*
+ Functions to access script objects represented by NPObject.
+
+ Calls to script objects are synchronous. If a function returns a
+ value, it will be supplied via the result NPVariant
+ argument. Successful calls will return true, false will be
+ returned in case of an error.
+
+ Calls made from plugin code to script must be made from the thread
+ on which the plugin was initialized.
+*/
+
+bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName,
+ const NPVariant *args, uint32_t argCount, NPVariant *result);
+bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
+ uint32_t argCount, NPVariant *result);
+bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
+ NPVariant *result);
+bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
+ NPVariant *result);
+bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
+ const NPVariant *value);
+bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
+bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
+bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName);
+bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier,
+ uint32_t *count);
+bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args,
+ uint32_t argCount, NPVariant *result);
+
+/*
+ NPN_SetException may be called to trigger a script exception upon
+ return from entry points into NPObjects. Typical usage:
+
+ NPN_SetException (npobj, message);
+*/
+void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * mozilla.org.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Johnny Stenback <jst@mozilla.org> (Original author)
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef nptypes_h_
+#define nptypes_h_
+
+/*
+ * Header file for ensuring that C99 types ([u]int32_t, [u]int64_t and bool) and
+ * true/false macros are available.
+ */
+
+#if defined(WIN32) || defined(OS2)
+ /*
+ * Win32 and OS/2 don't know C99, so define [u]int_16/32/64 here. The bool
+ * is predefined tho, both in C and C++.
+ */
+ typedef short int16_t;
+ typedef unsigned short uint16_t;
+ typedef int int32_t;
+ typedef unsigned int uint32_t;
+ typedef long long int64_t;
+ typedef unsigned long long uint64_t;
+#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
+ /*
+ * AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
+ * but not bool for C.
+ */
+ #include <inttypes.h>
+
+ #ifndef __cplusplus
+ typedef int bool;
+ #define true 1
+ #define false 0
+ #endif
+#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
+ /*
+ * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
+ * u_int32_t.
+ */
+ #include <sys/types.h>
+
+ /*
+ * BSD/OS ships no header that defines uint32_t, nor bool (for C)
+ */
+ #if defined(bsdi)
+ typedef u_int32_t uint32_t;
+ typedef u_int64_t uint64_t;
+
+ #if !defined(__cplusplus)
+ typedef int bool;
+ #define true 1
+ #define false 0
+ #endif
+ #else
+ /*
+ * FreeBSD and OpenBSD define uint32_t and bool.
+ */
+ #include <inttypes.h>
+ #include <stdbool.h>
+ #endif
+#elif defined(BEOS)
+ #include <inttypes.h>
+#else
+ /*
+ * For those that ship a standard C99 stdint.h header file, include
+ * it. Can't do the same for stdbool.h tho, since some systems ship
+ * with a stdbool.h file that doesn't compile!
+ */
+ #include <stdint.h>
+
+ #ifndef __cplusplus
+ #include <stdbool.h>
+ #endif
+#endif
+
+#endif /* nptypes_h_ */
--- /dev/null
+Please be apprised of the following Legal Notices:
+
+A) The U.S. District Court for the Eastern District of Virginia has
+ruled that the Netscape Navigator code does not infringe Wang's U.S.
+Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
+Videotex as defined by the '669 patent; 2) web servers are not central
+suppliers; and 3) Navigator does not "connect," as defined by the '669
+Patent, to web servers on the Internet. Wang may appeal this decision to
+the Federal Circuit. Wang contended that its Patent disclosing a
+"Videotext" system, is infringed by the following functionality in the
+Netscape Navigator code: 1) the animated logo and status line indicators
+--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
+23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
+Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
+extensions --See Claim 38
+
+B) Intermind owns pending U.S. patent applications on communications
+systems which employ metadata ("channel objects") to define a control
+structure for information transfer. The Netscape code does not infringe
+as released; however, modifications which utilize channel objects as
+described by Intermind should be considered carefully. The following is
+a statement from Intermind: "Intermind's claims fundamentally involve
+the use of a control structure to automate communications. ...The
+essence of Intermind's top claim is that two devices sender and
+receiver have persistent storage, communicate over a network,
+and exchange a control structure including metadata which describes: 1)
+what information is to be updated, 2) when to update this information,
+and 3) how to transfer the updated information. In addition, at least
+the receiving device must be able to process the metadata in order to
+perform the update determination and transfer. Any digital
+communications system which incorporates all of these elements will be
+covered by Intermind's patents." See Intermind.com.
+
+C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
+disclose data compression methods implementing an LZS compression
+algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
+Stac Patents"). The Netscape Communicator code does not perform
+compression. If you modify the Netscape source code to perform
+compression, please take notice of the Stac Patents.
+
+D) Netscape Communications Corporation ("Netscape") does not guarantee
+that any source code or executable code available from the mozilla.org
+domain is Year 2000 compliant.
--- /dev/null
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
+
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is ______________________________________.
+
+ The Initial Developer of the Original Code is ________________________.
+ Portions created by ______________________ are Copyright (C) ______
+ _______________________. All Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the terms
+ of the _____ license (the "[___] License"), in which case the
+ provisions of [______] License are applicable instead of those
+ above. If you wish to allow use of your version of this file only
+ under the terms of the [____] License and not to allow others to use
+ your version of this file under the MPL, indicate your decision by
+ deleting the provisions above and replace them with the notice and
+ other provisions required by the [___] License. If you do not delete
+ the provisions above, a recipient may use your version of this file
+ under either the MPL or the [___] License."
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
+
+ ----------------------------------------------------------------------
+
+ AMENDMENTS
+
+ The Netscape Public License Version 1.1 ("NPL") consists of the
+ Mozilla Public License Version 1.1 with the following Amendments,
+ including Exhibit A-Netscape Public License. Files identified with
+ "Exhibit A-Netscape Public License" are governed by the Netscape
+ Public License Version 1.1.
+
+ Additional Terms applicable to the Netscape Public License.
+ I. Effect.
+ These additional terms described in this Netscape Public
+ License -- Amendments shall apply to the Mozilla Communicator
+ client code and to all Covered Code under this License.
+
+ II. "Netscape's Branded Code" means Covered Code that Netscape
+ distributes and/or permits others to distribute under one or more
+ trademark(s) which are controlled by Netscape but which are not
+ licensed for use under this License.
+
+ III. Netscape and logo.
+ This License does not grant any rights to use the trademarks
+ "Netscape", the "Netscape N and horizon" logo or the "Netscape
+ lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript",
+ "Smart Browsing" even if such marks are included in the Original
+ Code or Modifications.
+
+ IV. Inability to Comply Due to Contractual Obligation.
+ Prior to licensing the Original Code under this License, Netscape
+ has licensed third party code for use in Netscape's Branded Code.
+ To the extent that Netscape is limited contractually from making
+ such third party code available under this License, Netscape may
+ choose to reintegrate such code into Covered Code without being
+ required to distribute such code in Source Code form, even if
+ such code would otherwise be considered "Modifications" under
+ this License.
+
+ V. Use of Modifications and Covered Code by Initial Developer.
+ V.1. In General.
+ The obligations of Section 3 apply to Netscape, except to
+ the extent specified in this Amendment, Section V.2 and V.3.
+
+ V.2. Other Products.
+ Netscape may include Covered Code in products other than the
+ Netscape's Branded Code which are released by Netscape
+ during the two (2) years following the release date of the
+ Original Code, without such additional products becoming
+ subject to the terms of this License, and may license such
+ additional products on different terms from those contained
+ in this License.
+
+ V.3. Alternative Licensing.
+ Netscape may license the Source Code of Netscape's Branded
+ Code, including Modifications incorporated therein, without
+ such Netscape Branded Code becoming subject to the terms of
+ this License, and may license such Netscape Branded Code on
+ different terms from those contained in this License.
+
+ VI. Litigation.
+ Notwithstanding the limitations of Section 11 above, the
+ provisions regarding litigation in Section 11(a), (b) and (c) of
+ the License shall apply to all disputes relating to this License.
+
+ EXHIBIT A-Netscape Public License.
+
+ "The contents of this file are subject to the Netscape Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/NPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is Mozilla Communicator client code, released
+ March 31, 1998.
+
+ The Initial Developer of the Original Code is Netscape
+ Communications Corporation. Portions created by Netscape are
+ Copyright (C) 1998-1999 Netscape Communications Corporation. All
+ Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the
+ terms of the _____ license (the "[___] License"), in which case
+ the provisions of [______] License are applicable instead of
+ those above. If you wish to allow use of your version of this
+ file only under the terms of the [____] License and not to allow
+ others to use your version of this file under the NPL, indicate
+ your decision by deleting the provisions above and replace them
+ with the notice and other provisions required by the [___]
+ License. If you do not delete the provisions above, a recipient
+ may use your version of this file under either the NPL or the
+ [___] License."
--- /dev/null
+This folder contains Mozilla headers and source-files related to plugin development. The original version of the files were taken from Mozilla1.0 tarball.
+
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*******************************************************************************
+ * Java Runtime Interface
+ ******************************************************************************/
+
+#ifndef JRI_H
+#define JRI_H
+
+#include "jritypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*******************************************************************************
+ * JRIEnv
+ ******************************************************************************/
+
+/* The type of the JRIEnv interface. */
+typedef struct JRIEnvInterface JRIEnvInterface;
+
+/* The type of a JRIEnv instance. */
+typedef const JRIEnvInterface* JRIEnv;
+
+/*******************************************************************************
+ * JRIEnv Operations
+ ******************************************************************************/
+
+#define JRI_DefineClass(env, classLoader, buf, bufLen) \
+ (((*(env))->DefineClass)(env, JRI_DefineClass_op, classLoader, buf, bufLen))
+
+#define JRI_FindClass(env, name) \
+ (((*(env))->FindClass)(env, JRI_FindClass_op, name))
+
+#define JRI_Throw(env, obj) \
+ (((*(env))->Throw)(env, JRI_Throw_op, obj))
+
+#define JRI_ThrowNew(env, clazz, message) \
+ (((*(env))->ThrowNew)(env, JRI_ThrowNew_op, clazz, message))
+
+#define JRI_ExceptionOccurred(env) \
+ (((*(env))->ExceptionOccurred)(env, JRI_ExceptionOccurred_op))
+
+#define JRI_ExceptionDescribe(env) \
+ (((*(env))->ExceptionDescribe)(env, JRI_ExceptionDescribe_op))
+
+#define JRI_ExceptionClear(env) \
+ (((*(env))->ExceptionClear)(env, JRI_ExceptionClear_op))
+
+#define JRI_NewGlobalRef(env, ref) \
+ (((*(env))->NewGlobalRef)(env, JRI_NewGlobalRef_op, ref))
+
+#define JRI_DisposeGlobalRef(env, gref) \
+ (((*(env))->DisposeGlobalRef)(env, JRI_DisposeGlobalRef_op, gref))
+
+#define JRI_GetGlobalRef(env, gref) \
+ (((*(env))->GetGlobalRef)(env, JRI_GetGlobalRef_op, gref))
+
+#define JRI_SetGlobalRef(env, gref, ref) \
+ (((*(env))->SetGlobalRef)(env, JRI_SetGlobalRef_op, gref, ref))
+
+#define JRI_IsSameObject(env, a, b) \
+ (((*(env))->IsSameObject)(env, JRI_IsSameObject_op, a, b))
+
+#define JRI_NewObject(env) ((*(env))->NewObject)
+#define JRI_NewObjectV(env, clazz, methodID, args) \
+ (((*(env))->NewObjectV)(env, JRI_NewObject_op_va_list, clazz, methodID, args))
+#define JRI_NewObjectA(env, clazz, method, args) \
+ (((*(env))->NewObjectA)(env, JRI_NewObject_op_array, clazz, methodID, args))
+
+#define JRI_GetObjectClass(env, obj) \
+ (((*(env))->GetObjectClass)(env, JRI_GetObjectClass_op, obj))
+
+#define JRI_IsInstanceOf(env, obj, clazz) \
+ (((*(env))->IsInstanceOf)(env, JRI_IsInstanceOf_op, obj, clazz))
+
+#define JRI_GetMethodID(env, clazz, name, sig) \
+ (((*(env))->GetMethodID)(env, JRI_GetMethodID_op, clazz, name, sig))
+
+#define JRI_CallMethod(env) ((*(env))->CallMethod)
+#define JRI_CallMethodV(env, obj, methodID, args) \
+ (((*(env))->CallMethodV)(env, JRI_CallMethod_op_va_list, obj, methodID, args))
+#define JRI_CallMethodA(env, obj, methodID, args) \
+ (((*(env))->CallMethodA)(env, JRI_CallMethod_op_array, obj, methodID, args))
+
+#define JRI_CallMethodBoolean(env) ((*(env))->CallMethodBoolean)
+#define JRI_CallMethodBooleanV(env, obj, methodID, args) \
+ (((*(env))->CallMethodBooleanV)(env, JRI_CallMethodBoolean_op_va_list, obj, methodID, args))
+#define JRI_CallMethodBooleanA(env, obj, methodID, args) \
+ (((*(env))->CallMethodBooleanA)(env, JRI_CallMethodBoolean_op_array, obj, methodID, args))
+
+#define JRI_CallMethodByte(env) ((*(env))->CallMethodByte)
+#define JRI_CallMethodByteV(env, obj, methodID, args) \
+ (((*(env))->CallMethodByteV)(env, JRI_CallMethodByte_op_va_list, obj, methodID, args))
+#define JRI_CallMethodByteA(env, obj, methodID, args) \
+ (((*(env))->CallMethodByteA)(env, JRI_CallMethodByte_op_array, obj, methodID, args))
+
+#define JRI_CallMethodChar(env) ((*(env))->CallMethodChar)
+#define JRI_CallMethodCharV(env, obj, methodID, args) \
+ (((*(env))->CallMethodCharV)(env, JRI_CallMethodChar_op_va_list, obj, methodID, args))
+#define JRI_CallMethodCharA(env, obj, methodID, args) \
+ (((*(env))->CallMethodCharA)(env, JRI_CallMethodChar_op_array, obj, methodID, args))
+
+#define JRI_CallMethodShort(env) ((*(env))->CallMethodShort)
+#define JRI_CallMethodShortV(env, obj, methodID, args) \
+ (((*(env))->CallMethodShortV)(env, JRI_CallMethodShort_op_va_list, obj, methodID, args))
+#define JRI_CallMethodShortA(env, obj, methodID, args) \
+ (((*(env))->CallMethodShortA)(env, JRI_CallMethodShort_op_array, obj, methodID, args))
+
+#define JRI_CallMethodInt(env) ((*(env))->CallMethodInt)
+#define JRI_CallMethodIntV(env, obj, methodID, args) \
+ (((*(env))->CallMethodIntV)(env, JRI_CallMethodInt_op_va_list, obj, methodID, args))
+#define JRI_CallMethodIntA(env, obj, methodID, args) \
+ (((*(env))->CallMethodIntA)(env, JRI_CallMethodInt_op_array, obj, methodID, args))
+
+#define JRI_CallMethodLong(env) ((*(env))->CallMethodLong)
+#define JRI_CallMethodLongV(env, obj, methodID, args) \
+ (((*(env))->CallMethodLongV)(env, JRI_CallMethodLong_op_va_list, obj, methodID, args))
+#define JRI_CallMethodLongA(env, obj, methodID, args) \
+ (((*(env))->CallMethodLongA)(env, JRI_CallMethodLong_op_array, obj, methodID, args))
+
+#define JRI_CallMethodFloat(env) ((*(env))->CallMethodFloat)
+#define JRI_CallMethodFloatV(env, obj, methodID, args) \
+ (((*(env))->CallMethodFloatV)(env, JRI_CallMethodFloat_op_va_list, obj, methodID, args))
+#define JRI_CallMethodFloatA(env, obj, methodID, args) \
+ (((*(env))->CallMethodFloatA)(env, JRI_CallMethodFloat_op_array, obj, methodID, args))
+
+#define JRI_CallMethodDouble(env) ((*(env))->CallMethodDouble)
+#define JRI_CallMethodDoubleV(env, obj, methodID, args) \
+ (((*(env))->CallMethodDoubleV)(env, JRI_CallMethodDouble_op_va_list, obj, methodID, args))
+#define JRI_CallMethodDoubleA(env, obj, methodID, args) \
+ (((*(env))->CallMethodDoubleA)(env, JRI_CallMethodDouble_op_array, obj, methodID, args))
+
+#define JRI_GetFieldID(env, clazz, name, sig) \
+ (((*(env))->GetFieldID)(env, JRI_GetFieldID_op, clazz, name, sig))
+
+#define JRI_GetField(env, obj, fieldID) \
+ (((*(env))->GetField)(env, JRI_GetField_op, obj, fieldID))
+
+#define JRI_GetFieldBoolean(env, obj, fieldID) \
+ (((*(env))->GetFieldBoolean)(env, JRI_GetFieldBoolean_op, obj, fieldID))
+
+#define JRI_GetFieldByte(env, obj, fieldID) \
+ (((*(env))->GetFieldByte)(env, JRI_GetFieldByte_op, obj, fieldID))
+
+#define JRI_GetFieldChar(env, obj, fieldID) \
+ (((*(env))->GetFieldChar)(env, JRI_GetFieldChar_op, obj, fieldID))
+
+#define JRI_GetFieldShort(env, obj, fieldID) \
+ (((*(env))->GetFieldShort)(env, JRI_GetFieldShort_op, obj, fieldID))
+
+#define JRI_GetFieldInt(env, obj, fieldID) \
+ (((*(env))->GetFieldInt)(env, JRI_GetFieldInt_op, obj, fieldID))
+
+#define JRI_GetFieldLong(env, obj, fieldID) \
+ (((*(env))->GetFieldLong)(env, JRI_GetFieldLong_op, obj, fieldID))
+
+#define JRI_GetFieldFloat(env, obj, fieldID) \
+ (((*(env))->GetFieldFloat)(env, JRI_GetFieldFloat_op, obj, fieldID))
+
+#define JRI_GetFieldDouble(env, obj, fieldID) \
+ (((*(env))->GetFieldDouble)(env, JRI_GetFieldDouble_op, obj, fieldID))
+
+#define JRI_SetField(env, obj, fieldID, value) \
+ (((*(env))->SetField)(env, JRI_SetField_op, obj, fieldID, value))
+
+#define JRI_SetFieldBoolean(env, obj, fieldID, value) \
+ (((*(env))->SetFieldBoolean)(env, JRI_SetFieldBoolean_op, obj, fieldID, value))
+
+#define JRI_SetFieldByte(env, obj, fieldID, value) \
+ (((*(env))->SetFieldByte)(env, JRI_SetFieldByte_op, obj, fieldID, value))
+
+#define JRI_SetFieldChar(env, obj, fieldID, value) \
+ (((*(env))->SetFieldChar)(env, JRI_SetFieldChar_op, obj, fieldID, value))
+
+#define JRI_SetFieldShort(env, obj, fieldID, value) \
+ (((*(env))->SetFieldShort)(env, JRI_SetFieldShort_op, obj, fieldID, value))
+
+#define JRI_SetFieldInt(env, obj, fieldID, value) \
+ (((*(env))->SetFieldInt)(env, JRI_SetFieldInt_op, obj, fieldID, value))
+
+#define JRI_SetFieldLong(env, obj, fieldID, value) \
+ (((*(env))->SetFieldLong)(env, JRI_SetFieldLong_op, obj, fieldID, value))
+
+#define JRI_SetFieldFloat(env, obj, fieldID, value) \
+ (((*(env))->SetFieldFloat)(env, JRI_SetFieldFloat_op, obj, fieldID, value))
+
+#define JRI_SetFieldDouble(env, obj, fieldID, value) \
+ (((*(env))->SetFieldDouble)(env, JRI_SetFieldDouble_op, obj, fieldID, value))
+
+#define JRI_IsSubclassOf(env, a, b) \
+ (((*(env))->IsSubclassOf)(env, JRI_IsSubclassOf_op, a, b))
+
+#define JRI_GetStaticMethodID(env, clazz, name, sig) \
+ (((*(env))->GetStaticMethodID)(env, JRI_GetStaticMethodID_op, clazz, name, sig))
+
+#define JRI_CallStaticMethod(env) ((*(env))->CallStaticMethod)
+#define JRI_CallStaticMethodV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodV)(env, JRI_CallStaticMethod_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodA)(env, JRI_CallStaticMethod_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodBoolean(env) ((*(env))->CallStaticMethodBoolean)
+#define JRI_CallStaticMethodBooleanV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodBooleanV)(env, JRI_CallStaticMethodBoolean_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodBooleanA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodBooleanA)(env, JRI_CallStaticMethodBoolean_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodByte(env) ((*(env))->CallStaticMethodByte)
+#define JRI_CallStaticMethodByteV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodByteV)(env, JRI_CallStaticMethodByte_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodByteA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodByteA)(env, JRI_CallStaticMethodByte_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodChar(env) ((*(env))->CallStaticMethodChar)
+#define JRI_CallStaticMethodCharV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodCharV)(env, JRI_CallStaticMethodChar_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodCharA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodCharA)(env, JRI_CallStaticMethodChar_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodShort(env) ((*(env))->CallStaticMethodShort)
+#define JRI_CallStaticMethodShortV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodShortV)(env, JRI_CallStaticMethodShort_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodShortA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodShortA)(env, JRI_CallStaticMethodShort_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodInt(env) ((*(env))->CallStaticMethodInt)
+#define JRI_CallStaticMethodIntV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodIntV)(env, JRI_CallStaticMethodInt_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodIntA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodIntA)(env, JRI_CallStaticMethodInt_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodLong(env) ((*(env))->CallStaticMethodLong)
+#define JRI_CallStaticMethodLongV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodLongV)(env, JRI_CallStaticMethodLong_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodLongA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodLongA)(env, JRI_CallStaticMethodLong_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodFloat(env) ((*(env))->CallStaticMethodFloat)
+#define JRI_CallStaticMethodFloatV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodFloatV)(env, JRI_CallStaticMethodFloat_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodFloatA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodFloatA)(env, JRI_CallStaticMethodFloat_op_array, clazz, methodID, args))
+
+#define JRI_CallStaticMethodDouble(env) ((*(env))->CallStaticMethodDouble)
+#define JRI_CallStaticMethodDoubleV(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodDoubleV)(env, JRI_CallStaticMethodDouble_op_va_list, clazz, methodID, args))
+#define JRI_CallStaticMethodDoubleA(env, clazz, methodID, args) \
+ (((*(env))->CallStaticMethodDoubleA)(env, JRI_CallStaticMethodDouble_op_array, clazz, methodID, args))
+
+#define JRI_GetStaticFieldID(env, clazz, name, sig) \
+ (((*(env))->GetStaticFieldID)(env, JRI_GetStaticFieldID_op, clazz, name, sig))
+
+#define JRI_GetStaticField(env, clazz, fieldID) \
+ (((*(env))->GetStaticField)(env, JRI_GetStaticField_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldBoolean(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldBoolean)(env, JRI_GetStaticFieldBoolean_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldByte(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldByte)(env, JRI_GetStaticFieldByte_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldChar(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldChar)(env, JRI_GetStaticFieldChar_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldShort(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldShort)(env, JRI_GetStaticFieldShort_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldInt(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldInt)(env, JRI_GetStaticFieldInt_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldLong(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldLong)(env, JRI_GetStaticFieldLong_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldFloat(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldFloat)(env, JRI_GetStaticFieldFloat_op, clazz, fieldID))
+
+#define JRI_GetStaticFieldDouble(env, clazz, fieldID) \
+ (((*(env))->GetStaticFieldDouble)(env, JRI_GetStaticFieldDouble_op, clazz, fieldID))
+
+#define JRI_SetStaticField(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticField)(env, JRI_SetStaticField_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldBoolean(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldBoolean)(env, JRI_SetStaticFieldBoolean_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldByte(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldByte)(env, JRI_SetStaticFieldByte_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldChar(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldChar)(env, JRI_SetStaticFieldChar_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldShort(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldShort)(env, JRI_SetStaticFieldShort_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldInt(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldInt)(env, JRI_SetStaticFieldInt_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldLong(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldLong)(env, JRI_SetStaticFieldLong_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldFloat(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldFloat)(env, JRI_SetStaticFieldFloat_op, clazz, fieldID, value))
+
+#define JRI_SetStaticFieldDouble(env, clazz, fieldID, value) \
+ (((*(env))->SetStaticFieldDouble)(env, JRI_SetStaticFieldDouble_op, clazz, fieldID, value))
+
+#define JRI_NewString(env, unicode, len) \
+ (((*(env))->NewString)(env, JRI_NewString_op, unicode, len))
+
+#define JRI_GetStringLength(env, string) \
+ (((*(env))->GetStringLength)(env, JRI_GetStringLength_op, string))
+
+#define JRI_GetStringChars(env, string) \
+ (((*(env))->GetStringChars)(env, JRI_GetStringChars_op, string))
+
+#define JRI_NewStringUTF(env, utf, len) \
+ (((*(env))->NewStringUTF)(env, JRI_NewStringUTF_op, utf, len))
+
+#define JRI_GetStringUTFLength(env, string) \
+ (((*(env))->GetStringUTFLength)(env, JRI_GetStringUTFLength_op, string))
+
+#define JRI_GetStringUTFChars(env, string) \
+ (((*(env))->GetStringUTFChars)(env, JRI_GetStringUTFChars_op, string))
+
+#define JRI_NewScalarArray(env, length, elementSig, initialElements) \
+ (((*(env))->NewScalarArray)(env, JRI_NewScalarArray_op, length, elementSig, initialElements))
+
+#define JRI_GetScalarArrayLength(env, array) \
+ (((*(env))->GetScalarArrayLength)(env, JRI_GetScalarArrayLength_op, array))
+
+#define JRI_GetScalarArrayElements(env, array) \
+ (((*(env))->GetScalarArrayElements)(env, JRI_GetScalarArrayElements_op, array))
+
+#define JRI_NewObjectArray(env, length, elementClass, initialElement) \
+ (((*(env))->NewObjectArray)(env, JRI_NewObjectArray_op, length, elementClass, initialElement))
+
+#define JRI_GetObjectArrayLength(env, array) \
+ (((*(env))->GetObjectArrayLength)(env, JRI_GetObjectArrayLength_op, array))
+
+#define JRI_GetObjectArrayElement(env, array, index) \
+ (((*(env))->GetObjectArrayElement)(env, JRI_GetObjectArrayElement_op, array, index))
+
+#define JRI_SetObjectArrayElement(env, array, index, value) \
+ (((*(env))->SetObjectArrayElement)(env, JRI_SetObjectArrayElement_op, array, index, value))
+
+#define JRI_RegisterNatives(env, clazz, nameAndSigArray, nativeProcArray) \
+ (((*(env))->RegisterNatives)(env, JRI_RegisterNatives_op, clazz, nameAndSigArray, nativeProcArray))
+
+#define JRI_UnregisterNatives(env, clazz) \
+ (((*(env))->UnregisterNatives)(env, JRI_UnregisterNatives_op, clazz))
+
+#define JRI_NewStringPlatform(env, string, len, encoding, encodingLength) \
+ (((*(env))->NewStringPlatform)(env, JRI_NewStringPlatform_op, string, len, encoding, encodingLength))
+
+#define JRI_GetStringPlatformChars(env, string, encoding, encodingLength) \
+ (((*(env))->GetStringPlatformChars)(env, JRI_GetStringPlatformChars_op, string, encoding, encodingLength))
+
+
+/*******************************************************************************
+ * JRIEnv Interface
+ ******************************************************************************/
+
+struct java_lang_ClassLoader;
+struct java_lang_Class;
+struct java_lang_Throwable;
+struct java_lang_Object;
+struct java_lang_String;
+
+struct JRIEnvInterface {
+ void* reserved0;
+ void* reserved1;
+ void* reserved2;
+ void* reserved3;
+ struct java_lang_Class* (*FindClass)(JRIEnv* env, jint op, const char* a);
+ void (*Throw)(JRIEnv* env, jint op, struct java_lang_Throwable* a);
+ void (*ThrowNew)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b);
+ struct java_lang_Throwable* (*ExceptionOccurred)(JRIEnv* env, jint op);
+ void (*ExceptionDescribe)(JRIEnv* env, jint op);
+ void (*ExceptionClear)(JRIEnv* env, jint op);
+ jglobal (*NewGlobalRef)(JRIEnv* env, jint op, void* a);
+ void (*DisposeGlobalRef)(JRIEnv* env, jint op, jglobal a);
+ void* (*GetGlobalRef)(JRIEnv* env, jint op, jglobal a);
+ void (*SetGlobalRef)(JRIEnv* env, jint op, jglobal a, void* b);
+ jbool (*IsSameObject)(JRIEnv* env, jint op, void* a, void* b);
+ void* (*NewObject)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ void* (*NewObjectV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ void* (*NewObjectA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ struct java_lang_Class* (*GetObjectClass)(JRIEnv* env, jint op, void* a);
+ jbool (*IsInstanceOf)(JRIEnv* env, jint op, void* a, struct java_lang_Class* b);
+ jint (*GetMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
+ void* (*CallMethod)(JRIEnv* env, jint op, void* a, jint b, ...);
+ void* (*CallMethodV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ void* (*CallMethodA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jbool (*CallMethodBoolean)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jbool (*CallMethodBooleanV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jbool (*CallMethodBooleanA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jbyte (*CallMethodByte)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jbyte (*CallMethodByteV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jbyte (*CallMethodByteA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jchar (*CallMethodChar)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jchar (*CallMethodCharV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jchar (*CallMethodCharA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jshort (*CallMethodShort)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jshort (*CallMethodShortV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jshort (*CallMethodShortA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jint (*CallMethodInt)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jint (*CallMethodIntV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jint (*CallMethodIntA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jlong (*CallMethodLong)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jlong (*CallMethodLongV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jlong (*CallMethodLongA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jfloat (*CallMethodFloat)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jfloat (*CallMethodFloatV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jfloat (*CallMethodFloatA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jdouble (*CallMethodDouble)(JRIEnv* env, jint op, void* a, jint b, ...);
+ jdouble (*CallMethodDoubleV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
+ jdouble (*CallMethodDoubleA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
+ jint (*GetFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
+ void* (*GetField)(JRIEnv* env, jint op, void* a, jint b);
+ jbool (*GetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b);
+ jbyte (*GetFieldByte)(JRIEnv* env, jint op, void* a, jint b);
+ jchar (*GetFieldChar)(JRIEnv* env, jint op, void* a, jint b);
+ jshort (*GetFieldShort)(JRIEnv* env, jint op, void* a, jint b);
+ jint (*GetFieldInt)(JRIEnv* env, jint op, void* a, jint b);
+ jlong (*GetFieldLong)(JRIEnv* env, jint op, void* a, jint b);
+ jfloat (*GetFieldFloat)(JRIEnv* env, jint op, void* a, jint b);
+ jdouble (*GetFieldDouble)(JRIEnv* env, jint op, void* a, jint b);
+ void (*SetField)(JRIEnv* env, jint op, void* a, jint b, void* c);
+ void (*SetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b, jbool c);
+ void (*SetFieldByte)(JRIEnv* env, jint op, void* a, jint b, jbyte c);
+ void (*SetFieldChar)(JRIEnv* env, jint op, void* a, jint b, jchar c);
+ void (*SetFieldShort)(JRIEnv* env, jint op, void* a, jint b, jshort c);
+ void (*SetFieldInt)(JRIEnv* env, jint op, void* a, jint b, jint c);
+ void (*SetFieldLong)(JRIEnv* env, jint op, void* a, jint b, jlong c);
+ void (*SetFieldFloat)(JRIEnv* env, jint op, void* a, jint b, jfloat c);
+ void (*SetFieldDouble)(JRIEnv* env, jint op, void* a, jint b, jdouble c);
+ jbool (*IsSubclassOf)(JRIEnv* env, jint op, struct java_lang_Class* a, struct java_lang_Class* b);
+ jint (*GetStaticMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
+ void* (*CallStaticMethod)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ void* (*CallStaticMethodV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ void* (*CallStaticMethodA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jbool (*CallStaticMethodBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jbool (*CallStaticMethodBooleanV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jbool (*CallStaticMethodBooleanA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jbyte (*CallStaticMethodByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jbyte (*CallStaticMethodByteV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jbyte (*CallStaticMethodByteA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jchar (*CallStaticMethodChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jchar (*CallStaticMethodCharV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jchar (*CallStaticMethodCharA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jshort (*CallStaticMethodShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jshort (*CallStaticMethodShortV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jshort (*CallStaticMethodShortA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jint (*CallStaticMethodInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jint (*CallStaticMethodIntV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jint (*CallStaticMethodIntA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jlong (*CallStaticMethodLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jlong (*CallStaticMethodLongV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jlong (*CallStaticMethodLongA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jfloat (*CallStaticMethodFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jfloat (*CallStaticMethodFloatV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jfloat (*CallStaticMethodFloatA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jdouble (*CallStaticMethodDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
+ jdouble (*CallStaticMethodDoubleV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
+ jdouble (*CallStaticMethodDoubleA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
+ jint (*GetStaticFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
+ void* (*GetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jbool (*GetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jbyte (*GetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jchar (*GetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jshort (*GetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jint (*GetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jlong (*GetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jfloat (*GetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ jdouble (*GetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
+ void (*SetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, void* c);
+ void (*SetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbool c);
+ void (*SetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbyte c);
+ void (*SetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jchar c);
+ void (*SetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jshort c);
+ void (*SetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jint c);
+ void (*SetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jlong c);
+ void (*SetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jfloat c);
+ void (*SetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jdouble c);
+ struct java_lang_String* (*NewString)(JRIEnv* env, jint op, const jchar* a, jint b);
+ jint (*GetStringLength)(JRIEnv* env, jint op, struct java_lang_String* a);
+ const jchar* (*GetStringChars)(JRIEnv* env, jint op, struct java_lang_String* a);
+ struct java_lang_String* (*NewStringUTF)(JRIEnv* env, jint op, const jbyte* a, jint b);
+ jint (*GetStringUTFLength)(JRIEnv* env, jint op, struct java_lang_String* a);
+ const jbyte* (*GetStringUTFChars)(JRIEnv* env, jint op, struct java_lang_String* a);
+ void* (*NewScalarArray)(JRIEnv* env, jint op, jint a, const char* b, const jbyte* c);
+ jint (*GetScalarArrayLength)(JRIEnv* env, jint op, void* a);
+ jbyte* (*GetScalarArrayElements)(JRIEnv* env, jint op, void* a);
+ void* (*NewObjectArray)(JRIEnv* env, jint op, jint a, struct java_lang_Class* b, void* c);
+ jint (*GetObjectArrayLength)(JRIEnv* env, jint op, void* a);
+ void* (*GetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b);
+ void (*SetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b, void* c);
+ void (*RegisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a, char** b, void** c);
+ void (*UnregisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a);
+ struct java_lang_Class* (*DefineClass)(JRIEnv* env, jint op, struct java_lang_ClassLoader* a, jbyte* b, jsize bLen);
+ struct java_lang_String* (*NewStringPlatform)(JRIEnv* env, jint op, const jbyte* a, jint b, const jbyte* c, jint d);
+ const jbyte* (*GetStringPlatformChars)(JRIEnv* env, jint op, struct java_lang_String* a, const jbyte* b, jint c);
+};
+
+/*
+** ****************************************************************************
+** JRIEnv Operation IDs
+** ***************************************************************************
+*/
+
+typedef enum JRIEnvOperations {
+ JRI_Reserved0_op,
+ JRI_Reserved1_op,
+ JRI_Reserved2_op,
+ JRI_Reserved3_op,
+ JRI_FindClass_op,
+ JRI_Throw_op,
+ JRI_ThrowNew_op,
+ JRI_ExceptionOccurred_op,
+ JRI_ExceptionDescribe_op,
+ JRI_ExceptionClear_op,
+ JRI_NewGlobalRef_op,
+ JRI_DisposeGlobalRef_op,
+ JRI_GetGlobalRef_op,
+ JRI_SetGlobalRef_op,
+ JRI_IsSameObject_op,
+ JRI_NewObject_op,
+ JRI_NewObject_op_va_list,
+ JRI_NewObject_op_array,
+ JRI_GetObjectClass_op,
+ JRI_IsInstanceOf_op,
+ JRI_GetMethodID_op,
+ JRI_CallMethod_op,
+ JRI_CallMethod_op_va_list,
+ JRI_CallMethod_op_array,
+ JRI_CallMethodBoolean_op,
+ JRI_CallMethodBoolean_op_va_list,
+ JRI_CallMethodBoolean_op_array,
+ JRI_CallMethodByte_op,
+ JRI_CallMethodByte_op_va_list,
+ JRI_CallMethodByte_op_array,
+ JRI_CallMethodChar_op,
+ JRI_CallMethodChar_op_va_list,
+ JRI_CallMethodChar_op_array,
+ JRI_CallMethodShort_op,
+ JRI_CallMethodShort_op_va_list,
+ JRI_CallMethodShort_op_array,
+ JRI_CallMethodInt_op,
+ JRI_CallMethodInt_op_va_list,
+ JRI_CallMethodInt_op_array,
+ JRI_CallMethodLong_op,
+ JRI_CallMethodLong_op_va_list,
+ JRI_CallMethodLong_op_array,
+ JRI_CallMethodFloat_op,
+ JRI_CallMethodFloat_op_va_list,
+ JRI_CallMethodFloat_op_array,
+ JRI_CallMethodDouble_op,
+ JRI_CallMethodDouble_op_va_list,
+ JRI_CallMethodDouble_op_array,
+ JRI_GetFieldID_op,
+ JRI_GetField_op,
+ JRI_GetFieldBoolean_op,
+ JRI_GetFieldByte_op,
+ JRI_GetFieldChar_op,
+ JRI_GetFieldShort_op,
+ JRI_GetFieldInt_op,
+ JRI_GetFieldLong_op,
+ JRI_GetFieldFloat_op,
+ JRI_GetFieldDouble_op,
+ JRI_SetField_op,
+ JRI_SetFieldBoolean_op,
+ JRI_SetFieldByte_op,
+ JRI_SetFieldChar_op,
+ JRI_SetFieldShort_op,
+ JRI_SetFieldInt_op,
+ JRI_SetFieldLong_op,
+ JRI_SetFieldFloat_op,
+ JRI_SetFieldDouble_op,
+ JRI_IsSubclassOf_op,
+ JRI_GetStaticMethodID_op,
+ JRI_CallStaticMethod_op,
+ JRI_CallStaticMethod_op_va_list,
+ JRI_CallStaticMethod_op_array,
+ JRI_CallStaticMethodBoolean_op,
+ JRI_CallStaticMethodBoolean_op_va_list,
+ JRI_CallStaticMethodBoolean_op_array,
+ JRI_CallStaticMethodByte_op,
+ JRI_CallStaticMethodByte_op_va_list,
+ JRI_CallStaticMethodByte_op_array,
+ JRI_CallStaticMethodChar_op,
+ JRI_CallStaticMethodChar_op_va_list,
+ JRI_CallStaticMethodChar_op_array,
+ JRI_CallStaticMethodShort_op,
+ JRI_CallStaticMethodShort_op_va_list,
+ JRI_CallStaticMethodShort_op_array,
+ JRI_CallStaticMethodInt_op,
+ JRI_CallStaticMethodInt_op_va_list,
+ JRI_CallStaticMethodInt_op_array,
+ JRI_CallStaticMethodLong_op,
+ JRI_CallStaticMethodLong_op_va_list,
+ JRI_CallStaticMethodLong_op_array,
+ JRI_CallStaticMethodFloat_op,
+ JRI_CallStaticMethodFloat_op_va_list,
+ JRI_CallStaticMethodFloat_op_array,
+ JRI_CallStaticMethodDouble_op,
+ JRI_CallStaticMethodDouble_op_va_list,
+ JRI_CallStaticMethodDouble_op_array,
+ JRI_GetStaticFieldID_op,
+ JRI_GetStaticField_op,
+ JRI_GetStaticFieldBoolean_op,
+ JRI_GetStaticFieldByte_op,
+ JRI_GetStaticFieldChar_op,
+ JRI_GetStaticFieldShort_op,
+ JRI_GetStaticFieldInt_op,
+ JRI_GetStaticFieldLong_op,
+ JRI_GetStaticFieldFloat_op,
+ JRI_GetStaticFieldDouble_op,
+ JRI_SetStaticField_op,
+ JRI_SetStaticFieldBoolean_op,
+ JRI_SetStaticFieldByte_op,
+ JRI_SetStaticFieldChar_op,
+ JRI_SetStaticFieldShort_op,
+ JRI_SetStaticFieldInt_op,
+ JRI_SetStaticFieldLong_op,
+ JRI_SetStaticFieldFloat_op,
+ JRI_SetStaticFieldDouble_op,
+ JRI_NewString_op,
+ JRI_GetStringLength_op,
+ JRI_GetStringChars_op,
+ JRI_NewStringUTF_op,
+ JRI_GetStringUTFLength_op,
+ JRI_GetStringUTFChars_op,
+ JRI_NewScalarArray_op,
+ JRI_GetScalarArrayLength_op,
+ JRI_GetScalarArrayElements_op,
+ JRI_NewObjectArray_op,
+ JRI_GetObjectArrayLength_op,
+ JRI_GetObjectArrayElement_op,
+ JRI_SetObjectArrayElement_op,
+ JRI_RegisterNatives_op,
+ JRI_UnregisterNatives_op,
+ JRI_DefineClass_op,
+ JRI_NewStringPlatform_op,
+ JRI_GetStringPlatformChars_op
+} JRIEnvOperations;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* JRI_H */
+/******************************************************************************/
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*******************************************************************************
+ * Java Runtime Interface - Machine Dependent Types
+ ******************************************************************************/
+
+#ifndef JRI_MD_H
+#define JRI_MD_H
+
+#include <assert.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*******************************************************************************
+ * WHAT'S UP WITH THIS FILE?
+ *
+ * This is where we define the mystical JRI_PUBLIC_API macro that works on all
+ * platforms. If you're running with Visual C++, Symantec C, or Borland's
+ * development environment on the PC, you're all set. Or if you're on the Mac
+ * with Metrowerks, Symantec or MPW with SC you're ok too. For UNIX it shouldn't
+ * matter.
+ *
+ * On UNIX though you probably care about a couple of other symbols though:
+ * IS_LITTLE_ENDIAN must be defined for little-endian systems
+ * HAVE_LONG_LONG must be defined on systems that have 'long long' integers
+ * HAVE_ALIGNED_LONGLONGS must be defined if long-longs must be 8 byte aligned
+ * HAVE_ALIGNED_DOUBLES must be defined if doubles must be 8 byte aligned
+ * IS_64 must be defined on 64-bit machines (like Dec Alpha)
+ ******************************************************************************/
+
+/* DLL Entry modifiers... */
+
+/* PC */
+#if defined(XP_PC) || defined(_WINDOWS) || defined(WIN32) || defined(_WIN32)
+# include <windows.h>
+# if defined(_MSC_VER) || defined(__MINGW32__)
+# if defined(WIN32) || defined(_WIN32)
+# define JRI_PUBLIC_API(ResultType) __declspec(dllexport) ResultType
+# define JRI_PUBLIC_VAR(VarType) VarType
+# define JRI_PUBLIC_VAR_EXP(VarType) __declspec(dllexport) VarType
+# define JRI_PUBLIC_VAR_IMP(VarType) __declspec(dllimport) VarType
+# define JRI_NATIVE_STUB(ResultType) __declspec(dllexport) ResultType
+# define JRI_CALLBACK
+# else /* !_WIN32 */
+# if defined(_WINDLL)
+# define JRI_PUBLIC_API(ResultType) ResultType __cdecl __export __loadds
+# define JRI_PUBLIC_VAR(VarType) VarType
+# define JRI_PUBLIC_VAR_EXP(VarType) JRI_PUBLIC_VAR(VarType)
+# define JRI_PUBLIC_VAR_IMP(VarType) JRI_PUBLIC_VAR(VarType)
+# define JRI_NATIVE_STUB(ResultType) ResultType __cdecl __loadds
+# define JRI_CALLBACK __loadds
+# else /* !WINDLL */
+# define JRI_PUBLIC_API(ResultType) ResultType __cdecl __export
+# define JRI_PUBLIC_VAR(VarType) VarType
+# define JRI_PUBLIC_VAR_EXP(VarType) JRI_PUBLIC_VAR(VarType)
+# define JRI_PUBLIC_VAR_IMP(VarType) JRI_PUBLIC_VAR(VarType)
+# define JRI_NATIVE_STUB(ResultType) ResultType __cdecl __export
+# define JRI_CALLBACK __export
+# endif /* !WINDLL */
+# endif /* !_WIN32 */
+# elif defined(__BORLANDC__)
+# if defined(WIN32) || defined(_WIN32)
+# define JRI_PUBLIC_API(ResultType) __export ResultType
+# define JRI_PUBLIC_VAR(VarType) VarType
+# define JRI_PUBLIC_VAR_EXP(VarType) __export VarType
+# define JRI_PUBLIC_VAR_IMP(VarType) __import VarType
+# define JRI_NATIVE_STUB(ResultType) __export ResultType
+# define JRI_CALLBACK
+# else /* !_WIN32 */
+# define JRI_PUBLIC_API(ResultType) ResultType _cdecl _export _loadds
+# define JRI_PUBLIC_VAR(VarType) VarType
+# define JRI_PUBLIC_VAR_EXP(VarType) __cdecl __export VarType
+# define JRI_PUBLIC_VAR_IMP(VarType) __cdecl __import VarType
+# define JRI_NATIVE_STUB(ResultType) ResultType _cdecl _loadds
+# define JRI_CALLBACK _loadds
+# endif
+# else
+# error Unsupported PC development environment.
+# endif
+# ifndef IS_LITTLE_ENDIAN
+# define IS_LITTLE_ENDIAN
+# endif
+
+/* Mac */
+#elif defined (macintosh) || defined(Macintosh) || defined(THINK_C)
+# if defined(__MWERKS__) /* Metrowerks */
+# if !__option(enumsalwaysint)
+# error You need to define 'Enums Always Int' for your project.
+# endif
+# if defined(TARGET_CPU_68K) && !TARGET_RT_MAC_CFM
+# if !__option(fourbyteints)
+# error You need to define 'Struct Alignment: 68k' for your project.
+# endif
+# endif /* !GENERATINGCFM */
+# define JRI_PUBLIC_API(ResultType) __declspec(export) ResultType
+# define JRI_PUBLIC_VAR(VarType) JRI_PUBLIC_API(VarType)
+# define JRI_PUBLIC_VAR_EXP(VarType) JRI_PUBLIC_API(VarType)
+# define JRI_PUBLIC_VAR_IMP(VarType) JRI_PUBLIC_API(VarType)
+# define JRI_NATIVE_STUB(ResultType) JRI_PUBLIC_API(ResultType)
+# elif defined(__SC__) /* Symantec */
+# error What are the Symantec defines? (warren@netscape.com)
+# elif macintosh && applec /* MPW */
+# error Please upgrade to the latest MPW compiler (SC).
+# else
+# error Unsupported Mac development environment.
+# endif
+# define JRI_CALLBACK
+
+/* Unix or else */
+#else
+# define JRI_PUBLIC_API(ResultType) ResultType
+# define JRI_PUBLIC_VAR(VarType) VarType
+# define JRI_PUBLIC_VAR_EXP(VarType) JRI_PUBLIC_VAR(VarType)
+# define JRI_PUBLIC_VAR_IMP(VarType) JRI_PUBLIC_VAR(VarType)
+# define JRI_NATIVE_STUB(ResultType) ResultType
+# define JRI_CALLBACK
+#endif
+
+#ifndef FAR /* for non-Win16 */
+#define FAR
+#endif
+
+/******************************************************************************/
+
+/* Java Scalar Types */
+
+/* moved from jni.h -- Sun's new jni.h doesn't have this anymore */
+#ifdef __cplusplus
+typedef class _jobject *jref;
+#else
+typedef struct _jobject *jref;
+#endif
+
+typedef unsigned char jbool;
+typedef char jbyte;
+typedef short jchar;
+typedef short jshort;
+#ifdef IS_64 /* XXX ok for alpha, but not right on all 64-bit architectures */
+typedef unsigned int juint;
+typedef int jint;
+#else
+typedef unsigned long juint;
+typedef long jint;
+#endif
+
+typedef float jfloat;
+typedef double jdouble;
+
+typedef juint jsize;
+
+
+/*******************************************************************************
+ * jlong : long long (64-bit signed integer type) support.
+ ******************************************************************************/
+
+/*
+** Bit masking macros. (n must be <= 31 to be portable)
+*/
+#define JRI_BIT(n) ((juint)1 << (n))
+#define JRI_BITMASK(n) (JRI_BIT(n) - 1)
+
+#ifdef HAVE_LONG_LONG
+
+#if (defined(WIN32) || defined(_WIN32))
+
+typedef LONGLONG jlong;
+typedef DWORDLONG julong;
+#define jlong_MAXINT 0x7fffffffffffffffi64
+#define jlong_MININT 0x8000000000000000i64
+#define jlong_ZERO 0x0i64
+
+#else
+
+typedef long long jlong;
+typedef unsigned long long julong;
+#define jlong_MAXINT 0x7fffffffffffffffLL
+#define jlong_MININT 0x8000000000000000LL
+#define jlong_ZERO 0x0LL
+
+#endif
+
+#define jlong_IS_ZERO(a) ((a) == 0)
+#define jlong_EQ(a, b) ((a) == (b))
+#define jlong_NE(a, b) ((a) != (b))
+#define jlong_GE_ZERO(a) ((a) >= 0)
+#define jlong_CMP(a, op, b) ((a) op (b))
+
+#define jlong_AND(r, a, b) ((r) = (a) & (b))
+#define jlong_OR(r, a, b) ((r) = (a) | (b))
+#define jlong_XOR(r, a, b) ((r) = (a) ^ (b))
+#define jlong_OR2(r, a) ((r) = (r) | (a))
+#define jlong_NOT(r, a) ((r) = ~(a))
+
+#define jlong_NEG(r, a) ((r) = -(a))
+#define jlong_ADD(r, a, b) ((r) = (a) + (b))
+#define jlong_SUB(r, a, b) ((r) = (a) - (b))
+
+#define jlong_MUL(r, a, b) ((r) = (a) * (b))
+#define jlong_DIV(r, a, b) ((r) = (a) / (b))
+#define jlong_MOD(r, a, b) ((r) = (a) % (b))
+
+#define jlong_SHL(r, a, b) ((r) = (a) << (b))
+#define jlong_SHR(r, a, b) ((r) = (a) >> (b))
+#define jlong_USHR(r, a, b) ((r) = (julong)(a) >> (b))
+#define jlong_ISHL(r, a, b) ((r) = ((jlong)(a)) << (b))
+
+#define jlong_L2I(i, l) ((i) = (int)(l))
+#define jlong_L2UI(ui, l) ((ui) =(unsigned int)(l))
+#define jlong_L2F(f, l) ((f) = (l))
+#define jlong_L2D(d, l) ((d) = (l))
+
+#define jlong_I2L(l, i) ((l) = (i))
+#define jlong_UI2L(l, ui) ((l) = (ui))
+#define jlong_F2L(l, f) ((l) = (f))
+#define jlong_D2L(l, d) ((l) = (d))
+
+#define jlong_UDIVMOD(qp, rp, a, b) \
+ (*(qp) = ((julong)(a) / (b)), \
+ *(rp) = ((julong)(a) % (b)))
+
+#else /* !HAVE_LONG_LONG */
+
+typedef struct {
+#ifdef IS_LITTLE_ENDIAN
+ juint lo, hi;
+#else
+ juint hi, lo;
+#endif
+} jlong;
+typedef jlong julong;
+
+extern jlong jlong_MAXINT, jlong_MININT, jlong_ZERO;
+
+#define jlong_IS_ZERO(a) (((a).hi == 0) && ((a).lo == 0))
+#define jlong_EQ(a, b) (((a).hi == (b).hi) && ((a).lo == (b).lo))
+#define jlong_NE(a, b) (((a).hi != (b).hi) || ((a).lo != (b).lo))
+#define jlong_GE_ZERO(a) (((a).hi >> 31) == 0)
+
+/*
+ * NB: jlong_CMP and jlong_UCMP work only for strict relationals (<, >).
+ */
+#define jlong_CMP(a, op, b) (((int32)(a).hi op (int32)(b).hi) || \
+ (((a).hi == (b).hi) && ((a).lo op (b).lo)))
+#define jlong_UCMP(a, op, b) (((a).hi op (b).hi) || \
+ (((a).hi == (b).hi) && ((a).lo op (b).lo)))
+
+#define jlong_AND(r, a, b) ((r).lo = (a).lo & (b).lo, \
+ (r).hi = (a).hi & (b).hi)
+#define jlong_OR(r, a, b) ((r).lo = (a).lo | (b).lo, \
+ (r).hi = (a).hi | (b).hi)
+#define jlong_XOR(r, a, b) ((r).lo = (a).lo ^ (b).lo, \
+ (r).hi = (a).hi ^ (b).hi)
+#define jlong_OR2(r, a) ((r).lo = (r).lo | (a).lo, \
+ (r).hi = (r).hi | (a).hi)
+#define jlong_NOT(r, a) ((r).lo = ~(a).lo, \
+ (r).hi = ~(a).hi)
+
+#define jlong_NEG(r, a) ((r).lo = -(int32)(a).lo, \
+ (r).hi = -(int32)(a).hi - ((r).lo != 0))
+#define jlong_ADD(r, a, b) { \
+ jlong _a, _b; \
+ _a = a; _b = b; \
+ (r).lo = _a.lo + _b.lo; \
+ (r).hi = _a.hi + _b.hi + ((r).lo < _b.lo); \
+}
+
+#define jlong_SUB(r, a, b) { \
+ jlong _a, _b; \
+ _a = a; _b = b; \
+ (r).lo = _a.lo - _b.lo; \
+ (r).hi = _a.hi - _b.hi - (_a.lo < _b.lo); \
+} \
+
+/*
+ * Multiply 64-bit operands a and b to get 64-bit result r.
+ * First multiply the low 32 bits of a and b to get a 64-bit result in r.
+ * Then add the outer and inner products to r.hi.
+ */
+#define jlong_MUL(r, a, b) { \
+ jlong _a, _b; \
+ _a = a; _b = b; \
+ jlong_MUL32(r, _a.lo, _b.lo); \
+ (r).hi += _a.hi * _b.lo + _a.lo * _b.hi; \
+}
+
+/* XXX _jlong_lo16(a) = ((a) << 16 >> 16) is better on some archs (not on mips) */
+#define _jlong_lo16(a) ((a) & JRI_BITMASK(16))
+#define _jlong_hi16(a) ((a) >> 16)
+
+/*
+ * Multiply 32-bit operands a and b to get 64-bit result r.
+ * Use polynomial expansion based on primitive field element (1 << 16).
+ */
+#define jlong_MUL32(r, a, b) { \
+ juint _a1, _a0, _b1, _b0, _y0, _y1, _y2, _y3; \
+ _a1 = _jlong_hi16(a), _a0 = _jlong_lo16(a); \
+ _b1 = _jlong_hi16(b), _b0 = _jlong_lo16(b); \
+ _y0 = _a0 * _b0; \
+ _y1 = _a0 * _b1; \
+ _y2 = _a1 * _b0; \
+ _y3 = _a1 * _b1; \
+ _y1 += _jlong_hi16(_y0); /* can't carry */ \
+ _y1 += _y2; /* might carry */ \
+ if (_y1 < _y2) _y3 += 1 << 16; /* propagate */ \
+ (r).lo = (_jlong_lo16(_y1) << 16) + _jlong_lo16(_y0); \
+ (r).hi = _y3 + _jlong_hi16(_y1); \
+}
+
+/*
+ * Divide 64-bit unsigned operand a by 64-bit unsigned operand b, setting *qp
+ * to the 64-bit unsigned quotient, and *rp to the 64-bit unsigned remainder.
+ * Minimize effort if one of qp and rp is null.
+ */
+#define jlong_UDIVMOD(qp, rp, a, b) jlong_udivmod(qp, rp, a, b)
+
+extern JRI_PUBLIC_API(void)
+jlong_udivmod(julong *qp, julong *rp, julong a, julong b);
+
+#define jlong_DIV(r, a, b) { \
+ jlong _a, _b; \
+ juint _negative = (int32)(a).hi < 0; \
+ if (_negative) { \
+ jlong_NEG(_a, a); \
+ } else { \
+ _a = a; \
+ } \
+ if ((int32)(b).hi < 0) { \
+ _negative ^= 1; \
+ jlong_NEG(_b, b); \
+ } else { \
+ _b = b; \
+ } \
+ jlong_UDIVMOD(&(r), 0, _a, _b); \
+ if (_negative) \
+ jlong_NEG(r, r); \
+}
+
+#define jlong_MOD(r, a, b) { \
+ jlong _a, _b; \
+ juint _negative = (int32)(a).hi < 0; \
+ if (_negative) { \
+ jlong_NEG(_a, a); \
+ } else { \
+ _a = a; \
+ } \
+ if ((int32)(b).hi < 0) { \
+ jlong_NEG(_b, b); \
+ } else { \
+ _b = b; \
+ } \
+ jlong_UDIVMOD(0, &(r), _a, _b); \
+ if (_negative) \
+ jlong_NEG(r, r); \
+}
+
+/*
+ * NB: b is a juint, not jlong or julong, for the shift ops.
+ */
+#define jlong_SHL(r, a, b) { \
+ if (b) { \
+ jlong _a; \
+ _a = a; \
+ if ((b) < 32) { \
+ (r).lo = _a.lo << (b); \
+ (r).hi = (_a.hi << (b)) | (_a.lo >> (32 - (b))); \
+ } else { \
+ (r).lo = 0; \
+ (r).hi = _a.lo << ((b) & 31); \
+ } \
+ } else { \
+ (r) = (a); \
+ } \
+}
+
+/* a is an int32, b is int32, r is jlong */
+#define jlong_ISHL(r, a, b) { \
+ if (b) { \
+ jlong _a; \
+ _a.lo = (a); \
+ _a.hi = 0; \
+ if ((b) < 32) { \
+ (r).lo = (a) << (b); \
+ (r).hi = ((a) >> (32 - (b))); \
+ } else { \
+ (r).lo = 0; \
+ (r).hi = (a) << ((b) & 31); \
+ } \
+ } else { \
+ (r).lo = (a); \
+ (r).hi = 0; \
+ } \
+}
+
+#define jlong_SHR(r, a, b) { \
+ if (b) { \
+ jlong _a; \
+ _a = a; \
+ if ((b) < 32) { \
+ (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> (b)); \
+ (r).hi = (int32)_a.hi >> (b); \
+ } else { \
+ (r).lo = (int32)_a.hi >> ((b) & 31); \
+ (r).hi = (int32)_a.hi >> 31; \
+ } \
+ } else { \
+ (r) = (a); \
+ } \
+}
+
+#define jlong_USHR(r, a, b) { \
+ if (b) { \
+ jlong _a; \
+ _a = a; \
+ if ((b) < 32) { \
+ (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> (b)); \
+ (r).hi = _a.hi >> (b); \
+ } else { \
+ (r).lo = _a.hi >> ((b) & 31); \
+ (r).hi = 0; \
+ } \
+ } else { \
+ (r) = (a); \
+ } \
+}
+
+#define jlong_L2I(i, l) ((i) = (l).lo)
+#define jlong_L2UI(ui, l) ((ui) = (l).lo)
+#define jlong_L2F(f, l) { double _d; jlong_L2D(_d, l); (f) = (float) _d; }
+
+#define jlong_L2D(d, l) { \
+ int32 _negative; \
+ jlong _absval; \
+ \
+ _negative = (l).hi >> 31; \
+ if (_negative) { \
+ jlong_NEG(_absval, l); \
+ } else { \
+ _absval = l; \
+ } \
+ (d) = (double)_absval.hi * 4.294967296e9 + _absval.lo; \
+ if (_negative) \
+ (d) = -(d); \
+}
+
+#define jlong_I2L(l, i) ((l).hi = (i) >> 31, (l).lo = (i))
+#define jlong_UI2L(l, ui) ((l).hi = 0, (l).lo = (ui))
+#define jlong_F2L(l, f) { double _d = (double) f; jlong_D2L(l, _d); }
+
+#define jlong_D2L(l, d) { \
+ int _negative; \
+ double _absval, _d_hi; \
+ jlong _lo_d; \
+ \
+ _negative = ((d) < 0); \
+ _absval = _negative ? -(d) : (d); \
+ \
+ (l).hi = (juint)(_absval / 4.294967296e9); \
+ (l).lo = 0; \
+ jlong_L2D(_d_hi, l); \
+ _absval -= _d_hi; \
+ _lo_d.hi = 0; \
+ if (_absval < 0) { \
+ _lo_d.lo = (juint) -_absval; \
+ jlong_SUB(l, l, _lo_d); \
+ } else { \
+ _lo_d.lo = (juint) _absval; \
+ jlong_ADD(l, l, _lo_d); \
+ } \
+ \
+ if (_negative) \
+ jlong_NEG(l, l); \
+}
+
+#endif /* !HAVE_LONG_LONG */
+
+/******************************************************************************/
+
+#ifdef HAVE_ALIGNED_LONGLONGS
+#define JRI_GET_INT64(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \
+ ((_t).x[1] = ((jint*)(_addr))[1]), \
+ (_t).l )
+#define JRI_SET_INT64(_t, _addr, _v) ( (_t).l = (_v), \
+ ((jint*)(_addr))[0] = (_t).x[0], \
+ ((jint*)(_addr))[1] = (_t).x[1] )
+#else
+#define JRI_GET_INT64(_t,_addr) (*(jlong*)(_addr))
+#define JRI_SET_INT64(_t, _addr, _v) (*(jlong*)(_addr) = (_v))
+#endif
+
+/* If double's must be aligned on doubleword boundaries then define this */
+#ifdef HAVE_ALIGNED_DOUBLES
+#define JRI_GET_DOUBLE(_t,_addr) ( ((_t).x[0] = ((jint*)(_addr))[0]), \
+ ((_t).x[1] = ((jint*)(_addr))[1]), \
+ (_t).d )
+#define JRI_SET_DOUBLE(_t, _addr, _v) ( (_t).d = (_v), \
+ ((jint*)(_addr))[0] = (_t).x[0], \
+ ((jint*)(_addr))[1] = (_t).x[1] )
+#else
+#define JRI_GET_DOUBLE(_t,_addr) (*(jdouble*)(_addr))
+#define JRI_SET_DOUBLE(_t, _addr, _v) (*(jdouble*)(_addr) = (_v))
+#endif
+
+/******************************************************************************/
+#ifdef __cplusplus
+}
+#endif
+#endif /* JRI_MD_H */
+/******************************************************************************/
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*******************************************************************************
+ * Java Runtime Interface
+ ******************************************************************************/
+
+#ifndef JRITYPES_H
+#define JRITYPES_H
+
+#include "jri_md.h"
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*******************************************************************************
+ * Types
+ ******************************************************************************/
+
+struct JRIEnvInterface;
+
+typedef void* JRIRef;
+typedef void* JRIGlobalRef;
+
+typedef jint JRIFieldID;
+typedef jint JRIMethodID;
+
+/* synonyms: */
+typedef JRIGlobalRef jglobal;
+
+typedef union JRIValue {
+ jbool z;
+ jbyte b;
+ jchar c;
+ jshort s;
+ jint i;
+ jlong l;
+ jfloat f;
+ jdouble d;
+ jref r;
+} JRIValue;
+
+typedef enum JRIBoolean {
+ JRIFalse = 0,
+ JRITrue = 1
+} JRIBoolean;
+
+typedef enum JRIConstant {
+ JRIUninitialized = -1
+} JRIConstant;
+
+/* convenience types (these must be distinct struct types for c++ overloading): */
+
+typedef struct jstringArrayStruct* jstringArray;
+typedef struct jarrayArrayStruct* jarrayArray;
+
+#define JRIConstructorMethodName "<init>"
+
+/*******************************************************************************
+ * Signature Construction Macros
+ ******************************************************************************/
+
+/*
+** These macros can be used to construct signature strings. Hopefully their names
+** are a little easier to remember than the single character they correspond to.
+** For example, to specify the signature of the method:
+**
+** public int read(byte b[], int off, int len);
+**
+** you could write something like this in C:
+**
+** char* readSig = JRISigMethod(JRISigArray(JRISigByte)
+** JRISigInt
+** JRISigInt) JRISigInt;
+**
+** Of course, don't put commas between the types.
+*/
+#define JRISigArray(T) "[" T
+#define JRISigByte "B"
+#define JRISigChar "C"
+#define JRISigClass(name) "L" name ";"
+#define JRISigFloat "F"
+#define JRISigDouble "D"
+#define JRISigMethod(args) "(" args ")"
+#define JRISigNoArgs ""
+#define JRISigInt "I"
+#define JRISigLong "J"
+#define JRISigShort "S"
+#define JRISigVoid "V"
+#define JRISigBoolean "Z"
+
+/*******************************************************************************
+ * Environments
+ ******************************************************************************/
+
+extern JRI_PUBLIC_API(const struct JRIEnvInterface**)
+JRI_GetCurrentEnv(void);
+
+/*******************************************************************************
+ * Specific Scalar Array Types
+ ******************************************************************************/
+
+/*
+** The JRI Native Method Interface does not support boolean arrays. This
+** is to allow Java runtime implementations to optimize boolean array
+** storage. Using the ScalarArray operations on boolean arrays is bound
+** to fail, so convert any boolean arrays to byte arrays in Java before
+** passing them to a native method.
+*/
+
+#define JRI_NewByteArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, length, JRISigByte, (jbyte*)(initialValues))
+#define JRI_GetByteArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetByteArrayElements(env, array) \
+ JRI_GetScalarArrayElements(env, array)
+
+#define JRI_NewCharArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, ((length) * sizeof(jchar)), JRISigChar, (jbyte*)(initialValues))
+#define JRI_GetCharArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetCharArrayElements(env, array) \
+ ((jchar*)JRI_GetScalarArrayElements(env, array))
+
+#define JRI_NewShortArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, ((length) * sizeof(jshort)), JRISigShort, (jbyte*)(initialValues))
+#define JRI_GetShortArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetShortArrayElements(env, array) \
+ ((jshort*)JRI_GetScalarArrayElements(env, array))
+
+#define JRI_NewIntArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, ((length) * sizeof(jint)), JRISigInt, (jbyte*)(initialValues))
+#define JRI_GetIntArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetIntArrayElements(env, array) \
+ ((jint*)JRI_GetScalarArrayElements(env, array))
+
+#define JRI_NewLongArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, ((length) * sizeof(jlong)), JRISigLong, (jbyte*)(initialValues))
+#define JRI_GetLongArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetLongArrayElements(env, array) \
+ ((jlong*)JRI_GetScalarArrayElements(env, array))
+
+#define JRI_NewFloatArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, ((length) * sizeof(jfloat)), JRISigFloat, (jbyte*)(initialValues))
+#define JRI_GetFloatArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetFloatArrayElements(env, array) \
+ ((jfloat*)JRI_GetScalarArrayElements(env, array))
+
+#define JRI_NewDoubleArray(env, length, initialValues) \
+ JRI_NewScalarArray(env, ((length) * sizeof(jdouble)), JRISigDouble, (jbyte*)(initialValues))
+#define JRI_GetDoubleArrayLength(env, array) \
+ JRI_GetScalarArrayLength(env, array)
+#define JRI_GetDoubleArrayElements(env, array) \
+ ((jdouble*)JRI_GetScalarArrayElements(env, array))
+
+/******************************************************************************/
+/*
+** JDK Stuff -- This stuff is still needed while we're using the JDK
+** dynamic linking strategy to call native methods.
+*/
+
+typedef union JRI_JDK_stack_item {
+ /* Non pointer items */
+ jint i;
+ jfloat f;
+ jint o;
+ /* Pointer items */
+ void *h;
+ void *p;
+ unsigned char *addr;
+#ifdef IS_64
+ double d;
+ long l; /* == 64bits! */
+#endif
+} JRI_JDK_stack_item;
+
+typedef union JRI_JDK_Java8Str {
+ jint x[2];
+ jdouble d;
+ jlong l;
+ void *p;
+ float f;
+} JRI_JDK_Java8;
+
+/******************************************************************************/
+#ifdef __cplusplus
+}
+#endif
+#endif /* JRITYPES_H */
+/******************************************************************************/
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Stephen Mak <smak@sun.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * npunix.c
+ *
+ * Netscape Client Plugin API
+ * - Wrapper function to interface with the Netscape Navigator
+ *
+ * dp Suresh <dp@netscape.com>
+ *
+ *----------------------------------------------------------------------
+ * PLUGIN DEVELOPERS:
+ * YOU WILL NOT NEED TO EDIT THIS FILE.
+ *----------------------------------------------------------------------
+ */
+
+#include <sal/types.h>
+
+#define XP_UNIX 1
+
+#include <stdio.h>
+#include "npapi.h"
+#include "npupp.h"
+#include "plugin.h"
+
+/*
+ * Define PLUGIN_TRACE to have the wrapper functions print
+ * messages to stderr whenever they are called.
+ */
+
+#ifdef PLUGIN_TRACE
+#include <stdio.h>
+#define PLUGINDEBUGSTR(msg) fprintf(stderr, "%s\n", msg)
+#else
+#define PLUGINDEBUGSTR(msg)
+#endif
+
+
+/***********************************************************************
+ *
+ * Globals
+ *
+ ***********************************************************************/
+
+static NPNetscapeFuncs gNetscapeFuncs; /* Netscape Function table */
+
+
+/***********************************************************************
+ *
+ * Wrapper functions : plugin calling Netscape Navigator
+ *
+ * These functions let the plugin developer just call the APIs
+ * as documented and defined in npapi.h, without needing to know
+ * about the function table and call macros in npupp.h.
+ *
+ ***********************************************************************/
+
+void
+NPN_Version(int* plugin_major, int* plugin_minor,
+ int* netscape_major, int* netscape_minor)
+{
+ *plugin_major = NP_VERSION_MAJOR;
+ *plugin_minor = NP_VERSION_MINOR;
+
+ /* Major version is in high byte */
+ *netscape_major = gNetscapeFuncs.version >> 8;
+ /* Minor version is in low byte */
+ *netscape_minor = gNetscapeFuncs.version & 0xFF;
+}
+
+NPError
+NPN_GetValue(NPP instance, NPNVariable variable, void *r_value)
+{
+ return CallNPN_GetValueProc(gNetscapeFuncs.getvalue,
+ instance, variable, r_value);
+}
+
+NPError
+NPN_SetValue(NPP instance, NPPVariable variable, void *value)
+{
+ return CallNPN_SetValueProc(gNetscapeFuncs.setvalue,
+ instance, variable, value);
+}
+
+NPError
+NPN_GetURL(NPP instance, const char* url, const char* window)
+{
+ return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
+}
+
+NPError
+NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
+{
+ return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
+}
+
+NPError
+NPN_PostURL(NPP instance, const char* url, const char* window,
+ uint32_t len, const char* buf, NPBool file)
+{
+ return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
+ url, window, len, buf, file);
+}
+
+NPError
+NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len,
+ const char* buf, NPBool file, void* notifyData)
+{
+ return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
+ instance, url, window, len, buf, file, notifyData);
+}
+
+NPError
+NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
+{
+ return CallNPN_RequestReadProc(gNetscapeFuncs.requestread,
+ stream, rangeList);
+}
+
+NPError
+NPN_NewStream(NPP instance, NPMIMEType type, const char *window,
+ NPStream** stream_ptr)
+{
+ return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance,
+ type, window, stream_ptr);
+}
+
+int32_t
+NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
+{
+ return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
+ stream, len, buffer);
+}
+
+NPError
+NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
+{
+ return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream,
+ instance, stream, reason);
+}
+
+void
+NPN_Status(NPP instance, const char* message)
+{
+ CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
+}
+
+const char*
+NPN_UserAgent(NPP instance)
+{
+ return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
+}
+
+void*
+NPN_MemAlloc(uint32_t size)
+{
+ return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
+}
+
+void NPN_MemFree(void* ptr)
+{
+ CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
+}
+
+uint32_t NPN_MemFlush(uint32_t size)
+{
+ return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
+}
+
+void NPN_ReloadPlugins(NPBool reloadPages)
+{
+ CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
+}
+
+#ifdef OJI
+JRIEnv* NPN_GetJavaEnv()
+{
+ return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv);
+}
+
+jref NPN_GetJavaPeer(NPP instance)
+{
+ return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer,
+ instance);
+}
+#endif
+
+void
+NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
+{
+ CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance,
+ invalidRect);
+}
+
+void
+NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
+{
+ CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance,
+ invalidRegion);
+}
+
+void
+NPN_ForceRedraw(NPP instance)
+{
+ CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance);
+}
+
+/***********************************************************************
+ *
+ * Wrapper functions : Netscape Navigator -> plugin
+ *
+ * These functions let the plugin developer just create the APIs
+ * as documented and defined in npapi.h, without needing to
+ * install those functions in the function table or worry about
+ * setting up globals for 68K plugins.
+ *
+ ***********************************************************************/
+
+NPError
+Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
+ int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
+{
+ NPError ret;
+ PLUGINDEBUGSTR("New");
+ ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
+ return ret;
+}
+
+NPError
+Private_Destroy(NPP instance, NPSavedData** save)
+{
+ PLUGINDEBUGSTR("Destroy");
+ return NPP_Destroy(instance, save);
+}
+
+NPError
+Private_SetWindow(NPP instance, NPWindow* window)
+{
+ NPError err;
+ PLUGINDEBUGSTR("SetWindow");
+ err = NPP_SetWindow(instance, window);
+ return err;
+}
+
+NPError
+Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
+ NPBool seekable, uint16_t* stype)
+{
+ NPError err;
+ PLUGINDEBUGSTR("NewStream");
+ err = NPP_NewStream(instance, type, stream, seekable, stype);
+ return err;
+}
+
+int32_t
+Private_WriteReady(NPP instance, NPStream* stream)
+{
+ unsigned int result;
+ PLUGINDEBUGSTR("WriteReady");
+ result = NPP_WriteReady(instance, stream);
+ return result;
+}
+
+int32_t
+Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len,
+ void* buffer)
+{
+ unsigned int result;
+ PLUGINDEBUGSTR("Write");
+ result = NPP_Write(instance, stream, offset, len, buffer);
+ return result;
+}
+
+void
+Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
+{
+ PLUGINDEBUGSTR("StreamAsFile");
+ NPP_StreamAsFile(instance, stream, fname);
+}
+
+
+NPError
+Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
+{
+ NPError err;
+ PLUGINDEBUGSTR("DestroyStream");
+ err = NPP_DestroyStream(instance, stream, reason);
+ return err;
+}
+
+void
+Private_URLNotify(NPP instance, const char* url,
+ NPReason reason, void* notifyData)
+
+{
+ PLUGINDEBUGSTR("URLNotify");
+ NPP_URLNotify(instance, url, reason, notifyData);
+}
+
+
+
+void
+Private_Print(NPP instance, NPPrint* platformPrint)
+{
+ PLUGINDEBUGSTR("Print");
+ NPP_Print(instance, platformPrint);
+}
+
+#ifdef OJI
+JRIGlobalRef
+Private_GetJavaClass(void)
+{
+ jref clazz = NPP_GetJavaClass();
+ if (clazz) {
+ JRIEnv* env = NPN_GetJavaEnv();
+ return JRI_NewGlobalRef(env, clazz);
+ }
+ return NULL;
+}
+#endif
+
+/***********************************************************************
+ *
+ * These functions are located automagically by netscape.
+ *
+ ***********************************************************************/
+
+/*
+ * NP_GetMIMEDescription
+ * - Netscape needs to know about this symbol
+ * - Netscape uses the return value to identify when an object instance
+ * of this plugin should be created.
+ */
+SAL_DLLPUBLIC_EXPORT char *
+NP_GetMIMEDescription(void)
+{
+ return (char *)NPP_GetMIMEDescription();
+}
+
+/*
+ * NP_GetValue [optional]
+ * - Netscape needs to know about this symbol.
+ * - Interfaces with plugin to get values for predefined variables
+ * that the navigator needs.
+ */
+SAL_DLLPUBLIC_EXPORT NPError
+NP_GetValue(void* future, NPPVariable variable, void *value)
+{
+ return NPP_GetValue(future, variable, value);
+}
+
+/*
+ * NP_Initialize
+ * - Netscape needs to know about this symbol.
+ * - It calls this function after looking up its symbol before it
+ * is about to create the first ever object of this kind.
+ *
+ * PARAMETERS
+ * nsTable - The netscape function table. If developers just use these
+ * wrappers, they dont need to worry about all these function
+ * tables.
+ * RETURN
+ * pluginFuncs
+ * - This functions needs to fill the plugin function table
+ * pluginFuncs and return it. Netscape Navigator plugin
+ * library will use this function table to call the plugin.
+ *
+ */
+SAL_DLLPUBLIC_EXPORT NPError
+NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
+{
+ NPError err = NPERR_NO_ERROR;
+
+ PLUGINDEBUGSTR("NP_Initialize");
+
+ /* validate input parameters */
+
+ if ((nsTable == NULL) || (pluginFuncs == NULL))
+ err = NPERR_INVALID_FUNCTABLE_ERROR;
+
+ /*
+ * Check the major version passed in Netscape's function table.
+ * We won't load if the major version is newer than what we expect.
+ * Also check that the function tables passed in are big enough for
+ * all the functions we need (they could be bigger, if Netscape added
+ * new APIs, but that's OK with us -- we'll just ignore them).
+ *
+ */
+
+ if (err == NPERR_NO_ERROR) {
+ if ((nsTable->version >> 8) > NP_VERSION_MAJOR)
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ if (nsTable->size < sizeof(NPNetscapeFuncs))
+ err = NPERR_INVALID_FUNCTABLE_ERROR;
+ if (pluginFuncs->size < sizeof(NPPluginFuncs))
+ err = NPERR_INVALID_FUNCTABLE_ERROR;
+ }
+
+
+ if (err == NPERR_NO_ERROR) {
+ /*
+ * Copy all the fields of Netscape function table into our
+ * copy so we can call back into Netscape later. Note that
+ * we need to copy the fields one by one, rather than assigning
+ * the whole structure, because the Netscape function table
+ * could actually be bigger than what we expect.
+ */
+ gNetscapeFuncs.version = nsTable->version;
+ gNetscapeFuncs.size = nsTable->size;
+ gNetscapeFuncs.posturl = nsTable->posturl;
+ gNetscapeFuncs.geturl = nsTable->geturl;
+ gNetscapeFuncs.geturlnotify = nsTable->geturlnotify;
+ gNetscapeFuncs.requestread = nsTable->requestread;
+ gNetscapeFuncs.newstream = nsTable->newstream;
+ gNetscapeFuncs.write = nsTable->write;
+ gNetscapeFuncs.destroystream = nsTable->destroystream;
+ gNetscapeFuncs.status = nsTable->status;
+ gNetscapeFuncs.uagent = nsTable->uagent;
+ gNetscapeFuncs.memalloc = nsTable->memalloc;
+ gNetscapeFuncs.memfree = nsTable->memfree;
+ gNetscapeFuncs.memflush = nsTable->memflush;
+ gNetscapeFuncs.reloadplugins = nsTable->reloadplugins;
+#ifdef OJI
+ gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv;
+ gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer;
+#endif
+ gNetscapeFuncs.getvalue = nsTable->getvalue;
+
+ /*
+ * Set up the plugin function table that Netscape will use to
+ * call us. Netscape needs to know about our version and size
+ * and have a UniversalProcPointer for every function we
+ * implement.
+ */
+ pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
+ pluginFuncs->size = sizeof(NPPluginFuncs);
+ pluginFuncs->newp = NewNPP_NewProc(Private_New);
+ pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy);
+ pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow);
+ pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream);
+ pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream);
+ pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile);
+ pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady);
+ pluginFuncs->write = NewNPP_WriteProc(Private_Write);
+ pluginFuncs->print = NewNPP_PrintProc(Private_Print);
+ pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
+ pluginFuncs->event = NULL;
+#ifdef OJI
+ pluginFuncs->javaClass = Private_GetJavaClass();
+#endif
+
+ err = NPP_Initialize();
+ }
+
+ return err;
+}
+
+/*
+ * NP_Shutdown [optional]
+ * - Netscape needs to know about this symbol.
+ * - It calls this function after looking up its symbol after
+ * the last object of this kind has been destroyed.
+ *
+ */
+SAL_DLLPUBLIC_EXPORT void
+NP_Shutdown(void)
+{
+ PLUGINDEBUGSTR("NP_Shutdown");
+ NPP_Shutdown();
+}
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * function call mechanics needed by platform specific glue code.
+ */
+
+
+#ifndef _NPUPP_H_
+#define _NPUPP_H_
+
+#ifndef GENERATINGCFM
+#define GENERATINGCFM 0
+#endif
+
+#ifndef _NPAPI_H_
+#include "npapi.h"
+#endif
+
+#include "jri.h"
+
+/******************************************************************************************
+ plug-in function table macros
+ for each function in and out of the plugin API we define
+ typedef NPP_FooUPP
+ #define NewNPP_FooProc
+ #define CallNPP_FooProc
+ for mac, define the UPP magic for PPC/68K calling
+ *******************************************************************************************/
+
+
+/* NPP_Initialize */
+
+#ifndef TARGET_RT_MAC_CFM
+#define TARGET_RT_MAC_CFM 0
+#endif
+
+#define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON)
+
+#if _NPUPP_USE_UPP_
+typedef UniversalProcPtr NPP_InitializeUPP;
+
+enum {
+ uppNPP_InitializeProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+
+#define NewNPP_InitializeProc(FUNC) \
+ (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture())
+#define CallNPP_InitializeProc(FUNC) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo)
+
+#else
+
+typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
+#define NewNPP_InitializeProc(FUNC) \
+ ((NPP_InitializeUPP) (FUNC))
+#define CallNPP_InitializeProc(FUNC) \
+ (*(FUNC))()
+
+#endif
+
+
+/* NPP_Shutdown */
+
+#if _NPUPP_USE_UPP_
+typedef UniversalProcPtr NPP_ShutdownUPP;
+
+enum {
+ uppNPP_ShutdownProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+
+#define NewNPP_ShutdownProc(FUNC) \
+ (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture())
+#define CallNPP_ShutdownProc(FUNC) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo)
+
+#else
+
+typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
+#define NewNPP_ShutdownProc(FUNC) \
+ ((NPP_ShutdownUPP) (FUNC))
+#define CallNPP_ShutdownProc(FUNC) \
+ (*(FUNC))()
+
+#endif
+
+
+/* NPP_New */
+
+#if _NPUPP_USE_UPP_
+typedef UniversalProcPtr NPP_NewUPP;
+
+enum {
+ uppNPP_NewProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16_t)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16_t)))
+ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **)))
+ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **)))
+ | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+
+#define NewNPP_NewProc(FUNC) \
+ (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture())
+#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \
+ (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+#else
+
+typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
+#define NewNPP_NewProc(FUNC) \
+ ((NPP_NewUPP) (FUNC))
+#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+
+#endif
+
+
+/* NPP_Destroy */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_DestroyUPP;
+enum {
+ uppNPP_DestroyProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_DestroyProc(FUNC) \
+ (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture())
+#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2))
+#else
+
+typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
+#define NewNPP_DestroyProc(FUNC) \
+ ((NPP_DestroyUPP) (FUNC))
+#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
+ (*(FUNC))((ARG1), (ARG2))
+
+#endif
+
+
+/* NPP_SetWindow */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_SetWindowUPP;
+enum {
+ uppNPP_SetWindowProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_SetWindowProc(FUNC) \
+ (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture())
+#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2))
+
+#else
+
+typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
+#define NewNPP_SetWindowProc(FUNC) \
+ ((NPP_SetWindowUPP) (FUNC))
+#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
+ (*(FUNC))((ARG1), (ARG2))
+
+#endif
+
+
+/* NPP_NewStream */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_NewStreamUPP;
+enum {
+ uppNPP_NewStreamProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool)))
+ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16_t *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_NewStreamProc(FUNC) \
+ (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture())
+#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
+#else
+
+typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
+#define NewNPP_NewStreamProc(FUNC) \
+ ((NPP_NewStreamUPP) (FUNC))
+#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
+#endif
+
+
+/* NPP_DestroyStream */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_DestroyStreamUPP;
+enum {
+ uppNPP_DestroyStreamProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_DestroyStreamProc(FUNC) \
+ (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture())
+#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg))
+
+#else
+
+typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
+#define NewNPP_DestroyStreamProc(FUNC) \
+ ((NPP_DestroyStreamUPP) (FUNC))
+#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
+ (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
+
+#endif
+
+
+/* NPP_WriteReady */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_WriteReadyUPP;
+enum {
+ uppNPP_WriteReadyProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(int32_t)))
+};
+#define NewNPP_WriteReadyProc(FUNC) \
+ (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture())
+#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
+ (int32_t)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr))
+
+#else
+
+typedef int32_t (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
+#define NewNPP_WriteReadyProc(FUNC) \
+ ((NPP_WriteReadyUPP) (FUNC))
+#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
+ (*(FUNC))((NPParg), (NPStreamPtr))
+
+#endif
+
+
+/* NPP_Write */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_WriteUPP;
+enum {
+ uppNPP_WriteProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32_t)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32_t)))
+ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(int32_t)))
+};
+#define NewNPP_WriteProc(FUNC) \
+ (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture())
+#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
+ (int32_t)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
+
+#else
+
+typedef int32_t (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
+#define NewNPP_WriteProc(FUNC) \
+ ((NPP_WriteUPP) (FUNC))
+#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
+ (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
+
+#endif
+
+
+/* NPP_StreamAsFile */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_StreamAsFileUPP;
+enum {
+ uppNPP_StreamAsFileProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+#define NewNPP_StreamAsFileProc(FUNC) \
+ (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture())
+#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3))
+
+#else
+
+typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname);
+#define NewNPP_StreamAsFileProc(FUNC) \
+ ((NPP_StreamAsFileUPP) (FUNC))
+#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3))
+#endif
+
+
+/* NPP_Print */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_PrintUPP;
+enum {
+ uppNPP_PrintProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *)))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+#define NewNPP_PrintProc(FUNC) \
+ (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture())
+#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr))
+
+#else
+
+typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
+#define NewNPP_PrintProc(FUNC) \
+ ((NPP_PrintUPP) (FUNC))
+#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \
+ (*(FUNC))((NPParg), (NPPrintArg))
+
+#endif
+
+
+/* NPP_HandleEvent */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_HandleEventUPP;
+enum {
+ uppNPP_HandleEventProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(int16_t)))
+};
+#define NewNPP_HandleEventProc(FUNC) \
+ (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture())
+#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
+ (int16_t)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr))
+
+#else
+
+typedef int16_t (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
+#define NewNPP_HandleEventProc(FUNC) \
+ ((NPP_HandleEventUPP) (FUNC))
+#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
+ (*(FUNC))((NPParg), (voidPtr))
+
+#endif
+
+
+/* NPP_URLNotify */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_URLNotifyUPP;
+enum {
+ uppNPP_URLNotifyProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
+ | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0)))
+};
+#define NewNPP_URLNotifyProc(FUNC) \
+ (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture())
+#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
+
+#else
+
+typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData);
+#define NewNPP_URLNotifyProc(FUNC) \
+ ((NPP_URLNotifyUPP) (FUNC))
+#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
+
+#endif
+
+
+/* NPP_GetValue */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_GetValueUPP;
+enum {
+ uppNPP_GetValueProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_GetValueProc(FUNC) \
+ (NPP_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_GetValueProcInfo, GetCurrentArchitecture())
+#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
+#else
+
+typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
+#define NewNPP_GetValueProc(FUNC) \
+ ((NPP_GetValueUPP) (FUNC))
+#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3))
+#endif
+
+
+/* NPP_SetValue */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_SetValueUPP;
+enum {
+ uppNPP_SetValueProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_SetValueProc(FUNC) \
+ (NPP_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetValueProcInfo, GetCurrentArchitecture())
+#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
+#else
+
+typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
+#define NewNPP_SetValueProc(FUNC) \
+ ((NPP_SetValueUPP) (FUNC))
+#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3))
+#endif
+
+
+
+
+/*
+ * Netscape entry points
+ */
+
+
+/* NPN_GetValue */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_GetValueUPP;
+enum {
+ uppNPN_GetValueProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_GetValueProc(FUNC) \
+ (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture())
+#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3))
+#else
+
+typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue);
+#define NewNPN_GetValueProc(FUNC) \
+ ((NPN_GetValueUPP) (FUNC))
+#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3))
+#endif
+
+
+/* NPN_SetValue */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_SetValueUPP;
+enum {
+ uppNPN_SetValueProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPVariable)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_SetValueProc(FUNC) \
+ (NPN_SetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_SetValueProcInfo, GetCurrentArchitecture())
+#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_SetValueProcInfo, (ARG1), (ARG2), (ARG3))
+#else
+
+typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable, void *ret_alue);
+#define NewNPN_SetValueProc(FUNC) \
+ ((NPN_SetValueUPP) (FUNC))
+#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3))
+#endif
+
+
+/* NPN_GetUrlNotify */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_GetURLNotifyUPP;
+enum {
+ uppNPN_GetURLNotifyProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_GetURLNotifyProc(FUNC) \
+ (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture())
+#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4))
+#else
+
+typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData);
+#define NewNPN_GetURLNotifyProc(FUNC) \
+ ((NPN_GetURLNotifyUPP) (FUNC))
+#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
+#endif
+
+
+/* NPN_PostUrlNotify */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_PostURLNotifyUPP;
+enum {
+ uppNPN_PostURLNotifyProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32_t)))
+ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
+ | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_PostURLNotifyProc(FUNC) \
+ (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture())
+#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+#else
+
+typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData);
+#define NewNPN_PostURLNotifyProc(FUNC) \
+ ((NPN_PostURLNotifyUPP) (FUNC))
+#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
+#endif
+
+
+/* NPN_GetUrl */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_GetURLUPP;
+enum {
+ uppNPN_GetURLProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_GetURLProc(FUNC) \
+ (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture())
+#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3))
+#else
+
+typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const char* window);
+#define NewNPN_GetURLProc(FUNC) \
+ ((NPN_GetURLUPP) (FUNC))
+#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3))
+#endif
+
+
+/* NPN_PostUrl */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_PostURLUPP;
+enum {
+ uppNPN_PostURLProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32_t)))
+ | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*)))
+ | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_PostURLProc(FUNC) \
+ (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture())
+#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
+#else
+
+typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file);
+#define NewNPN_PostURLProc(FUNC) \
+ ((NPN_PostURLUPP) (FUNC))
+#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
+ (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
+#endif
+
+
+/* NPN_RequestRead */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_RequestReadUPP;
+enum {
+ uppNPN_RequestReadProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_RequestReadProc(FUNC) \
+ (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture())
+#define CallNPN_RequestReadProc(FUNC, stream, range) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range))
+
+#else
+
+typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList);
+#define NewNPN_RequestReadProc(FUNC) \
+ ((NPN_RequestReadUPP) (FUNC))
+#define CallNPN_RequestReadProc(FUNC, stream, range) \
+ (*(FUNC))((stream), (range))
+
+#endif
+
+
+/* NPN_NewStream */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_NewStreamUPP;
+enum {
+ uppNPN_NewStreamProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_NewStreamProc(FUNC) \
+ (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture())
+#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream))
+
+#else
+
+typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
+#define NewNPN_NewStreamProc(FUNC) \
+ ((NPN_NewStreamUPP) (FUNC))
+#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
+ (*(FUNC))((npp), (type), (window), (stream))
+
+#endif
+
+
+/* NPN_Write */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_WriteUPP;
+enum {
+ uppNPN_WriteProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32_t)))
+ | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(int32_t)))
+};
+#define NewNPN_WriteProc(FUNC) \
+ (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture())
+#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
+ (int32_t)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer))
+
+#else
+
+typedef int32_t (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32_t len, void* buffer);
+#define NewNPN_WriteProc(FUNC) \
+ ((NPN_WriteUPP) (FUNC))
+#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
+ (*(FUNC))((npp), (stream), (len), (buffer))
+
+#endif
+
+
+/* NPN_DestroyStream */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_DestroyStreamUPP;
+enum {
+ uppNPN_DestroyStreamProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP )))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPN_DestroyStreamProc(FUNC) \
+ (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture())
+#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
+ (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason))
+
+#else
+
+typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason);
+#define NewNPN_DestroyStreamProc(FUNC) \
+ ((NPN_DestroyStreamUPP) (FUNC))
+#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
+ (*(FUNC))((npp), (stream), (reason))
+
+#endif
+
+
+/* NPN_Status */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_StatusUPP;
+enum {
+ uppNPN_StatusProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
+};
+
+#define NewNPN_StatusProc(FUNC) \
+ (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture())
+#define CallNPN_StatusProc(FUNC, npp, msg) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg))
+
+#else
+
+typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
+#define NewNPN_StatusProc(FUNC) \
+ ((NPN_StatusUPP) (FUNC))
+#define CallNPN_StatusProc(FUNC, npp, msg) \
+ (*(FUNC))((npp), (msg))
+
+#endif
+
+
+/* NPN_UserAgent */
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_UserAgentUPP;
+enum {
+ uppNPN_UserAgentProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
+};
+
+#define NewNPN_UserAgentProc(FUNC) \
+ (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture())
+#define CallNPN_UserAgentProc(FUNC, ARG1) \
+ (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1))
+
+#else
+
+typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
+#define NewNPN_UserAgentProc(FUNC) \
+ ((NPN_UserAgentUPP) (FUNC))
+#define CallNPN_UserAgentProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+/* NPN_MemAlloc */
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_MemAllocUPP;
+enum {
+ uppNPN_MemAllocProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32_t)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(void *)))
+};
+
+#define NewNPN_MemAllocProc(FUNC) \
+ (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture())
+#define CallNPN_MemAllocProc(FUNC, ARG1) \
+ (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1))
+
+#else
+
+typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32_t size);
+#define NewNPN_MemAllocProc(FUNC) \
+ ((NPN_MemAllocUPP) (FUNC))
+#define CallNPN_MemAllocProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+/* NPN__MemFree */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_MemFreeUPP;
+enum {
+ uppNPN_MemFreeProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *)))
+};
+
+#define NewNPN_MemFreeProc(FUNC) \
+ (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture())
+#define CallNPN_MemFreeProc(FUNC, ARG1) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1))
+
+#else
+
+typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
+#define NewNPN_MemFreeProc(FUNC) \
+ ((NPN_MemFreeUPP) (FUNC))
+#define CallNPN_MemFreeProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+/* NPN_MemFlush */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_MemFlushUPP;
+enum {
+ uppNPN_MemFlushProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32_t)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(uint32_t)))
+};
+
+#define NewNPN_MemFlushProc(FUNC) \
+ (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture())
+#define CallNPN_MemFlushProc(FUNC, ARG1) \
+ (uint32_t)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1))
+
+#else
+
+typedef uint32_t (* NP_LOADDS NPN_MemFlushUPP)(uint32_t size);
+#define NewNPN_MemFlushProc(FUNC) \
+ ((NPN_MemFlushUPP) (FUNC))
+#define CallNPN_MemFlushProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+
+/* NPN_ReloadPlugins */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_ReloadPluginsUPP;
+enum {
+ uppNPN_ReloadPluginsProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool)))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+
+#define NewNPN_ReloadPluginsProc(FUNC) \
+ (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture())
+#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1))
+
+#else
+
+typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
+#define NewNPN_ReloadPluginsProc(FUNC) \
+ ((NPN_ReloadPluginsUPP) (FUNC))
+#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+/* NPN_GetJavaEnv */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_GetJavaEnvUPP;
+enum {
+ uppNPN_GetJavaEnvProcInfo = kThinkCStackBased
+ | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*)))
+};
+
+#define NewNPN_GetJavaEnvProc(FUNC) \
+ (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture())
+#define CallNPN_GetJavaEnvProc(FUNC) \
+ (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo)
+
+#else
+typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
+#define NewNPN_GetJavaEnvProc(FUNC) \
+ ((NPN_GetJavaEnvUPP) (FUNC))
+#define CallNPN_GetJavaEnvProc(FUNC) \
+ (*(FUNC))()
+
+#endif
+
+
+/* NPN_GetJavaPeer */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_GetJavaPeerUPP;
+enum {
+ uppNPN_GetJavaPeerProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(jref)))
+};
+
+#define NewNPN_GetJavaPeerProc(FUNC) \
+ (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture())
+#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
+ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1))
+
+#else
+
+typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
+#define NewNPN_GetJavaPeerProc(FUNC) \
+ ((NPN_GetJavaPeerUPP) (FUNC))
+#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+/* NPN_InvalidateRect */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_InvalidateRectUPP;
+enum {
+ uppNPN_InvalidateRectProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRect *)))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+
+#define NewNPN_InvalidateRectProc(FUNC) \
+ (NPN_InvalidateRectUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, GetCurrentArchitecture())
+#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRectProcInfo, (ARG1), (ARG2))
+
+#else
+
+typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
+#define NewNPN_InvalidateRectProc(FUNC) \
+ ((NPN_InvalidateRectUPP) (FUNC))
+#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
+ (*(FUNC))((ARG1), (ARG2))
+
+#endif
+
+
+/* NPN_InvalidateRegion */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_InvalidateRegionUPP;
+enum {
+ uppNPN_InvalidateRegionProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPRegion)))
+ | RESULT_SIZE(SIZE_CODE(0))
+};
+
+#define NewNPN_InvalidateRegionProc(FUNC) \
+ (NPN_InvalidateRegionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, GetCurrentArchitecture())
+#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
+ (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_InvalidateRegionProcInfo, (ARG1), (ARG2))
+
+#else
+
+typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region);
+#define NewNPN_InvalidateRegionProc(FUNC) \
+ ((NPN_InvalidateRegionUPP) (FUNC))
+#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
+ (*(FUNC))((ARG1), (ARG2))
+
+#endif
+
+/* NPN_ForceRedraw */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPN_ForceRedrawUPP;
+enum {
+ uppNPN_ForceRedrawProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(0)))
+};
+
+#define NewNPN_ForceRedrawProc(FUNC) \
+ (NPN_ForceRedrawUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, GetCurrentArchitecture())
+#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
+ (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ForceRedrawProcInfo, (ARG1))
+
+#else
+
+typedef void (* NP_LOADDS NPN_ForceRedrawUPP)(NPP instance);
+#define NewNPN_ForceRedrawProc(FUNC) \
+ ((NPN_ForceRedrawUPP) (FUNC))
+#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
+ (*(FUNC))((ARG1))
+
+#endif
+
+
+/******************************************************************************************
+ * The actual plugin function table definitions
+ *******************************************************************************************/
+
+#ifdef XP_MAC
+#if PRAGMA_STRUCT_ALIGN
+#pragma options align=mac68k
+#endif
+#endif
+
+typedef struct _NPPluginFuncs {
+ uint16_t size;
+ uint16_t version;
+ NPP_NewUPP newp;
+ NPP_DestroyUPP destroy;
+ NPP_SetWindowUPP setwindow;
+ NPP_NewStreamUPP newstream;
+ NPP_DestroyStreamUPP destroystream;
+ NPP_StreamAsFileUPP asfile;
+ NPP_WriteReadyUPP writeready;
+ NPP_WriteUPP write;
+ NPP_PrintUPP print;
+ NPP_HandleEventUPP event;
+ NPP_URLNotifyUPP urlnotify;
+ JRIGlobalRef javaClass;
+ NPP_GetValueUPP getvalue;
+ NPP_SetValueUPP setvalue;
+} NPPluginFuncs;
+
+typedef struct _NPNetscapeFuncs {
+ uint16_t size;
+ uint16_t version;
+ NPN_GetURLUPP geturl;
+ NPN_PostURLUPP posturl;
+ NPN_RequestReadUPP requestread;
+ NPN_NewStreamUPP newstream;
+ NPN_WriteUPP write;
+ NPN_DestroyStreamUPP destroystream;
+ NPN_StatusUPP status;
+ NPN_UserAgentUPP uagent;
+ NPN_MemAllocUPP memalloc;
+ NPN_MemFreeUPP memfree;
+ NPN_MemFlushUPP memflush;
+ NPN_ReloadPluginsUPP reloadplugins;
+ NPN_GetJavaEnvUPP getJavaEnv;
+ NPN_GetJavaPeerUPP getJavaPeer;
+ NPN_GetURLNotifyUPP geturlnotify;
+ NPN_PostURLNotifyUPP posturlnotify;
+ NPN_GetValueUPP getvalue;
+ NPN_SetValueUPP setvalue;
+ NPN_InvalidateRectUPP invalidaterect;
+ NPN_InvalidateRegionUPP invalidateregion;
+ NPN_ForceRedrawUPP forceredraw;
+} NPNetscapeFuncs;
+
+#ifdef XP_MAC
+#if PRAGMA_STRUCT_ALIGN
+#pragma options align=reset
+#endif
+#endif
+
+
+#ifdef XP_MAC
+/******************************************************************************************
+ * Mac platform-specific plugin glue stuff
+ *******************************************************************************************/
+
+/*
+ * Main entry point of the plugin.
+ * This routine will be called when the plugin is loaded. The function
+ * tables are passed in and the plugin fills in the NPPluginFuncs table
+ * and NPPShutdownUPP for Netscape's use.
+ */
+
+#if _NPUPP_USE_UPP_
+
+typedef UniversalProcPtr NPP_MainEntryUPP;
+enum {
+ uppNPP_MainEntryProcInfo = kThinkCStackBased
+ | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*)))
+ | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*)))
+ | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*)))
+ | RESULT_SIZE(SIZE_CODE(sizeof(NPError)))
+};
+#define NewNPP_MainEntryProc(FUNC) \
+ (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture())
+#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
+ CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP))
+
+#else
+
+typedef NPError (* NP_LOADDS NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*);
+#define NewNPP_MainEntryProc(FUNC) \
+ ((NPP_MainEntryUPP) (FUNC))
+#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
+ (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
+
+#endif
+
+
+/*
+ * Mac version(s) of NP_GetMIMEDescription(const char *)
+ * These can be called to retrieve MIME information from the plugin dynamically
+ *
+ * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
+ * to get mime info from the plugin only on OSX and may not be supported
+ * in future version--use NP_GetMIMEDescription instead
+ */
+
+enum
+{
+ kBPSupportedMIMETypesStructVers_1 = 1
+};
+
+typedef struct _BPSupportedMIMETypes
+{
+ SInt32 structVersion; // struct version
+ Handle typeStrings; // STR# formated handle, allocated by plug-in
+ Handle infoStrings; // STR# formated handle, allocated by plug-in
+} BPSupportedMIMETypes;
+OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
+
+#if _NPUPP_USE_UPP_
+
+#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescriptionRD"
+typedef UniversalProcPtr NP_GetMIMEDescriptionUPP;
+enum {
+ uppNP_GetMIMEDescEntryProc = kThinkCStackBased
+ | RESULT_SIZE(SIZE_CODE(sizeof(const char *)))
+};
+#define NewNP_GetMIMEDescEntryProc(FUNC) \
+ (NP_GetMIMEDescriptionUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNP_GetMIMEDescEntryProc, GetCurrentArchitecture())
+#define CallNP_GetMIMEDescEntryProc(FUNC) \
+ (const char *)CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNP_GetMIMEDescEntryProc)
+
+
+#else // !_NPUPP_USE_UPP_
+
+ // NP_GetMIMEDescription
+#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
+typedef const char* (* NP_LOADDS NP_GetMIMEDescriptionUPP)();
+#define NewNP_GetMIMEDescEntryProc(FUNC) \
+ ((NP_GetMIMEDescriptionUPP) (FUNC))
+#define CallNP_GetMIMEDescEntryProc(FUNC) \
+ (*(FUNC))()
+// BP_GetSupportedMIMETypes
+typedef OSErr (* NP_LOADDS BP_GetSupportedMIMETypesUPP)(BPSupportedMIMETypes*, UInt32);
+#define NewBP_GetSupportedMIMETypesEntryProc(FUNC) \
+ ((BP_GetSupportedMIMETypesUPP) (FUNC))
+#define CallBP_GetMIMEDescEntryProc(FUNC, mimeInfo, flags) \
+ (*(FUNC))((mimeInfo), (flags))
+
+#endif
+#endif /* MAC */
+
+#if defined(_WINDOWS)
+#define OSCALL WINAPI
+#else
+#define OSCALL
+#endif
+
+#if defined( _WINDOWS )
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* plugin meta member functions */
+
+NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+
+NPError WINAPI NP_Initialize(NPNetscapeFuncs *aNPNFuncs);
+
+void WINAPI NP_Shutdown();
+
+char* NP_GetMIMEDescription();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS */
+
+#ifdef XP_UNIX
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* plugin meta member functions */
+
+char* NP_GetMIMEDescription(void);
+NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs);
+void NP_Shutdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* XP_UNIX */
+
+#endif /* _NPUPP_H_ */
--- /dev/null
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include "npapi.h"
+#include "npupp.h"
+#include "plugin.h"
+
+//\\// DEFINE
+#define NP_EXPORT
+
+//\\// GLOBAL DATA
+NPNetscapeFuncs* g_pNavigatorFuncs = 0;
+
+extern "C"
+{
+#ifdef OJI
+JRIGlobalRef Private_GetJavaClass(void);
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// Private_GetJavaClass (global function)
+//
+// Given a Java class reference (thru NPP_GetJavaClass) inform JRT
+// of this class existence
+//
+JRIGlobalRef
+Private_GetJavaClass(void)
+{
+ jref clazz = NPP_GetJavaClass();
+ if (clazz) {
+ JRIEnv* env = NPN_GetJavaEnv();
+ return JRI_NewGlobalRef(env, clazz);
+ }
+ return NULL;
+}
+#endif /* OJI */
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// PLUGIN DLL entry points
+//
+// These are the Windows specific DLL entry points. They must be exoprted
+//
+
+// we need these to be global since we have to fill one of its field
+// with a data (class) which requires knowlwdge of the navigator
+// jump-table. This jump table is known at Initialize time (NP_Initialize)
+// which is called after NP_GetEntryPoint
+static NPPluginFuncs* g_pluginFuncs;
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// NP_GetEntryPoints
+//
+// fills in the func table used by Navigator to call entry points in
+// plugin DLL. Note that these entry points ensure that DS is loaded
+// by using the NP_LOADDS macro, when compiling for Win16
+//
+NPError WINAPI NP_EXPORT
+NP_GetEntryPoints(NPPluginFuncs* pFuncs)
+{
+ // trap a NULL ptr
+ if(pFuncs == NULL)
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+
+ // if the plugin's function table is smaller than the plugin expects,
+ // then they are incompatible, and should return an error
+
+ pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
+ pFuncs->newp = NPP_New;
+ pFuncs->destroy = NPP_Destroy;
+ pFuncs->setwindow = NPP_SetWindow;
+ pFuncs->newstream = NPP_NewStream;
+ pFuncs->destroystream = NPP_DestroyStream;
+ pFuncs->asfile = NPP_StreamAsFile;
+ pFuncs->writeready = NPP_WriteReady;
+ pFuncs->write = NPP_Write;
+ pFuncs->print = NPP_Print;
+ pFuncs->event = 0; /// reserved
+
+ g_pluginFuncs = pFuncs;
+
+ return NPERR_NO_ERROR;
+}
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// NP_Initialize
+//
+// called immediately after the plugin DLL is loaded
+//
+NPError WINAPI NP_EXPORT
+NP_Initialize(NPNetscapeFuncs* pFuncs)
+{
+ // trap a NULL ptr
+ if(pFuncs == NULL)
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+
+ g_pNavigatorFuncs = pFuncs; // save it for future reference
+
+ // if the plugin's major ver level is lower than the Navigator's,
+ // then they are incompatible, and should return an error
+ if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
+
+ // We have to defer these assignments until g_pNavigatorFuncs is set
+ int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+
+ if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+ g_pluginFuncs->urlnotify = NPP_URLNotify;
+ }
+
+#ifdef OJI
+ if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
+ g_pluginFuncs->javaClass = Private_GetJavaClass();
+ }
+#endif
+
+ return NPP_Initialize();
+}
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// NP_Shutdown
+//
+// called immediately before the plugin DLL is unloaded.
+// This functio shuold check for some ref count on the dll to see if it is
+// unloadable or it needs to stay in memory.
+//
+void WINAPI NP_EXPORT
+NP_Shutdown()
+{
+ NPP_Shutdown();
+ g_pNavigatorFuncs = NULL;
+}
+
+char * NP_GetMIMEDescription()
+{
+ return (char *)NPP_GetMIMEDescription();
+}
+
+// END - PLUGIN DLL entry points
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+
+/* NAVIGATOR Entry points */
+
+/* These entry points expect to be called from within the plugin. The
+ noteworthy assumption is that DS has already been set to point to the
+ plugin's DLL data segment. Don't call these functions from outside
+ the plugin without ensuring DS is set to the DLLs data segment first,
+ typically using the NP_LOADDS macro
+*/
+
+/* returns the major/minor version numbers of the Plugin API for the plugin
+ and the Navigator
+*/
+void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
+{
+ *plugin_major = NP_VERSION_MAJOR;
+ *plugin_minor = NP_VERSION_MINOR;
+ *netscape_major = HIBYTE(g_pNavigatorFuncs->version);
+ *netscape_minor = LOBYTE(g_pNavigatorFuncs->version);
+}
+
+NPError NPN_GetValue(NPP instance, NPNVariable variable, void *result)
+{
+ return g_pNavigatorFuncs->getvalue(instance, variable, result);
+}
+
+
+/* causes the specified URL to be fetched and streamed in
+*/
+NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData)
+
+{
+ int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+ if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+ err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+
+NPError NPN_GetURL(NPP instance, const char *url, const char *target)
+{
+ return g_pNavigatorFuncs->geturl(instance, url, target);
+}
+
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData)
+{
+ int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+ if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+ err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+
+NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file)
+{
+ return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
+}
+
+/* Requests that a number of bytes be provided on a stream. Typically
+ this would be used if a stream was in "pull" mode. An optional
+ position can be provided for streams which are seekable.
+*/
+NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
+{
+ return g_pNavigatorFuncs->requestread(stream, rangeList);
+}
+
+/* Creates a new stream of data from the plug-in to be interpreted
+ by Netscape in the current window.
+*/
+NPError NPN_NewStream(NPP instance, NPMIMEType type,
+ const char* target, NPStream** stream)
+{
+ int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+
+ if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+ err = g_pNavigatorFuncs->newstream(instance, type, target, stream);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+/* Provides len bytes of data.
+*/
+int32_t NPN_Write(NPP instance, NPStream *stream,
+ int32_t len, void *buffer)
+{
+ int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+ int32_t result;
+
+ if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+ result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
+ }
+ else {
+ result = -1;
+ }
+ return result;
+}
+
+/* Closes a stream object.
+reason indicates why the stream was closed.
+*/
+NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
+{
+ int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+
+ if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+ err = g_pNavigatorFuncs->destroystream(instance, stream, reason);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+/* Provides a text status message in the Netscape client user interface
+*/
+void NPN_Status(NPP instance, const char *message)
+{
+ g_pNavigatorFuncs->status(instance, message);
+}
+
+/* returns the user agent string of Navigator, which contains version info
+*/
+const char* NPN_UserAgent(NPP instance)
+{
+ return g_pNavigatorFuncs->uagent(instance);
+}
+
+/* allocates memory from the Navigator's memory space. Necessary so that
+ saved instance data may be freed by Navigator when exiting.
+*/
+
+
+void* NPN_MemAlloc(uint32_t size)
+{
+ return g_pNavigatorFuncs->memalloc(size);
+}
+
+/* reciprocal of MemAlloc() above
+*/
+void NPN_MemFree(void* ptr)
+{
+ g_pNavigatorFuncs->memfree(ptr);
+}
+
+#ifdef OJI
+/* private function to Netscape. do not use!
+*/
+void NPN_ReloadPlugins(NPBool reloadPages)
+{
+ g_pNavigatorFuncs->reloadplugins(reloadPages);
+}
+
+JRIEnv* NPN_GetJavaEnv(void)
+{
+ return g_pNavigatorFuncs->getJavaEnv();
+}
+
+jref NPN_GetJavaPeer(NPP instance)
+{
+ return g_pNavigatorFuncs->getJavaPeer(instance);
+}
+#endif
+} //end of extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--- /dev/null
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_NP_SDK_MOZSRC_PLUGIN_H
+#define INCLUDED_NP_SDK_MOZSRC_PLUGIN_H
+
+#include "npapi.h"
+
+/* OpenOffice.org/LibreOffice modified the implementations of NP_Initialize and
+ NP_Shutdown in external/np_sdk/npsdk/ to call NPP_Initialize and NPP_Shutdown, resp.,
+ defined in extensions/source/nsplugin/source/npshell.cxx:
+*/
+
+#if defined __cplusplus
+extern "C" {
+#endif
+
+NPError NPP_Initialize(void);
+
+void NPP_Shutdown(void);
+
+#if defined __cplusplus
+}
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,nss,nss))
+
+$(eval $(call gb_ExternalPackage_use_external_project,nss,nss))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
+ dist/out/lib/libfreebl3.dylib \
+ dist/out/lib/libnspr4.dylib \
+ dist/out/lib/libnss3.dylib \
+ dist/out/lib/libnssckbi.dylib \
+ dist/out/lib/libnssdbm3.dylib \
+ dist/out/lib/libnssutil3.dylib \
+ dist/out/lib/libplc4.dylib \
+ dist/out/lib/libplds4.dylib \
+ dist/out/lib/libsmime3.dylib \
+ dist/out/lib/libsoftokn3.dylib \
+ dist/out/lib/libssl3.dylib \
+ $(if $(filter 1050,$(MAC_OS_X_VERSION_MIN_REQUIRED)),dist/out/lib/libsqlite3.dylib) \
+))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
+ dist/out/lib/freebl3.dll \
+ dist/out/lib/nspr4.dll \
+ dist/out/lib/nss3.dll \
+ dist/out/lib/nssckbi.dll \
+ dist/out/lib/nssdbm3.dll \
+ dist/out/lib/nssutil3.dll \
+ dist/out/lib/plc4.dll \
+ dist/out/lib/plds4.dll \
+ dist/out/lib/smime3.dll \
+ dist/out/lib/softokn3.dll \
+ dist/out/lib/sqlite3.dll \
+ dist/out/lib/ssl3.dll \
+))
+else # OS!=WNT/MACOSX
+$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
+ dist/out/lib/libfreebl3.so \
+ dist/out/lib/libnspr4.so \
+ dist/out/lib/libnss3.so \
+ dist/out/lib/libnssckbi.so \
+ dist/out/lib/libnssdbm3.so \
+ dist/out/lib/libnssutil3.so \
+ dist/out/lib/libplc4.so \
+ dist/out/lib/libplds4.so \
+ dist/out/lib/libsmime3.so \
+ dist/out/lib/libsoftokn3.so \
+ dist/out/lib/libssl3.so \
+ dist/out/lib/libsqlite3.so \
+))
+endif
+
+ifeq ($(SYSTEM_CURL),)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
+ dist/out/lib/libnsspem.dylib \
+))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
+ dist/out/lib/nsspem.dll \
+))
+else # OS!=WNT/MACOSX
+$(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
+ dist/out/lib/libnsspem.so \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,nss))
+
+$(eval $(call gb_ExternalProject_register_targets,nss,\
+ configure \
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,nss,configure):
+ $(call gb_ExternalProject_run,configure,\
+ $(if $(filter MSC,$(COM)),LIB="$(ILIB)") \
+ nspr/configure --includedir=$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MSC-X86_64,$(COM)-$(CPUNAME)),--enable-64bit) \
+ ,,nss_configure.log)
+
+ifeq ($(OS),WNT)
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure) $(call gb_ExternalExecutable_get_dependencies,python)
+ $(call gb_ExternalProject_run,build,\
+ $(if $(MSVC_USE_DEBUG_RUNTIME),USE_DEBUG_RTL=1,BUILD_OPT=1) \
+ MOZ_MSVCVERSION=9 OS_TARGET=WIN95 \
+ $(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
+ LIB="$(ILIB)" \
+ XCFLAGS="$(SOLARINC)" \
+ $(MAKE) -j1 nss_build_all RC="rc.exe $(SOLARINC)" \
+ NSINSTALL='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
+ ,nss)
+
+
+else
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure) $(call gb_ExternalExecutable_get_dependencies,python)
+ $(call gb_ExternalProject_run,build,\
+ $(MAKE) -j1 nss_build_all \
+ NS_USE_GCC=1 \
+ CC="$(CC) $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ CXX="$(CXX) $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ OS_LIBS="-ladvapi32 -lws2_32 -lmswsock -lwinmm $(if $(MINGW_SHARED_GXXLIB),$(MINGW_SHARED_LIBSTDCPP))" \
+ LDFLAGS="" \
+ PATH="$(PATH)" \
+ RANLIB="$(RANLIB)" \
+ OS_TARGET=WINNT RC="$(WINDRES)" OS_RELEASE="5.0" \
+ IMPORT_LIB_SUFFIX=dll.a \
+ NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --enable-shared --disable-static" \
+ NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py" \
+ && rm -f $(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/lib/*.a \
+ ,nss)
+
+endif
+else # OS!=WNT
+$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject_get_state_target,nss,configure) $(call gb_ExternalExecutable_get_dependencies,python)
+ $(call gb_ExternalProject_run,build,\
+ $(if $(filter FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \
+ $(if $(filter MACOSX,$(OS)),MACOS_SDK_DIR=$(MACOSX_SDK_PATH) \
+ $(if $(filter 1050,$(MAC_OS_X_VERSION_MIN_REQUIRED)),,NSS_USE_SYSTEM_SQLITE=1)) \
+ $(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \
+ $(if $(CROSS_COMPILING),\
+ $(if $(filter MACOSXPOWERPC,$(OS)$(CPUNAME)),CPU_ARCH=ppc) \
+ NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py") \
+ NSDISTMODE=copy \
+ $(MAKE) -j1 AR="$(AR)" RANLIB="$(RANLIB)" NMEDIT="$(NM)edit" nss_build_all \
+ && rm -f $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.a \
+ $(if $(filter MACOSX,$(OS)),\
+ && chmod u+w $(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/*.dylib \
+ && $(PERL) \
+ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libfreebl3.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnspr4.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnss3.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnssckbi.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnssdbm3.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libnssutil3.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libplc4.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libplds4.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libsmime3.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libsoftokn3.dylib \
+ $(gb_Package_SOURCEDIR_nss)/dist/out/lib/libssl3.dylib) \
+ ,nss)
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,nss))
+
+ifeq ($(SYSTEM_NSS),)
+ifeq ($(filter ANDROID IOS,$(OS)),)
+$(eval $(call gb_Module_add_targets,nss,\
+ UnpackedTarball_nss \
+ ExternalPackage_nss \
+ ExternalProject_nss \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Contains the security libraries which are also part of [[moz]]. However nss is meant to be more current.
+
+== Relation between nss, moz, moz_prebuilt ==
+
+nss contains the security libraries which are also part of moz. However nss is
+meant to be more current, that is it to be updated more often. This should be
+easier than doing this with moz.
+
+If nss is built depends on an environment variable (SYSTEM_NSS=NO) which
+is per default set to YES. In this case nss is build before moz. The nss
+libraries/lib files/headers built in moz are then not delivered. Otherwise they
+would overwrite those from nss. That is, the nss libraries build in moz are
+removed from mozruntime.zip (build in moz/solver/bin), they are removed from the
+lib directory (for example moz/unxlngi6.pro/lib), and the nss and nspr headers
+are also removed (inc/nss and inc/nspr). The nss libraries from the nss module
+are then added to mozruntime.zip.
+
+This also applies for moz_prebuilt. Therefore moz and moz_prebuilt must be build
+again after changes have been made to the libraries in the nss module.
+
+Also when moz was updated to use a newer version of mozilla, then one must make
+sure that new files which also belong to nss are not delivered and are removed
+from mozruntime.zip.
+
+
+== Fips 140 and signed libraries ==
+
+Fips 140 mode is not supported. That is, the *.chk files containing the
+checksums for the cryptographic module are not delivered into solver and will
+not be part of the OOo installation sets.
+
+Signing has been turned off because
+- we change the rpath (install names) after signing which breaks the signatures
+(Mac)
+- sqlite conflicts with the system sqlite when signing which breaks the build
+
+
+== libfreebl3 ==
+
+Porting to other platforms may require to deliver other variants of
+libfreebl*. The library name varies according to the platform. Changes need to
+be made to
+ooo/moz/extractfiles.mk
+ooo/moz/zipped/makefile.mk
+sun/moz_prebuilt/zipped/makefile.mk
+
+See also
+[http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html]
+
+
+== Windows builds of nss ==
+
+To build mozilla on windows you'll need the mozilla build tools
+
+Build requirements containing the link to the build tools:
+[https://developer.mozilla.org/en/Windows_Build_Prerequisites#ss2.2]
+
+The direct link:
+[http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe]
+
+
+== libsqlite3 ==
+
+The system sqlite in Mac OS X versions older than 10.6 is incompatible
+with the softokn3 in nss which requires a later version of sqlite.
+With SDK 10.6 (and more current SDK) we use
+NSS_USE_SYSTEM_SQLITE=1
+to build using the system sqlite.
+
+The problem described here was found on Mac with OS 10.6
+We cannot deliver sqlite in the lib directory of the solver. This directory is
+used by tools of the build environment. Using the sqlite from NSS breaks the
+tools if they use system libraries which are linked with the system
+sqlite. Therefore we deliver it into lib/sqlite on unix systems.
+
+See also issue:
+[https://issues.apache.org/ooo/show_bug.cgi?id=106132]
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,nss))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,nss,$(NSS_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,nss,\
+ external/nss/nss.patch \
+ external/nss/nss.aix.patch \
+ external/nss/nss-3.13.5-zlib-werror.patch \
+ external/nss/nss_macosx.patch \
+ external/nss/nss-linux-x86.patch.0 \
+ $(if $(filter WNTMSC,$(OS)$(COM)),external/nss/nss.windows.patch) \
+ $(if $(filter WNTGCC,$(OS)$(COM)),external/nss/nspr-4.9-build.patch.3 \
+ external/nss/nss-3.13.3-build.patch.3 \
+ external/nss/nss.mingw.patch.3) \
+))
+
+# nss-pem is only needed for internal curl to read the NSS CA database
+ifeq ($(SYSTEM_CURL),)
+$(eval $(call gb_UnpackedTarball_add_patches,nss,\
+ external/nss/nss-pem.patch \
+))
+endif
+
+ifeq ($(COM_GCC_IS_CLANG)$(filter -fsanitize=address,$(CC)),TRUE-fsanitize=address)
+$(eval $(call gb_UnpackedTarball_add_patches,nss,\
+ external/nss/asan.patch.1 \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff -ur nss.org/nss/coreconf/Linux.mk nss/nss/coreconf/Linux.mk
+--- nss.org/nss/coreconf/Linux.mk 2014-05-06 04:36:01.817838877 +0200
++++ nss/nss/coreconf/Linux.mk 2014-05-06 04:37:25.387835456 +0200
+@@ -145,7 +145,7 @@
+ # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
+ # incorrectly reports undefined references in the libraries we link with, so
+ # we don't use -z defs there.
+-ZDEFS_FLAG = -Wl,-z,defs
++ZDEFS_FLAG =
+ DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
+ LDFLAGS += $(ARCHFLAG)
+
--- /dev/null
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation.
+# Portions created by the Initial Developer are Copyright (C) 2007
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Axel Hecht <axel@pike.org>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+# This is a partial python port of nsinstall.
+# It's intended to be used when there's no natively compile nsinstall
+# available, and doesn't intend to be fully equivalent.
+# Its major use is for l10n repackaging on systems that don't have
+# a full build environment set up.
+# The basic limitation is, it doesn't even try to link and ignores
+# all related options.
+
+from optparse import OptionParser
+import os
+import os.path
+import sys
+import shutil
+
+def nsinstall(argv):
+ usage = "usage: %prog [options] arg1 [arg2 ...] target-directory"
+ p = OptionParser(usage=usage)
+
+ p.add_option('-D', action="store_true",
+ help="Create a single directory only")
+ p.add_option('-t', action="store_true",
+ help="Preserve time stamp")
+ p.add_option('-m', action="store",
+ help="Set mode", metavar="mode")
+ p.add_option('-d', action="store_true",
+ help="Create directories in target")
+ p.add_option('-R', action="store_true",
+ help="Use relative symbolic links (ignored)")
+ p.add_option('-l', action="store_true",
+ help="Create link (ignored)")
+ p.add_option('-L', action="store", metavar="linkprefix",
+ help="Link prefix (ignored)")
+
+ # The remaining arguments are not used in our tree, thus they're not
+ # implented.
+ def BadArg(option, opt, value, parser):
+ parser.error('option not supported: %s' % opt)
+
+ p.add_option('-C', action="callback", metavar="CWD",
+ callback=BadArg,
+ help="NOT SUPPORTED")
+ p.add_option('-o', action="callback", callback=BadArg,
+ help="Set owner (NOT SUPPORTED)", metavar="owner")
+ p.add_option('-g', action="callback", callback=BadArg,
+ help="Set group (NOT SUPPORTED)", metavar="group")
+
+ (options, args) = p.parse_args(argv)
+
+ if options.m:
+ # mode is specified
+ try:
+ options.m = int(options.m, 8)
+ # I have no idea why nss insists on using this mode for installed headers.
+ # It causes problems with updating the files during a rebuild.
+ if options.m == 0o444:
+ options.m = 0o644
+ except:
+ sys.stderr.write('nsinstall: ' + options.m + ' is not a valid mode\n')
+ return 1
+
+ # just create one directory?
+ if options.D:
+ if len(args) != 1:
+ return 1
+ if os.path.exists(args[0]):
+ if not os.path.isdir(args[0]):
+ sys.stderr.write('nsinstall: ' + args[0] + ' is not a directory\n')
+ sys.exit(1)
+ if options.m:
+ os.chmod(args[0], options.m)
+ sys.exit()
+ if options.m:
+ os.makedirs(args[0], options.m)
+ else:
+ os.makedirs(args[0])
+ return 0
+
+ # nsinstall arg1 [...] directory
+ if len(args) < 2:
+ p.error('not enough arguments')
+
+ def copy_all_entries(entries, target):
+ for e in entries:
+ dest = os.path.join(target,
+ os.path.basename(os.path.normpath(e)))
+ handleTarget(e, dest)
+ if options.m:
+ os.chmod(dest, options.m)
+
+ # set up handler
+ if options.d:
+ # we're supposed to create directories
+ def handleTarget(srcpath, targetpath):
+ # target directory was already created, just use mkdir
+ os.mkdir(targetpath)
+ else:
+ # we're supposed to copy files
+ def handleTarget(srcpath, targetpath):
+ if os.path.isdir(srcpath):
+ if not os.path.exists(targetpath):
+ os.mkdir(targetpath)
+ entries = [os.path.join(srcpath, e) for e in os.listdir(srcpath)]
+ copy_all_entries(entries, targetpath)
+ # options.t is not relevant for directories
+ if options.m:
+ os.chmod(targetpath, options.m)
+ elif options.t:
+ if os.path.exists(targetpath):
+ os.remove(targetpath)
+ shutil.copy2(srcpath, targetpath)
+ else:
+ if os.path.exists(targetpath):
+ os.chmod(targetpath, 0o755)
+ os.remove(targetpath)
+ shutil.copy(srcpath, targetpath)
+
+ # the last argument is the target directory
+ target = args.pop()
+ # ensure target directory
+ if not os.path.isdir(target):
+ os.makedirs(target)
+
+ copy_all_entries(args, target)
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(nsinstall(sys.argv[1:]))
--- /dev/null
+--- a/a/a/nspr/config/autoconf.mk.in 2011-08-29 19:02:51.000000000 +0200
++++ a/a/a/nspr/config/autoconf.mk.in 2012-03-22 11:24:22.137097336 +0100
+@@ -27,6 +27,7 @@
+ OBJ_SUFFIX = $(error config/config.mk needs to be included before using OBJ_SUFFIX)
+ _OBJ_SUFFIX = @OBJ_SUFFIX@
+ LIB_SUFFIX = @LIB_SUFFIX@
++IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
+ DLL_SUFFIX = @DLL_SUFFIX@
+ ASM_SUFFIX = @ASM_SUFFIX@
+ MOD_NAME = @NSPR_MODNAME@
+--- a/a/a/nspr/config/rules.mk 2011-08-29 19:02:51.000000000 +0200
++++ a/a/a/nspr/config/rules.mk 2012-03-22 11:24:22.138097311 +0100
+@@ -115,21 +115,21 @@
+ #
+
+ ifdef LIBRARY_NAME
+-ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
++ifeq (,$(filter-out Linux WIN95 WINNT WINCE OS2,$(OS_ARCH)))
+
+ #
+ # Win95 and OS/2 require library names conforming to the 8.3 rule.
+ # other platforms do not.
+ #
+-ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET)))
++ifeq (,$(filter-out WIN95 WINCE WINMO WINNT OS2,$(OS_TARGET)))
+ LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+ SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+ SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
+ else
+ LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+ SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+ SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
+ endif
+
+--- a/a/a/nspr/configure 2012-02-14 20:06:00.000000000 +0100
++++ a/a/a/nspr/configure 2012-03-22 11:24:22.139097286 +0100
+@@ -3034,6 +3034,7 @@
+
+ OBJ_SUFFIX=o
+ LIB_SUFFIX=a
++IMPORT_LIB_SUFFIX=$IMPORT_LIB_SUFFIX
+ DLL_SUFFIX=so
+ ASM_SUFFIX=s
+ MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
+@@ -4536,6 +4537,7 @@
+ CC="$CC -mwindows"
+ CXX="$CXX -mwindows"
+ DLL_SUFFIX=dll
++ IMPORT_LIB_SUFFIX=dll.a
+ MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
+ RC=$WINDRES
+ # Use temp file for windres (bug 213281)
+@@ -4552,6 +4554,7 @@
+ GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
+ OBJ_SUFFIX=obj
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+
+ # Determine compiler version
+@@ -4661,11 +4664,11 @@
+
+ if test "$OS_TARGET" = "WINNT"; then
+ CFLAGS="$CFLAGS -GT"
+- LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
+- LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
++ LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
++ LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
+ else
+- LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
+- LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
++ LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
++ LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
+ fi
+ fi # GNU_CC
+
+@@ -4775,6 +4778,7 @@
+
+ OBJ_SUFFIX=obj
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+ MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
+
+@@ -4782,8 +4786,8 @@
+ RESOLVE_LINK_SYMBOLS=1
+
+ MDCPUCFG_H=_win95.cfg
+- LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
+- LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
++ LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
++ LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
+
+ DLLFLAGS='-OUT:"$@"'
+ if test -n "$MOZ_DEBUG_SYMBOLS"; then
+@@ -5584,6 +5588,7 @@
+
+ USE_PTHREADS=1
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+ MKSHLIB=
+ DSO_LDOPTS=
+@@ -5668,6 +5673,7 @@
+ EOF
+
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+ RC=rc.exe
+ PR_MD_ARCH_DIR=os2
+@@ -6966,6 +6972,7 @@
+ s%@CPU_ARCH@%$CPU_ARCH%g
+ s%@OBJ_SUFFIX@%$OBJ_SUFFIX%g
+ s%@LIB_SUFFIX@%$LIB_SUFFIX%g
++s%@IMPORT_LIB_SUFFIX@%$IMPORT_LIB_SUFFIX%g
+ s%@DLL_SUFFIX@%$DLL_SUFFIX%g
+ s%@ASM_SUFFIX@%$ASM_SUFFIX%g
+ s%@WRAP_LDFLAGS@%$WRAP_LDFLAGS%g
+--- a/a/a/nspr/configure.in 2012-02-14 20:06:00.000000000 +0100
++++ a/a/a/nspr/configure.in 2012-03-22 11:24:22.139097286 +0100
+@@ -834,6 +834,7 @@
+ dnl ========================================================
+ OBJ_SUFFIX=o
+ LIB_SUFFIX=a
++IMPORT_LIB_SUFFIX=$(IMPORT_LIB_SUFFIX)
+ DLL_SUFFIX=so
+ ASM_SUFFIX=s
+ MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
+@@ -1901,6 +1902,7 @@
+ CC="$CC -mwindows"
+ CXX="$CXX -mwindows"
+ DLL_SUFFIX=dll
++ IMPORT_LIB_SUFFIX=dll.a
+ MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
+ RC=$WINDRES
+ # Use temp file for windres (bug 213281)
+@@ -1917,6 +1919,7 @@
+ GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
+ OBJ_SUFFIX=obj
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+
+ # Determine compiler version
+@@ -2014,11 +2017,11 @@
+
+ if test "$OS_TARGET" = "WINNT"; then
+ CFLAGS="$CFLAGS -GT"
+- LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
+- LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
++ LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
++ LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
+ else
+- LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
+- LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
++ LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
++ LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
+ fi
+ fi # GNU_CC
+
+@@ -2089,6 +2092,7 @@
+
+ OBJ_SUFFIX=obj
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+ MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
+
+@@ -2096,8 +2100,8 @@
+ RESOLVE_LINK_SYMBOLS=1
+
+ MDCPUCFG_H=_win95.cfg
+- LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
+- LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
++ LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
++ LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(IMPORT_LIB_SUFFIX)'
+
+ DLLFLAGS='-OUT:"$@"'
+ if test -n "$MOZ_DEBUG_SYMBOLS"; then
+@@ -2576,6 +2580,7 @@
+ AC_DEFINE(HAVE_SOCKLEN_T)
+ USE_PTHREADS=1
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+ MKSHLIB=
+ DSO_LDOPTS=
+@@ -2630,6 +2635,7 @@
+ AC_DEFINE(BSD_SELECT)
+ AC_DEFINE(TCPV40HDRS)
+ LIB_SUFFIX=lib
++ IMPORT_LIB_SUFFIX=lib
+ DLL_SUFFIX=dll
+ RC=rc.exe
+ PR_MD_ARCH_DIR=os2
+@@ -3291,6 +3297,7 @@
+
+ AC_SUBST(OBJ_SUFFIX)
+ AC_SUBST(LIB_SUFFIX)
++AC_SUBST(IMPORT_LIB_SUFFIX)
+ AC_SUBST(DLL_SUFFIX)
+ AC_SUBST(ASM_SUFFIX)
+ AC_SUBST(WRAP_LDFLAGS)
+--- a/a/a/nspr/pr/include/md/_win95.cfg 2010-01-27 03:45:49.000000000 +0100
++++ a/a/a/nspr/pr/include/md/_win95.cfg 2012-03-22 11:24:22.139097286 +0100
+@@ -106,7 +106,7 @@
+ #define PR_BYTES_PER_WORD_LOG2 2
+ #define PR_BYTES_PER_DWORD_LOG2 3
+
+-#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
++#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) || defined (_WIN64)
+
+ #define IS_LITTLE_ENDIAN 1
+ #undef IS_BIG_ENDIAN
+--- a/a/a/nspr/pr/include/md/_winnt.cfg 2010-01-27 03:45:49.000000000 +0100
++++ a/a/a/nspr/pr/include/md/_winnt.cfg 2012-03-22 11:24:22.140097261 +0100
+@@ -100,7 +100,7 @@
+ #define PR_BYTES_PER_WORD_LOG2 2
+ #define PR_BYTES_PER_DWORD_LOG2 2
+
+-#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
++#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) || defined (_WIN64)
+
+ #define IS_LITTLE_ENDIAN 1
+ #undef IS_BIG_ENDIAN
+--- a/a/a/nspr/pr/src/Makefile.in 2011-09-22 17:21:06.000000000 +0200
++++ a/a/a/nspr/pr/src/Makefile.in 2012-03-22 11:24:22.140097261 +0100
+@@ -9,6 +9,9 @@
+ topsrcdir = @top_srcdir@
+ srcdir = @srcdir@
+ VPATH = @srcdir@
++
++LIBRARY_NAME = nspr
++LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
+
+ include $(MOD_DEPTH)/config/autoconf.mk
+
+@@ -200,9 +200,9 @@
+
+ ifeq ($(OS_ARCH),WINNT)
+ ifdef NS_USE_GCC
+-OS_LIBS = -ladvapi32 -lwsock32 -lwinmm
++OS_LIBS = -ladvapi32 -lws2_32 -lmswsock -lwinmm
+ else
+-OS_LIBS = advapi32.lib wsock32.lib winmm.lib
++OS_LIBS = advapi32.lib ws2_32.lib mswsock.lib winmm.lib
+ endif
+ endif
+
+@@ -291,8 +291,6 @@
+ include $(srcdir)/bthreads/objs.mk
+ endif
+
+-LIBRARY_NAME = nspr
+-LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
+
+ RELEASE_LIBS = $(TARGETS)
+
+--- a/a/a/nspr/pr/src/md/windows/ntgc.c 2010-11-30 00:26:19.000000000 +0100
++++ a/a/a/nspr/pr/src/md/windows/ntgc.c 2012-03-22 11:24:22.140097261 +0100
+@@ -44,7 +44,7 @@
+
+ PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
+ {
+-#if defined(_X86_)
++#if defined(_X86_) && (!defined(_AMD64_))
+ CONTEXT context;
+ context.ContextFlags = CONTEXT_INTEGER;
+
+--- a/a/a/nspr/tools/Makefile.in 2008-05-04 00:28:44.000000000 +0200
++++ a/a/a/nspr/tools/Makefile.in 2012-03-22 11:24:22.140097261 +0100
+@@ -219,7 +219,7 @@
+ echo winsock.lib >>w16link
+ wlink @w16link.
+ else
+- link $(LDOPTS) $< $(LIBPR) $(LIBPLC) wsock32.lib -out:$@
++ link $(LDOPTS) $< $(LIBPR) $(LIBPLC) ws2_32.lib mswsock.lib -out:$@
+ endif
+ else
+ ifeq ($(OS_ARCH),OS2)
--- /dev/null
+--- a/a/a/nss/coreconf/rules.mk 2013-06-14 13:31:28.569204870 +0100
++++ a/a/a/nss/coreconf/rules.mk 2013-06-14 13:31:59.277567709 +0100
+@@ -400,7 +400,7 @@
+ PWD := $(shell pwd)
+ ifeq (,$(findstring ;,$(PATH)))
+ ifndef USE_MSYS
+-PWD := $(subst \,/,$(shell cygpath -w $(PWD)))
++#PWD := $(subst \,/,$(shell cygpath -w $(PWD)))
+ endif
+ endif
+ endif
+--- a/a/a/nss/coreconf/WIN32.mk 2013-06-14 13:31:28.557204728 +0100
++++ a/a/a/nss/coreconf/WIN32.mk 2013-06-14 13:31:59.278567724 +0100
+@@ -124,7 +124,7 @@
+ # The -mnop-fun-dllimport flag allows us to avoid a drawback of
+ # the dllimport attribute that a pointer to a function marked as
+ # dllimport cannot be used as as a constant address.
+- OS_CFLAGS += -mwindows -mms-bitfields -mnop-fun-dllimport
++ OS_CFLAGS += -mwindows -mms-bitfields -mnop-fun-dllimport -D_WIN32_IE=0x0700 -U__MMX__ -U__SSE__ -U__SSE2__
+ _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
+ DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
+ ifdef BUILD_OPT
+--- a/a/a/nss/coreconf/WINNT.mk 2013-06-14 13:31:28.560204763 +0100
++++ a/a/a/nss/coreconf/WINNT.mk 2013-06-14 13:31:59.278567724 +0100
+@@ -46,7 +46,7 @@
+ #
+ # Win NT needs -GT so that fibers can work
+ #
+-OS_CFLAGS += -GT
++#OS_CFLAGS += -GT
+
+ # WINNT uses the lib prefix, Win95 doesn't
+ NSPR31_LIB_PREFIX = lib
+--- a/a/a/nss/cmd/crmftest/Makefile 2013-06-14 13:31:28.678206158 +0100
++++ a/a/a/nss/cmd/crmftest/Makefile 2013-06-14 13:31:59.278567724 +0100
+@@ -90,7 +90,7 @@
+ LDDIST = $(DIST)/lib
+
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+-EXTRA_LIBS += $(LDDIST)/sectool.lib
++#EXTRA_LIBS += $(LDDIST)/sectool.lib
+ endif
+
+ include ../platrules.mk
+--- a/a/a/nss/cmd/pk11mode/Makefile 2013-06-14 13:31:28.709206524 +0100
++++ a/a/a/nss/cmd/pk11mode/Makefile 2013-06-14 13:31:59.279567738 +0100
+@@ -61,9 +61,9 @@
+ ifeq ($(OS_ARCH), WINNT)
+
+ EXTRA_LIBS += \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(LIB_SUFFIX) \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(LIB_SUFFIX) \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(IMPORT_LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(IMPORT_LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(IMPORT_LIB_SUFFIX) \
+ $(NULL)
+
+ else
+--- a/a/a/nss/cmd/shlibsign/Makefile 2013-06-14 13:31:28.680206181 +0100
++++ a/a/a/nss/cmd/shlibsign/Makefile 2013-06-14 13:31:59.279567738 +0100
+@@ -59,9 +59,9 @@
+ ifeq ($(OS_ARCH), WINNT)
+
+ EXTRA_LIBS += \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(LIB_SUFFIX) \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(LIB_SUFFIX) \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(IMPORT_LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(IMPORT_LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(IMPORT_LIB_SUFFIX) \
+ $(NULL)
+
+ else
+@@ -93,8 +93,8 @@
+ endif
+ CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
+
+-MD_LIB_RELEASE_FILES = $(CHECKLOC)
+-ALL_TRASH += $(CHECKLOC)
++MD_LIB_RELEASE_FILES = # $(CHECKLOC)
++#ALL_TRASH += $(CHECKLOC)
+ endif
+
+ #######################################################################
+@@ -128,5 +128,5 @@
+ endif
+ endif
+
+-libs install :: $(CHECKLOC)
++libs install :: #$(CHECKLOC)
+
+--- a/a/a/nss/cmd/shlibsign/mangle/Makefile 2013-06-14 13:31:28.681206193 +0100
++++ a/a/a/nss/cmd/shlibsign/mangle/Makefile 2013-06-14 13:31:59.279567738 +0100
+@@ -59,9 +59,9 @@
+ ifeq ($(OS_ARCH), WINNT)
+
+ EXTRA_LIBS += \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(LIB_SUFFIX) \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(LIB_SUFFIX) \
+- $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(IMPORT_LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(IMPORT_LIB_SUFFIX) \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(IMPORT_LIB_SUFFIX) \
+ $(NULL)
+
+ else
+--- a/a/a/nss/lib/ckfw/builtins/config.mk 2013-06-14 13:31:28.666206016 +0100
++++ a/a/a/nss/lib/ckfw/builtins/config.mk 2013-06-14 13:31:59.280567750 +0100
+@@ -48,7 +48,7 @@
+
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+- RES = $(OBJDIR)/$(LIBRARY_NAME).res
++ RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+ endif
+
+--- a/a/a/nss/lib/ckfw/capi/Makefile 2013-06-14 13:31:28.669206051 +0100
++++ a/a/a/nss/lib/ckfw/capi/Makefile 2013-06-14 13:31:59.280567750 +0100
+@@ -75,6 +75,9 @@
+ -lplc4 \
+ -lplds4 \
+ -lnspr4 \
++ -lcrypt32 \
++ -ladvapi32 \
++ -lrpcrt4 \
+ $(NULL)
+ endif
+
+--- a/a/a/nss/lib/freebl/config.mk 2013-06-14 13:31:28.593205153 +0100
++++ a/a/a/nss/lib/freebl/config.mk 2013-06-14 13:31:59.280567750 +0100
+@@ -82,7 +82,7 @@
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+
+-RES = $(OBJDIR)/$(LIBRARY_NAME).res
++RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = freebl.rc
+
+ ifdef NS_USE_GCC
+--- a/a/a/nss/lib/freebl/mpi/mpi-priv.h 2013-06-14 13:31:28.605205295 +0100
++++ a/a/a/nss/lib/freebl/mpi/mpi-priv.h 2013-06-14 13:31:59.281567762 +0100
+@@ -254,7 +254,7 @@
+ #define MPI_ASM_DECL
+ #endif
+
+-#ifdef MPI_AMD64
++#if defined(MPI_AMD64) && defined(MP_ASSEMBLY_MULTIPLY)
+
+ mp_digit MPI_ASM_DECL s_mpv_mul_set_vec64(mp_digit*, mp_digit *, mp_size, mp_digit);
+ mp_digit MPI_ASM_DECL s_mpv_mul_add_vec64(mp_digit*, const mp_digit*, mp_size, mp_digit);
+--- a/a/a/nss/lib/nss/config.mk 2013-06-14 13:31:28.620205472 +0100
++++ a/a/a/nss/lib/nss/config.mk 2013-06-14 13:31:59.281567762 +0100
+@@ -42,7 +42,7 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/$(LIBRARY_NAME).res
++RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+
+ ifdef NS_USE_GCC
+--- a/a/a/nss/lib/smime/config.mk 2013-06-14 13:31:28.580205000 +0100
++++ a/a/a/nss/lib/smime/config.mk 2013-06-14 13:31:59.282567773 +0100
+@@ -43,7 +43,7 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/smime.res
++RES = $(OBJDIR)/smime.res.o
+ RESNAME = smime.rc
+
+ ifdef NS_USE_GCC
+--- a/a/a/nss/lib/softoken/config.mk 2013-06-14 13:31:28.662205969 +0100
++++ a/a/a/nss/lib/softoken/config.mk 2013-06-14 13:31:59.282567773 +0100
+@@ -49,7 +49,7 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/$(LIBRARY_NAME).res
++RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+
+ ifdef NS_USE_GCC
+--- a/a/a/nss/lib/softoken/legacydb/config.mk 2013-06-14 13:31:28.660205945 +0100
++++ a/a/a/nss/lib/softoken/legacydb/config.mk 2013-06-14 13:31:59.282567773 +0100
+@@ -50,7 +50,7 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/$(LIBRARY_NAME).res
++RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+
+ ifdef NS_USE_GCC
+--- a/a/a/nss/lib/ssl/config.mk 2013-06-14 13:31:28.614205402 +0100
++++ a/a/a/nss/lib/ssl/config.mk 2013-06-14 13:31:59.283567784 +0100
+@@ -55,7 +55,7 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/ssl.res
++RES = $(OBJDIR)/ssl.res.o
+ RESNAME = ssl.rc
+
+ ifdef NS_USE_GCC
+--- a/a/a/nss/lib/sysinit/config.mk 2013-06-14 13:31:28.674206110 +0100
++++ a/a/a/nss/lib/sysinit/config.mk 2013-06-14 13:31:59.283567784 +0100
+@@ -47,8 +47,8 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/$(LIBRARY_NAME).res
+-RESNAME = $(LIBRARY_NAME).rc
++#RES = $(OBJDIR)/$(LIBRARY_NAME).res
++#RESNAME = $(LIBRARY_NAME).rc
+
+ ifdef NS_USE_GCC
+ EXTRA_SHARED_LIBS += \
+--- a/a/a/nss/lib/util/config.mk 2013-06-14 13:31:28.629205579 +0100
++++ a/a/a/nss/lib/util/config.mk 2013-06-14 13:31:59.283567784 +0100
+@@ -42,7 +42,7 @@
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
+
+-RES = $(OBJDIR)/$(LIBRARY_NAME).res
++RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+
+ ifdef NS_USE_GCC
--- /dev/null
+--- a/a/nss/lib/zlib/gzguts.h 2010-08-22 03:07:03.000000000 +0200
++++ b/b/nss/lib/zlib/gzguts.h 2012-07-17 08:52:14.821552788 +0200
+@@ -26,6 +26,9 @@
+ # include <limits.h>
+ #endif
+ #include <fcntl.h>
++#ifndef _WIN32
++#include <unistd.h>
++#endif
+
+ #ifdef NO_DEFLATE /* for compatibility with old definition */
+ # define NO_GZCOMPRESS
--- /dev/null
+--- nss/lib/freebl/Makefile
++++ nss/lib/freebl/Makefile
+@@ -195,6 +195,7 @@
+ ifeq ($(CPU_ARCH),x86)
+ ASFILES = mpi_x86.s
+ DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
++ DEFINES += -DMP_USE_UINT_DIGIT
+ DEFINES += -DMP_ASSEMBLY_DIV_2DX1D
+ DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
+ # The floating point ECC code doesn't work on Linux x86 (bug 311432).
--- /dev/null
+diff --git a/a/nss/lib/ckfw/manifest.mn b/b/nss/lib/ckfw/manifest.mn
+index 20bebeb..4f10563 100644
+--- a/a/nss/lib/ckfw/manifest.mn
++++ b/b/nss/lib/ckfw/manifest.mn
+@@ -5,7 +5,7 @@
+
+ CORE_DEPTH = ../..
+
+-DIRS = builtins
++DIRS = builtins pem
+
+ PRIVATE_EXPORTS = \
+ ck.h \
+diff --git a/a/nss/lib/ckfw/pem/Makefile b/b/nss/lib/ckfw/pem/Makefile
+new file mode 100644
+index 0000000..aec3bbd
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/Makefile
+@@ -0,0 +1,107 @@
++#
++# ***** BEGIN LICENSE BLOCK *****
++# Version: MPL 1.1/GPL 2.0/LGPL 2.1
++#
++# The contents of this file are subject to the Mozilla Public License Version
++# 1.1 (the "License"); you may not use this file except in compliance with
++# the License. You may obtain a copy of the License at
++# http://www.mozilla.org/MPL/
++#
++# Software distributed under the License is distributed on an "AS IS" basis,
++# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++# for the specific language governing rights and limitations under the
++# License.
++#
++# The Original Code is the Netscape security libraries.
++#
++# The Initial Developer of the Original Code is
++# Netscape Communications Corporation.
++# Portions created by the Initial Developer are Copyright (C) 1994-2000
++# the Initial Developer. All Rights Reserved.
++#
++# Contributor(s):
++#
++# Alternatively, the contents of this file may be used under the terms of
++# either the GNU General Public License Version 2 or later (the "GPL"), or
++# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++# in which case the provisions of the GPL or the LGPL are applicable instead
++# of those above. If you wish to allow use of your version of this file only
++# under the terms of either the GPL or the LGPL, and not to allow others to
++# use your version of this file under the terms of the MPL, indicate your
++# decision by deleting the provisions above and replace them with the notice
++# and other provisions required by the GPL or the LGPL. If you do not delete
++# the provisions above, a recipient may use your version of this file under
++# the terms of any one of the MPL, the GPL or the LGPL.
++#
++# ***** END LICENSE BLOCK *****
++MAKEFILE_CVS_ID = "@(#) $RCSfile: Makefile,v $ $Revision: 1.5 $ $Date: 2007/05/09 00:09:37 $"
++
++include manifest.mn
++include $(CORE_DEPTH)/coreconf/config.mk
++include config.mk
++
++EXTRA_LIBS = \
++ $(DIST)/lib/$(LIB_PREFIX)nssckfw.$(LIB_SUFFIX) \
++ $(DIST)/lib/$(LIB_PREFIX)nssb.$(LIB_SUFFIX) \
++ $(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX) \
++ $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
++ $(NULL)
++
++# can't do this in manifest.mn because OS_TARGET isn't defined there.
++ifeq (,$(filter-out WIN%,$(OS_TARGET)))
++
++ifdef NS_USE_GCC
++EXTRA_LIBS += \
++ -L$(NSPR_LIB_DIR) \
++ -lplc4 \
++ -lplds4 \
++ -lnspr4 \
++ $(NULL)
++else
++EXTRA_SHARED_LIBS += \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.lib \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.lib \
++ $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.lib \
++ crypt32.lib \
++ advapi32.lib \
++ rpcrt4.lib \
++ $(NULL)
++endif # NS_USE_GCC
++else
++
++EXTRA_LIBS += \
++ -L$(NSPR_LIB_DIR) \
++ -lplc4 \
++ -lplds4 \
++ -lnspr4 \
++ $(NULL)
++endif
++
++
++include $(CORE_DEPTH)/coreconf/rules.mk
++
++# Generate certdata.c.
++generate:
++ $(PERL) certdata.perl < certdata.txt
++
++# This'll need some help from a build person.
++
++
++ifeq ($(OS_TARGET)$(OS_RELEASE), AIX4.1)
++DSO_LDOPTS = -bM:SRE -bh:4 -bnoentry
++EXTRA_DSO_LDOPTS = -lc
++MKSHLIB = xlC $(DSO_LDOPTS)
++
++$(SHARED_LIBRARY): $(OBJS)
++ @$(MAKE_OBJDIR)
++ rm -f $@
++ $(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(EXTRA_DSO_LDOPTS)
++ chmod +x $@
++
++endif
++
++ifeq ($(OS_TARGET)$(OS_RELEASE), AIX4.2)
++LD += -G
++endif
++
++
+diff --git a/a/nss/lib/ckfw/pem/anchor.c b/b/nss/lib/ckfw/pem/anchor.c
+new file mode 100644
+index 0000000..621f919
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/anchor.c
+@@ -0,0 +1,50 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++/*
++ * anchor.c
++ *
++ * This file "anchors" the actual cryptoki entry points in this module's
++ * shared library, which is required for dynamic loading. See the
++ * comments in nssck.api for more information.
++ */
++
++#include "ckpem.h"
++
++#define MODULE_NAME pem
++#define INSTANCE_NAME (NSSCKMDInstance *)&pem_mdInstance
++#include "nssck.api"
+diff --git a/a/nss/lib/ckfw/pem/ckpem.h b/b/nss/lib/ckfw/pem/ckpem.h
+new file mode 100644
+index 0000000..9712ccd
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/ckpem.h
+@@ -0,0 +1,263 @@
++#ifndef CKPEM_H
++#define CKPEM_H
++
++#include "nssckmdt.h"
++#include "nssckfw.h"
++#include "ckfwtm.h"
++#include "ckfw.h"
++#include "secder.h"
++#include "secoid.h"
++#include "secasn1.h"
++#include "blapit.h"
++#include "softoken.h"
++
++/*
++ * I'm including this for access to the arena functions.
++ * Looks like we should publish that API.
++ */
++#ifndef BASE_H
++#include "base.h"
++#endif /* BASE_H */
++
++/*
++ * This is where the Netscape extensions live, at least for now.
++ */
++#ifndef CKT_H
++#include "ckt.h"
++#endif /* CKT_H */
++
++#define NUM_SLOTS 8
++
++/*
++ * statically defined raw objects. Allows us to data description objects
++ * to this PKCS #11 module.
++ */
++struct pemRawObjectStr {
++ CK_ULONG n;
++ const CK_ATTRIBUTE_TYPE *types;
++ const NSSItem *items;
++};
++typedef struct pemRawObjectStr pemRawObject;
++
++/*
++ * common values needed for both bare keys and cert referenced keys.
++ */
++struct pemKeyParamsStr {
++ NSSItem modulus;
++ NSSItem exponent;
++ NSSItem privateExponent;
++ NSSItem prime1;
++ NSSItem prime2;
++ NSSItem exponent1;
++ NSSItem exponent2;
++ NSSItem coefficient;
++ unsigned char publicExponentData[sizeof(CK_ULONG)];
++ SECItem *privateKey;
++ SECItem *privateKeyOrig; /* deep copy of privateKey until decrypted */
++ void *pubKey;
++};
++typedef struct pemKeyParamsStr pemKeyParams;
++/*
++ * Key objects. Handles bare keys which do not yet have certs associated
++ * with them. These are usually short lived, but may exist for several days
++ * while the CA is issuing the certificate.
++ */
++struct pemKeyObjectStr {
++ char *provName;
++ char *containerName;
++ pemKeyParams key;
++ char *ivstring;
++ int cipher;
++};
++typedef struct pemKeyObjectStr pemKeyObject;
++
++/*
++ * Certificate and certificate referenced keys.
++ */
++struct pemCertObjectStr {
++ const char *certStore;
++ NSSItem label;
++ NSSItem subject;
++ NSSItem issuer;
++ NSSItem serial;
++ NSSItem derCert;
++ unsigned char sha1_hash[SHA1_LENGTH];
++ unsigned char md5_hash[MD5_LENGTH];
++ pemKeyParams key;
++ unsigned char *labelData;
++ /* static data: to do, make this dynamic like labelData */
++ unsigned char derSerial[128];
++};
++typedef struct pemCertObjectStr pemCertObject;
++
++/*
++ * Trust
++ */
++struct pemTrustObjectStr {
++ char *nickname;
++};
++typedef struct pemTrustObjectStr pemTrustObject;
++
++typedef enum {
++ pemAll = -1, /* matches all types */
++ pemRaw,
++ pemCert,
++ pemBareKey,
++ pemTrust
++} pemObjectType;
++
++typedef struct pemInternalObjectStr pemInternalObject;
++typedef struct pemObjectListItemStr pemObjectListItem;
++
++/*
++ * singly-linked list of internal objects
++ */
++struct pemObjectListItemStr {
++ pemInternalObject *io;
++ pemObjectListItem *next;
++};
++
++/*
++ * all the various types of objects are abstracted away in cobject and
++ * cfind as pemInternalObjects.
++ */
++struct pemInternalObjectStr {
++ pemObjectType type;
++ union {
++ pemRawObject raw;
++ pemCertObject cert;
++ pemKeyObject key;
++ pemTrustObject trust;
++ } u;
++ CK_OBJECT_CLASS objClass;
++ NSSItem hashKey;
++ NSSItem id;
++ unsigned char hashKeyData[128];
++ SECItem *derCert;
++ char *nickname;
++ NSSCKMDObject mdObject;
++ CK_SLOT_ID slotID;
++ CK_ULONG gobjIndex;
++ int refCount;
++
++ /* used by pem_mdFindObjects_Next */
++ CK_BBOOL extRef;
++
++ /* If list != NULL, the object contains no useful data except of the list
++ * of slave objects */
++ pemObjectListItem *list;
++};
++
++struct pemTokenStr {
++ PRBool logged_in;
++};
++typedef struct pemTokenStr pemToken;
++
++/* our raw object data array */
++NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
++NSS_EXTERN_DATA const PRUint32 nss_pem_nObjects;
++
++/* our raw object data array */
++NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
++NSS_EXTERN_DATA const PRUint32 nss_pem_nObjects;
++
++NSS_EXTERN_DATA pemInternalObject pem_data[];
++NSS_EXTERN_DATA const PRUint32 pem_nObjects;
++
++NSS_EXTERN_DATA const CK_VERSION pem_CryptokiVersion;
++NSS_EXTERN_DATA const NSSUTF8 * pem_ManufacturerID;
++NSS_EXTERN_DATA const NSSUTF8 * pem_LibraryDescription;
++NSS_EXTERN_DATA const CK_VERSION pem_LibraryVersion;
++NSS_EXTERN_DATA const NSSUTF8 * pem_SlotDescription;
++NSS_EXTERN_DATA const CK_VERSION pem_HardwareVersion;
++NSS_EXTERN_DATA const CK_VERSION pem_FirmwareVersion;
++NSS_EXTERN_DATA const NSSUTF8 * pem_TokenLabel;
++NSS_EXTERN_DATA const NSSUTF8 * pem_TokenModel;
++NSS_EXTERN_DATA const NSSUTF8 * pem_TokenSerialNumber;
++
++NSS_EXTERN_DATA const NSSCKMDInstance pem_mdInstance;
++NSS_EXTERN_DATA const NSSCKMDSlot pem_mdSlot;
++NSS_EXTERN_DATA const NSSCKMDToken pem_mdToken;
++NSS_EXTERN_DATA const NSSCKMDMechanism pem_mdMechanismRSA;
++
++NSS_EXTERN NSSCKMDSession *
++pem_CreateSession
++(
++ NSSCKFWSession *fwSession,
++ CK_RV *pError
++);
++
++NSS_EXTERN NSSCKMDFindObjects *
++pem_FindObjectsInit
++(
++ NSSCKFWSession *fwSession,
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ CK_RV *pError
++);
++
++NSS_EXTERN NSSCKMDObject *
++pem_CreateMDObject
++(
++ NSSArena *arena,
++ pemInternalObject *io,
++ CK_RV *pError
++);
++
++#define NSS_PEM_ARRAY_SIZE(x) ((sizeof (x))/(sizeof ((x)[0])))
++
++typedef enum {
++ pemLOWKEYNullKey = 0,
++ pemLOWKEYRSAKey = 1,
++ pemLOWKEYDSAKey = 2,
++ pemLOWKEYDHKey = 4,
++ pemLOWKEYECKey = 5
++} pemLOWKEYType;
++
++/*
++** Low Level private key object
++** This is only used by the raw Crypto engines (crypto), keydb (keydb),
++** and PKCS #11. Everyone else uses the high level key structure.
++*/
++struct pemLOWKEYPrivateKeyStr {
++ PLArenaPool *arena;
++ pemLOWKEYType keyType;
++ union {
++ RSAPrivateKey rsa;
++ DSAPrivateKey dsa;
++ DHPrivateKey dh;
++ ECPrivateKey ec;
++ } u;
++};
++typedef struct pemLOWKEYPrivateKeyStr pemLOWKEYPrivateKey;
++
++SECStatus ReadDERFromFile(SECItem ***derlist, char *filename, PRBool ascii, int *cipher, char **ivstring, PRBool certsonly);
++const NSSItem * pem_FetchAttribute ( pemInternalObject *io, CK_ATTRIBUTE_TYPE type);
++void pem_PopulateModulusExponent(pemInternalObject *io);
++NSSCKMDObject * pem_CreateObject(NSSCKFWInstance *fwInstance, NSSCKFWSession *fwSession, NSSCKMDToken *mdToken, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulAttributeCount, CK_RV *pError);
++NSSCKMDSlot *pem_NewSlot( NSSCKFWInstance *fwInstance, CK_RV *pError);
++
++
++PRBool pem_ParseString(const char* inputstring, const char delimiter,
++ PRInt32* numStrings, char*** returnedstrings);
++PRBool pem_FreeParsedStrings(PRInt32 numStrings, char** instrings);
++
++pemInternalObject *
++AddObjectIfNeeded(CK_OBJECT_CLASS objClass, pemObjectType type,
++ SECItem *certDER, SECItem *keyDER, char *filename, int objid,
++ CK_SLOT_ID slotID, PRBool *pAdded);
++
++void pem_DestroyInternalObject (pemInternalObject *io);
++
++
++/* prsa.c */
++unsigned int pem_PrivateModulusLen(pemLOWKEYPrivateKey *privk);
++
++/* ptoken.c */
++NSSCKMDToken * pem_NewToken(NSSCKFWInstance *fwInstance, CK_RV *pError);
++
++/* util.c */
++void open_log();
++void plog(const char *fmt, ...);
++
++#endif /* CKPEM_H */
+diff --git a/a/nss/lib/ckfw/pem/ckpemver.c b/b/nss/lib/ckfw/pem/ckpemver.c
+new file mode 100644
+index 0000000..76ab5df
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/ckpemver.c
+@@ -0,0 +1,59 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ * Portions created by Red Hat, Inc, are Copyright (C) 2005
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++/* Library identity and versioning */
++
++#include "nsspem.h"
++
++#if defined(DEBUG)
++#define _DEBUG_STRING " (debug)"
++#else
++#define _DEBUG_STRING ""
++#endif
++
++/*
++ * Version information for the 'ident' and 'what commands
++ *
++ * NOTE: the first component of the concatenated rcsid string
++ * must not end in a '$' to prevent rcs keyword substitution.
++ */
++const char __nss_ckpem_rcsid[] = "$Header: NSS Access to Flat Files in PEM format"
++ NSS_CKPEM_LIBRARY_VERSION _DEBUG_STRING
++ " " __DATE__ " " __TIME__ " $";
++const char __nss_ckcapi_sccsid[] = "@(#)NSS Access to Flag Files in PEM format "
++ NSS_CKPEM_LIBRARY_VERSION _DEBUG_STRING
++ " " __DATE__ " " __TIME__;
+diff --git a/a/nss/lib/ckfw/pem/config.mk b/b/nss/lib/ckfw/pem/config.mk
+new file mode 100644
+index 0000000..ff6cd9a
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/config.mk
+@@ -0,0 +1,71 @@
++#
++# ***** BEGIN LICENSE BLOCK *****
++# Version: MPL 1.1/GPL 2.0/LGPL 2.1
++#
++# The contents of this file are subject to the Mozilla Public License Version
++# 1.1 (the "License"); you may not use this file except in compliance with
++# the License. You may obtain a copy of the License at
++# http://www.mozilla.org/MPL/
++#
++# Software distributed under the License is distributed on an "AS IS" basis,
++# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++# for the specific language governing rights and limitations under the
++# License.
++#
++# The Original Code is the Netscape security libraries.
++#
++# The Initial Developer of the Original Code is
++# Netscape Communications Corporation.
++# Portions created by the Initial Developer are Copyright (C) 1994-2000
++# the Initial Developer. All Rights Reserved.
++#
++# Contributor(s):
++#
++# Alternatively, the contents of this file may be used under the terms of
++# either the GNU General Public License Version 2 or later (the "GPL"), or
++# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++# in which case the provisions of the GPL or the LGPL are applicable instead
++# of those above. If you wish to allow use of your version of this file only
++# under the terms of either the GPL or the LGPL, and not to allow others to
++# use your version of this file under the terms of the MPL, indicate your
++# decision by deleting the provisions above and replace them with the notice
++# and other provisions required by the GPL or the LGPL. If you do not delete
++# the provisions above, a recipient may use your version of this file under
++# the terms of any one of the MPL, the GPL or the LGPL.
++#
++# ***** END LICENSE BLOCK *****
++CONFIG_CVS_ID = "@(#) $RCSfile: config.mk,v $ $Revision: 1.11 $ $Date: 2005/01/20 02:25:46 $"
++
++#
++# Override TARGETS variable so that only shared libraries
++# are specifed as dependencies within rules.mk.
++#
++
++TARGETS = $(SHARED_LIBRARY)
++LIBRARY =
++IMPORT_LIBRARY =
++PROGRAM =
++
++ifeq (,$(filter-out WIN%,$(OS_TARGET)))
++ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
++ RES = $(OBJDIR)/$(LIBRARY_NAME).res
++ RESNAME = $(LIBRARY_NAME).rc
++endif
++
++ifdef BUILD_IDG
++ DEFINES += -DNSSDEBUG
++endif
++
++#
++# To create a loadable module on Darwin, we must use -bundle.
++#
++ifeq ($(OS_TARGET),Darwin)
++DSO_LDOPTS = -bundle
++endif
++
++ifeq ($(OS_TARGET),SunOS)
++# The -R '$ORIGIN' linker option instructs this library to search for its
++# dependencies in the same directory where it resides.
++MKSHLIB += -R '$$ORIGIN'
++endif
++
+diff --git a/a/nss/lib/ckfw/pem/constants.c b/b/nss/lib/ckfw/pem/constants.c
+new file mode 100644
+index 0000000..0ceb443
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/constants.c
+@@ -0,0 +1,77 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++/*
++ * constants.c
++ *
++ * Identification and other constants, all collected here in one place.
++ */
++
++#ifndef NSSBASET_H
++#include "nssbaset.h"
++#endif /* NSSBASET_H */
++
++#ifndef NSSCKT_H
++#include "nssckt.h"
++#endif /* NSSCKT_H */
++
++#ifndef NSSCKBI_H
++#include "../builtins/nssckbi.h"
++#endif /* NSSCKBI_H */
++
++NSS_IMPLEMENT_DATA const CK_VERSION
++pem_CryptokiVersion = { 2, 1 };
++
++NSS_IMPLEMENT_DATA const NSSUTF8 *
++pem_ManufacturerID = (NSSUTF8 *) "Red Hat, Inc.";
++
++NSS_IMPLEMENT_DATA const NSSUTF8 *
++pem_LibraryDescription = (NSSUTF8 *) "PEM Reader Cryptoki Module";
++
++NSS_IMPLEMENT_DATA const CK_VERSION
++pem_LibraryVersion = { 1, 0 };
++
++NSS_IMPLEMENT_DATA const CK_VERSION
++pem_HardwareVersion = { 1, 0 };
++
++NSS_IMPLEMENT_DATA const CK_VERSION
++pem_FirmwareVersion = { 1, 0 };
++
++NSS_IMPLEMENT_DATA const NSSUTF8 *
++pem_TokenModel = (NSSUTF8 *) "1";
++
++NSS_IMPLEMENT_DATA const NSSUTF8 *
++pem_TokenSerialNumber = (NSSUTF8 *) "1";
+diff --git a/a/nss/lib/ckfw/pem/manifest.mn b/b/nss/lib/ckfw/pem/manifest.mn
+new file mode 100644
+index 0000000..8de27d1
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/manifest.mn
+@@ -0,0 +1,68 @@
++#
++# ***** BEGIN LICENSE BLOCK *****
++# Version: MPL 1.1/GPL 2.0/LGPL 2.1
++#
++# The contents of this file are subject to the Mozilla Public License Version
++# 1.1 (the "License"); you may not use this file except in compliance with
++# the License. You may obtain a copy of the License at
++# http://www.mozilla.org/MPL/
++#
++# Software distributed under the License is distributed on an "AS IS" basis,
++# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++# for the specific language governing rights and limitations under the
++# License.
++#
++# The Original Code is the Netscape security libraries.
++#
++# The Initial Developer of the Original Code is
++# Netscape Communications Corporation.
++# Portions created by the Initial Developer are Copyright (C) 1994-2000
++# the Initial Developer. All Rights Reserved.
++#
++# Contributor(s):
++#
++# Alternatively, the contents of this file may be used under the terms of
++# either the GNU General Public License Version 2 or later (the "GPL"), or
++# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++# in which case the provisions of the GPL or the LGPL are applicable instead
++# of those above. If you wish to allow use of your version of this file only
++# under the terms of either the GPL or the LGPL, and not to allow others to
++# use your version of this file under the terms of the MPL, indicate your
++# decision by deleting the provisions above and replace them with the notice
++# and other provisions required by the GPL or the LGPL. If you do not delete
++# the provisions above, a recipient may use your version of this file under
++# the terms of any one of the MPL, the GPL or the LGPL.
++#
++# ***** END LICENSE BLOCK *****
++MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.1 $ $Date: 2005/11/04 02:05:04 $"
++
++CORE_DEPTH = ../../..
++
++MODULE = nss
++MAPFILE = $(OBJDIR)/nsspem.def
++
++EXPORTS = \
++ nsspem.h \
++ $(NULL)
++
++CSRCS = \
++ anchor.c \
++ constants.c \
++ pargs.c \
++ pfind.c \
++ pinst.c \
++ pobject.c \
++ prsa.c \
++ psession.c \
++ pslot.c \
++ ptoken.c \
++ ckpemver.c \
++ rsawrapr.c \
++ util.c \
++ $(NULL)
++
++REQUIRES = nspr
++
++LIBRARY_NAME = nsspem
++
++#EXTRA_SHARED_LIBS = -L$(DIST)/lib -lnssckfw -lnssb -lplc4 -lplds4
+diff --git a/a/nss/lib/ckfw/pem/nsspem.def b/b/nss/lib/ckfw/pem/nsspem.def
+new file mode 100644
+index 0000000..4978252
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/nsspem.def
+@@ -0,0 +1,58 @@
++;+#
++;+# ***** BEGIN LICENSE BLOCK *****
++;+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
++;+#
++;+# The contents of this file are subject to the Mozilla Public License Version
++;+# 1.1 (the "License"); you may not use this file except in compliance with
++;+# the License. You may obtain a copy of the License at
++;+# http://www.mozilla.org/MPL/
++;+#
++;+# Software distributed under the License is distributed on an "AS IS" basis,
++;+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++;+# for the specific language governing rights and limitations under the
++;+# License.
++;+#
++;+# The Original Code is the Netscape security libraries.
++;+#
++;+# The Initial Developer of the Original Code is
++;+# Netscape Communications Corporation.
++;+# Portions created by the Initial Developer are Copyright (C) 2003
++;+# the Initial Developer. All Rights Reserved.
++;+#
++;+# Contributor(s):
++;+#
++;+# Alternatively, the contents of this file may be used under the terms of
++;+# either the GNU General Public License Version 2 or later (the "GPL"), or
++;+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++;+# in which case the provisions of the GPL or the LGPL are applicable instead
++;+# of those above. If you wish to allow use of your version of this file only
++;+# under the terms of either the GPL or the LGPL, and not to allow others to
++;+# use your version of this file under the terms of the MPL, indicate your
++;+# decision by deleting the provisions above and replace them with the notice
++;+# and other provisions required by the GPL or the LGPL. If you do not delete
++;+# the provisions above, a recipient may use your version of this file under
++;+# the terms of any one of the MPL, the GPL or the LGPL.
++;+#
++;+# ***** END LICENSE BLOCK *****
++;+#
++;+# OK, this file is meant to support SUN, LINUX, AIX and WINDOWS
++;+# 1. For all unix platforms, the string ";-" means "remove this line"
++;+# 2. For all unix platforms, the string " DATA " will be removed from any
++;+# line on which it occurs.
++;+# 3. Lines containing ";+" will have ";+" removed on SUN and LINUX.
++;+# On AIX, lines containing ";+" will be removed.
++;+# 4. For all unix platforms, the string ";;" will thave the ";;" removed.
++;+# 5. For all unix platforms, after the above processing has taken place,
++;+# all characters after the first ";" on the line will be removed.
++;+# And for AIX, the first ";" will also be removed.
++;+# This file is passed directly to windows. Since ';' is a comment, all UNIX
++;+# directives are hidden behind ";", ";+", and ";-"
++;+
++;+NSS_3.1 { # NSS 3.1 release
++;+ global:
++LIBRARY nsspem ;-
++EXPORTS ;-
++C_GetFunctionList;
++;+ local:
++;+*;
++;+};
+diff --git a/a/nss/lib/ckfw/pem/nsspem.h b/b/nss/lib/ckfw/pem/nsspem.h
+new file mode 100644
+index 0000000..1547bf4
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/nsspem.h
+@@ -0,0 +1,75 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ * Portions created by Red Hat, Inc, are Copyright (C) 2005
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#ifndef NSSPEM_H
++#define NSSPEM_H
++
++/*
++ * NSS CKPEM Version numbers.
++ *
++ * These are the version numbers for the capi module packaged with
++ * this release on NSS. To determine the version numbers of the builtin
++ * module you are using, use the appropriate PKCS #11 calls.
++ *
++ * These version numbers detail changes to the PKCS #11 interface. They map
++ * to the PKCS #11 spec versions.
++ */
++#define NSS_CKPEM_CRYPTOKI_VERSION_MAJOR 2
++#define NSS_CKPEM_CRYPTOKI_VERSION_MINOR 20
++
++/* These version numbers detail the changes
++ * to the list of trusted certificates.
++ *
++ * NSS_CKPEM_LIBRARY_VERSION_MINOR is a CK_BYTE. It's not clear
++ * whether we may use its full range (0-255) or only 0-99 because
++ * of the comment in the CK_VERSION type definition.
++ */
++#define NSS_CKPEM_LIBRARY_VERSION_MAJOR 1
++#define NSS_CKPEM_LIBRARY_VERSION_MINOR 1
++#define NSS_CKPEM_LIBRARY_VERSION "1.1"
++
++/* These version numbers detail the semantic changes to the ckfw engine. */
++#define NSS_CKPEM_HARDWARE_VERSION_MAJOR 1
++#define NSS_CKPEM_HARDWARE_VERSION_MINOR 0
++
++/* These version numbers detail the semantic changes to ckbi itself
++ * (new PKCS #11 objects), etc. */
++#define NSS_CKPEM_FIRMWARE_VERSION_MAJOR 1
++#define NSS_CKPEM_FIRMWARE_VERSION_MINOR 0
++
++#endif /* NSSCKBI_H */
+diff --git a/a/nss/lib/ckfw/pem/nsspem.rc b/b/nss/lib/ckfw/pem/nsspem.rc
+new file mode 100644
+index 0000000..eb208d6
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/nsspem.rc
+@@ -0,0 +1,64 @@
++/* This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#include "nsspem.h"
++#include <winver.h>
++
++#define MY_LIBNAME "nsspem"
++#define MY_FILEDESCRIPTION "NSS PEM support"
++
++#ifdef _DEBUG
++#define MY_DEBUG_STR " (debug)"
++#define MY_FILEFLAGS_1 VS_FF_DEBUG
++#else
++#define MY_DEBUG_STR ""
++#define MY_FILEFLAGS_1 0x0L
++#endif
++#if NSS_BETA
++#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
++#else
++#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
++#endif
++
++#ifdef WINNT
++#define MY_FILEOS VOS_NT_WINDOWS32
++#else
++#define MY_FILEOS VOS__WINDOWS32
++#endif
++
++#define MY_INTERNAL_NAME MY_LIBNAME
++
++/////////////////////////////////////////////////////////////////////////////
++//
++// Version-information resource
++//
++
++VS_VERSION_INFO VERSIONINFO
++ FILEVERSION NSS_CKPEM_LIBRARY_VERSION_MAJOR,NSS_CKPEM_LIBRARY_VERSION_MINOR,0,0
++ PRODUCTVERSION NSS_CKPEM_LIBRARY_VERSION_MAJOR,NSS_CKPEM_LIBRARY_VERSION_MINOR,0,0
++ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
++ FILEFLAGS MY_FILEFLAGS_2
++ FILEOS MY_FILEOS
++ FILETYPE VFT_DLL
++ FILESUBTYPE 0x0L // not used
++
++BEGIN
++ BLOCK "StringFileInfo"
++ BEGIN
++ BLOCK "040904B0" // Lang=US English, CharSet=Unicode
++ BEGIN
++ VALUE "CompanyName", "Mozilla Foundation\0"
++ VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
++ VALUE "FileVersion", NSS_CKPEM_LIBRARY_VERSION "\0"
++ VALUE "InternalName", MY_INTERNAL_NAME "\0"
++ VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
++ VALUE "ProductName", "Network Security Services\0"
++ VALUE "ProductVersion", NSS_CKPEM_LIBRARY_VERSION "\0"
++ END
++ END
++ BLOCK "VarFileInfo"
++ BEGIN
++ VALUE "Translation", 0x409, 1200
++ END
++END
+diff --git a/a/nss/lib/ckfw/pem/pargs.c b/b/nss/lib/ckfw/pem/pargs.c
+new file mode 100644
+index 0000000..21291a8
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/pargs.c
+@@ -0,0 +1,164 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include <string.h>
++#include <nspr.h>
++
++void *pem_Malloc(const PRInt32 sz)
++{
++ return PR_Malloc(sz);
++}
++
++char *pem_StrNdup(const char *instr, PRInt32 inlen)
++{
++ size_t len = inlen;
++ char *buffer;
++ if (!instr) {
++ return NULL;
++ }
++
++ if (!len) {
++ return NULL;
++ }
++ buffer = (char *) pem_Malloc(len + 1);
++ if (!buffer) {
++ return NULL;
++ }
++ memcpy(buffer, instr, len);
++ buffer[len] = 0; /* NULL termination */
++ return buffer;
++}
++
++char *pem_Strdup(const char *instr)
++{
++ size_t len;
++ if (!instr) {
++ return NULL;
++ }
++
++ len = strlen(instr);
++ return pem_StrNdup(instr, len);
++}
++
++void pem_Free(char *instr)
++{
++ if (!instr) {
++ PR_ASSERT(0);
++ }
++ PR_Free(instr);
++}
++
++void
++addString(char ***returnedstrings, char *newstring, PRInt32 stringcount)
++{
++ char **stringarray = NULL;
++ if (!returnedstrings || !newstring) {
++ return;
++ }
++ if (!stringcount) {
++ /* first string to be added, allocate buffer */
++ *returnedstrings =
++ (char **) PR_Malloc(sizeof(char *) * (stringcount + 1));
++ stringarray = *returnedstrings;
++ } else {
++ stringarray = (char **) PR_Realloc(*returnedstrings,
++ sizeof(char *) * (stringcount + 1));
++ if (stringarray) {
++ *returnedstrings = stringarray;
++ }
++ }
++ if (stringarray) {
++ stringarray[stringcount] = newstring;
++ }
++}
++
++PRBool
++pem_ParseString(const char *inputstring, const char delimiter,
++ PRInt32 * numStrings, char ***returnedstrings)
++{
++ char nextchar;
++ char *instring = (char *) inputstring;
++ if (!inputstring || !delimiter || !numStrings || !returnedstrings) {
++ /* we need a string and a non-zero delimiter, as well as
++ * a valid place to return the strings and count
++ */
++ return PR_FALSE;
++ }
++ *numStrings = 0;
++ *returnedstrings = NULL;
++
++ while ((nextchar = *instring)) {
++ unsigned long len = 0;
++ char *next = (char *) strchr(instring, delimiter);
++ if (next) {
++ /* current string string */
++ len = next - instring;
++ } else {
++ /* last string length */
++ len = strlen(instring);
++ }
++
++ if (len > 0) {
++ char *newstring = pem_StrNdup(instring, len);
++
++ addString(returnedstrings, newstring, (*numStrings)++);
++
++ instring += len;
++ }
++
++ if (delimiter == *instring) {
++ instring++; /* skip past next delimiter */
++ }
++ }
++ return PR_TRUE;
++}
++
++PRBool pem_FreeParsedStrings(PRInt32 numStrings, char **instrings)
++{
++ PRInt32 counter;
++ if (!numStrings || !instrings) {
++ return PR_FALSE;
++ }
++ for (counter = 0; counter < numStrings; counter++) {
++ char *astring = instrings[counter];
++ if (astring) {
++ pem_Free(astring);
++ }
++ }
++ PR_Free((void *) instrings);
++ return PR_TRUE;
++}
+diff --git a/a/nss/lib/ckfw/pem/pfind.c b/b/nss/lib/ckfw/pem/pfind.c
+new file mode 100644
+index 0000000..30b1174
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/pfind.c
+@@ -0,0 +1,435 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "ckpem.h"
++
++/*
++ * pfind.c
++ *
++ * This file implements the NSSCKMDFindObjects object for the
++ * "PEM objects" cryptoki module.
++ */
++
++NSS_EXTERN_DATA pemInternalObject **gobj;
++NSS_EXTERN_DATA int pem_nobjs;
++
++struct pemFOStr {
++ NSSArena *arena;
++ CK_ULONG n;
++ CK_ULONG i;
++ pemInternalObject **objs;
++};
++
++#define PEM_ITEM_CHUNK 512
++
++#define PUT_Object(obj,err) \
++ { \
++ if (count >= size) { \
++ *listp = *listp ? \
++ nss_ZREALLOCARRAY(*listp, pemInternalObject *, \
++ (size+PEM_ITEM_CHUNK) ) : \
++ nss_ZNEWARRAY(NULL, pemInternalObject *, \
++ (size+PEM_ITEM_CHUNK) ) ; \
++ if ((pemInternalObject **)NULL == *listp) { \
++ err = CKR_HOST_MEMORY; \
++ goto loser; \
++ } \
++ size += PEM_ITEM_CHUNK; \
++ } \
++ (*listp)[ count ] = (obj); \
++ count++; \
++ }
++
++static void
++pem_mdFindObjects_Final
++(
++ NSSCKMDFindObjects * mdFindObjects,
++ NSSCKFWFindObjects * fwFindObjects,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ struct pemFOStr *fo = (struct pemFOStr *) mdFindObjects->etc;
++ NSSArena *arena = fo->arena;
++
++ nss_ZFreeIf(fo->objs);
++ nss_ZFreeIf(fo);
++ nss_ZFreeIf(mdFindObjects);
++ if ((NSSArena *) NULL != arena) {
++ NSSArena_Destroy(arena);
++ }
++
++ return;
++}
++
++static NSSCKMDObject *
++pem_mdFindObjects_Next
++(
++ NSSCKMDFindObjects * mdFindObjects,
++ NSSCKFWFindObjects * fwFindObjects,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSArena * arena,
++ CK_RV * pError
++)
++{
++ struct pemFOStr *fo = (struct pemFOStr *) mdFindObjects->etc;
++ pemInternalObject *io;
++
++ plog("pem_FindObjects_Next: ");
++
++ if (fo->i == fo->n) {
++ plog("Done creating objects\n");
++ *pError = CKR_OK;
++ return (NSSCKMDObject *) NULL;
++ }
++
++ io = fo->objs[fo->i];
++ fo->i++;
++
++ plog("Creating object for type %d\n", io->type);
++
++ if (!io->extRef) {
++ /* increase reference count only once as ckfw will free the found
++ * object only once */
++ io->extRef = CK_TRUE;
++ io->refCount ++;
++ }
++
++ return pem_CreateMDObject(arena, io, pError);
++}
++
++#if 0
++static int
++pem_derUnwrapInt(unsigned char *src, int size, unsigned char **dest)
++{
++ unsigned char *start = src;
++ int len = 0;
++
++ if (*src++ != 2) {
++ return 0;
++ }
++ len = *src++;
++ if (len & 0x80) {
++ int count = len & 0x7f;
++ len = 0;
++
++ if (count + 2 > size) {
++ return 0;
++ }
++ while (count-- > 0) {
++ len = (len << 8) | *src++;
++ }
++ }
++ if (len + (src - start) != size) {
++ return 0;
++ }
++ *dest = src;
++ return len;
++}
++#endif
++
++static char * pem_attr_name(CK_ATTRIBUTE_TYPE type) {
++ switch(type) {
++ case CKA_CLASS:
++ return "CKA_CLASS";
++ case CKA_TOKEN:
++ return "CKA_TOKEN";
++ case CKA_PRIVATE:
++ return "CKA_PRIVATE";
++ case CKA_LABEL:
++ return "CKA_LABEL";
++ case CKA_APPLICATION:
++ return "CKA_APPLICATION";
++ case CKA_VALUE:
++ return "CKA_VALUE";
++ case CKA_OBJECT_ID:
++ return "CKA_OBJECT_ID";
++ case CKA_CERTIFICATE_TYPE:
++ return "CKA_CERTIFICATE_TYPE";
++ case CKA_ISSUER:
++ return "CKA_ISSUER";
++ case CKA_SERIAL_NUMBER:
++ return "CKA_SERIAL_NUMBER";
++ case CKA_ID:
++ return "CKA_ID";
++ default:
++ return "unknown";
++ }
++}
++
++static CK_BBOOL
++pem_attrmatch(CK_ATTRIBUTE_PTR a, pemInternalObject * o) {
++ PRBool prb;
++ const NSSItem *b;
++
++ b = pem_FetchAttribute(o, a->type);
++ if (b == NULL) {
++ plog("pem_attrmatch %s %08x: CK_FALSE attr not found\n", pem_attr_name(a->type), a->type);
++ return CK_FALSE;
++ }
++
++ if (a->ulValueLen != b->size) {
++ plog("pem_attrmatch %s %08x: CK_FALSE size mismatch %d vs %d\n", pem_attr_name(a->type), a->type, a->ulValueLen, b->size);
++ return CK_FALSE;
++ }
++
++ prb = nsslibc_memequal(a->pValue, b->data, b->size, (PRStatus *) NULL);
++
++ if (PR_TRUE == prb) {
++ plog("pem_attrmatch %s %08x: CK_TRUE\n", pem_attr_name(a->type), a->type);
++ return CK_TRUE;
++ } else {
++ plog("pem_attrmatch %s %08x: CK_FALSE\n", pem_attr_name(a->type), a->type);
++ plog("type: %08x, label: %s a->pValue %08x, b->data %08x\n", o->objClass, o->u.cert.label.data, a->pValue, b->data);
++ return CK_FALSE;
++ }
++}
++
++static CK_BBOOL
++pem_match
++(
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ pemInternalObject * o
++)
++{
++ CK_ULONG i;
++
++ for (i = 0; i < ulAttributeCount; i++) {
++ if (CK_FALSE == pem_attrmatch(&pTemplate[i], o)) {
++ plog("pem_match: CK_FALSE\n");
++ return CK_FALSE;
++ }
++ }
++
++ /* Every attribute passed */
++ plog("pem_match: CK_TRUE\n");
++ return CK_TRUE;
++}
++
++CK_OBJECT_CLASS
++pem_GetObjectClass(CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount)
++{
++ CK_ULONG i;
++
++ for (i = 0; i < ulAttributeCount; i++) {
++ if (pTemplate[i].type == CKA_CLASS) {
++ return *(CK_OBJECT_CLASS *) pTemplate[i].pValue;
++ }
++ }
++ /* need to return a value that says 'fetch them all' */
++ return CK_INVALID_HANDLE;
++}
++
++static PRUint32
++collect_objects(CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ pemInternalObject *** listp,
++ CK_RV * pError, CK_SLOT_ID slotID)
++{
++ PRUint32 i;
++ PRUint32 count = 0;
++ PRUint32 size = 0;
++ pemObjectType type = pemRaw;
++ CK_OBJECT_CLASS objClass = pem_GetObjectClass(pTemplate, ulAttributeCount);
++
++ *pError = CKR_OK;
++
++ plog("collect_objects slot #%ld, ", slotID);
++ plog("%d attributes, ", ulAttributeCount);
++ plog("%d objects to look through.\n", pem_nobjs);
++ plog("Looking for: ");
++ /*
++ * now determine type of the object
++ */
++ switch (objClass) {
++ case CKO_CERTIFICATE:
++ plog("CKO_CERTIFICATE\n");
++ type = pemCert;
++ break;
++ case CKO_PUBLIC_KEY:
++ plog("CKO_PUBLIC_KEY\n");
++ type = pemBareKey;
++ break;
++ case CKO_PRIVATE_KEY:
++ type = pemBareKey;
++ plog("CKO_PRIVATE_KEY\n");
++ break;
++ case CKO_NETSCAPE_TRUST:
++ type = pemTrust;
++ plog("CKO_NETSCAPE_TRUST\n");
++ break;
++ case CKO_NETSCAPE_CRL:
++ plog("CKO_NETSCAPE_CRL\n");
++ goto done;
++ case CKO_NETSCAPE_SMIME:
++ plog("CKO_NETSCAPE_SMIME\n");
++ goto done;
++ case CKO_NETSCAPE_BUILTIN_ROOT_LIST:
++ plog("CKO_NETSCAPE_BUILTIN_ROOT_LIST\n");
++ goto done;
++ case CK_INVALID_HANDLE:
++ type = pemAll; /* look through all objectclasses - ignore the type field */
++ plog("CK_INVALID_HANDLE\n");
++ break;
++ default:
++ plog("no other object types %08x\n", objClass);
++ goto done; /* no other object types we understand in this module */
++ }
++
++ /* find objects */
++ for (i = 0; i < pem_nobjs; i++) {
++ int match = 1; /* matches type if type not specified */
++ if (NULL == gobj[i])
++ continue;
++
++ plog(" %d type = %d\n", i, gobj[i]->type);
++ if (type != pemAll) {
++ /* type specified - must match given type */
++ match = (type == gobj[i]->type);
++ }
++ if (match) {
++ match = (slotID == gobj[i]->slotID) &&
++ (CK_TRUE == pem_match(pTemplate, ulAttributeCount, gobj[i]));
++ }
++ if (match) {
++ pemInternalObject *o = gobj[i];
++ PUT_Object(o, *pError);
++ }
++ }
++
++ if (CKR_OK != *pError) {
++ goto loser;
++ }
++
++ done:
++ plog("collect_objects: Found %d\n", count);
++ return count;
++ loser:
++ nss_ZFreeIf(*listp);
++ return 0;
++
++}
++
++NSS_IMPLEMENT NSSCKMDFindObjects *
++pem_FindObjectsInit
++(
++ NSSCKFWSession * fwSession,
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ CK_RV * pError
++)
++{
++ NSSArena *arena = NULL;
++ NSSCKMDFindObjects *rv = (NSSCKMDFindObjects *) NULL;
++ struct pemFOStr *fo = (struct pemFOStr *) NULL;
++ pemInternalObject **temp = (pemInternalObject **) NULL;
++ NSSCKFWSlot *fwSlot;
++ CK_SLOT_ID slotID;
++
++ plog("pem_FindObjectsInit\n");
++ fwSlot = nssCKFWSession_GetFWSlot(fwSession);
++ if ((NSSCKFWSlot *) NULL == fwSlot) {
++ goto loser;
++ }
++ slotID = nssCKFWSlot_GetSlotID(fwSlot);
++
++ arena = NSSArena_Create();
++ if ((NSSArena *) NULL == arena) {
++ goto loser;
++ }
++
++ rv = nss_ZNEW(arena, NSSCKMDFindObjects);
++ if ((NSSCKMDFindObjects *) NULL == rv) {
++ *pError = CKR_HOST_MEMORY;
++ goto loser;
++ }
++
++ fo = nss_ZNEW(arena, struct pemFOStr);
++ if ((struct pemFOStr *) NULL == fo) {
++ *pError = CKR_HOST_MEMORY;
++ goto loser;
++ }
++
++ fo->arena = arena;
++ /* fo->n and fo->i are already zero */
++
++ rv->etc = (void *) fo;
++ rv->Final = pem_mdFindObjects_Final;
++ rv->Next = pem_mdFindObjects_Next;
++ rv->null = (void *) NULL;
++
++ fo->n =
++ collect_objects(pTemplate, ulAttributeCount, &temp, pError,
++ slotID);
++ if (*pError != CKR_OK) {
++ goto loser;
++ }
++
++ fo->objs = nss_ZNEWARRAY(arena, pemInternalObject *, fo->n);
++ if ((pemInternalObject **) NULL == fo->objs) {
++ *pError = CKR_HOST_MEMORY;
++ goto loser;
++ }
++
++ (void) nsslibc_memcpy(fo->objs, temp,
++ sizeof(pemInternalObject *) * fo->n);
++
++ nss_ZFreeIf(temp);
++ temp = (pemInternalObject **) NULL;
++
++ return rv;
++
++ loser:
++ nss_ZFreeIf(temp);
++ nss_ZFreeIf(fo);
++ nss_ZFreeIf(rv);
++ if ((NSSArena *) NULL != arena) {
++ NSSArena_Destroy(arena);
++ }
++ return (NSSCKMDFindObjects *) NULL;
++}
+diff --git a/a/nss/lib/ckfw/pem/pinst.c b/b/nss/lib/ckfw/pem/pinst.c
+new file mode 100644
+index 0000000..9c98e89
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/pinst.c
+@@ -0,0 +1,768 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <stdlib.h>
++#include "ckpem.h"
++#include "blapi.h"
++#include "prprf.h"
++
++/*
++ * pinstance.c
++ *
++ * This file implements the NSSCKMDInstance object for the
++ * "PEM objects" cryptoki module.
++ */
++
++static PRBool pemInitialized = PR_FALSE;
++
++pemInternalObject **gobj;
++int pem_nobjs = 0;
++int token_needsLogin[NUM_SLOTS];
++
++PRInt32 size = 0;
++PRInt32 count = 0;
++
++#define PEM_ITEM_CHUNK 512
++
++/*
++ * simple cert decoder to avoid the cost of asn1 engine
++ */
++static unsigned char *
++dataStart(unsigned char *buf, unsigned int length,
++ unsigned int *data_length,
++ PRBool includeTag, unsigned char *rettag)
++{
++ unsigned char tag;
++ unsigned int used_length = 0;
++ if (!length)
++ return NULL;
++
++ tag = buf[used_length++];
++
++ if (rettag) {
++ *rettag = tag;
++ }
++
++ /* blow out when we come to the end */
++ if (tag == 0 || length <= used_length) {
++ return NULL;
++ }
++
++ *data_length = buf[used_length++];
++
++ if (*data_length & 0x80) {
++ int len_count = *data_length & 0x7f;
++
++ *data_length = 0;
++
++ while (len_count-- > 0) {
++ if (length <= used_length)
++ return NULL;
++
++ *data_length = (*data_length << 8) | buf[used_length++];
++ }
++ }
++
++ if (*data_length > (length - used_length)) {
++ *data_length = length - used_length;
++ return NULL;
++ }
++ if (includeTag)
++ *data_length += used_length;
++
++ return (buf + (includeTag ? 0 : used_length));
++}
++
++static int
++GetCertFields(unsigned char *cert, int cert_length,
++ SECItem * issuer, SECItem * serial, SECItem * derSN,
++ SECItem * subject, SECItem * valid, SECItem * subjkey)
++{
++ unsigned char *buf;
++ unsigned int buf_length;
++ unsigned char *dummy;
++ unsigned int dummylen;
++
++ /* get past the signature wrap */
++ buf = dataStart(cert, cert_length, &buf_length, PR_FALSE, NULL);
++ if (buf == NULL)
++ return SECFailure;
++ /* get into the raw cert data */
++ buf = dataStart(buf, buf_length, &buf_length, PR_FALSE, NULL);
++ if (buf == NULL)
++ return SECFailure;
++ /* skip past any optional version number */
++ if ((buf[0] & 0xa0) == 0xa0) {
++ dummy = dataStart(buf, buf_length, &dummylen, PR_FALSE, NULL);
++ if (dummy == NULL)
++ return SECFailure;
++ buf_length -= (dummy - buf) + dummylen;
++ buf = dummy + dummylen;
++ }
++ /* serial number */
++ if (derSN) {
++ derSN->data =
++ dataStart(buf, buf_length, &derSN->len, PR_TRUE, NULL);
++ }
++ serial->data =
++ dataStart(buf, buf_length, &serial->len, PR_FALSE, NULL);
++ if (serial->data == NULL)
++ return SECFailure;
++ buf_length -= (serial->data - buf) + serial->len;
++ buf = serial->data + serial->len;
++ /* skip the OID */
++ dummy = dataStart(buf, buf_length, &dummylen, PR_FALSE, NULL);
++ if (dummy == NULL)
++ return SECFailure;
++ buf_length -= (dummy - buf) + dummylen;
++ buf = dummy + dummylen;
++ /* issuer */
++ issuer->data = dataStart(buf, buf_length, &issuer->len, PR_TRUE, NULL);
++ if (issuer->data == NULL)
++ return SECFailure;
++ buf_length -= (issuer->data - buf) + issuer->len;
++ buf = issuer->data + issuer->len;
++
++ /* only wanted issuer/SN */
++ if (subject == NULL || valid == NULL || subjkey == NULL) {
++ return SECSuccess;
++ }
++ /* validity */
++ valid->data = dataStart(buf, buf_length, &valid->len, PR_FALSE, NULL);
++ if (valid->data == NULL)
++ return SECFailure;
++ buf_length -= (valid->data - buf) + valid->len;
++ buf = valid->data + valid->len;
++ /*subject */
++ subject->data =
++ dataStart(buf, buf_length, &subject->len, PR_TRUE, NULL);
++ if (subject->data == NULL)
++ return SECFailure;
++ buf_length -= (subject->data - buf) + subject->len;
++ buf = subject->data + subject->len;
++ /* subject key info */
++ subjkey->data =
++ dataStart(buf, buf_length, &subjkey->len, PR_TRUE, NULL);
++ if (subjkey->data == NULL)
++ return SECFailure;
++ buf_length -= (subjkey->data - buf) + subjkey->len;
++ buf = subjkey->data + subjkey->len;
++ return SECSuccess;
++}
++
++static CK_RV
++assignObjectID(pemInternalObject *o, int objid)
++{
++ char id[16];
++ int len;
++
++ sprintf(id, "%d", objid);
++ len = strlen(id) + 1; /* zero terminate */
++ o->id.size = len;
++ o->id.data = nss_ZAlloc(NULL, len);
++ if (o->id.data == NULL)
++ return CKR_HOST_MEMORY;
++
++ nsslibc_memcpy(o->id.data, id, len);
++ return CKR_OK;
++}
++
++static pemInternalObject *
++CreateObject(CK_OBJECT_CLASS objClass,
++ pemObjectType type, SECItem * certDER,
++ SECItem * keyDER, char *filename,
++ int objid, CK_SLOT_ID slotID)
++{
++ pemInternalObject *o;
++ SECItem subject;
++ SECItem issuer;
++ SECItem serial;
++ SECItem derSN;
++ SECItem valid;
++ SECItem subjkey;
++ char *nickname;
++
++ o = nss_ZNEW(NULL, pemInternalObject);
++ if ((pemInternalObject *) NULL == o) {
++ return NULL;
++ }
++
++ nickname = strrchr(filename, '/');
++ if (nickname)
++ nickname++;
++ else
++ nickname = filename;
++
++ switch (objClass) {
++ case CKO_CERTIFICATE:
++ plog("Creating cert nick %s id %d in slot %ld\n", nickname, objid, slotID);
++ memset(&o->u.cert, 0, sizeof(o->u.cert));
++ break;
++ case CKO_PRIVATE_KEY:
++ plog("Creating key id %d in slot %ld\n", objid, slotID);
++ memset(&o->u.key, 0, sizeof(o->u.key));
++ nickname = filename;
++ break;
++ case CKO_NETSCAPE_TRUST:
++ plog("Creating trust nick %s id %d in slot %ld\n", nickname, objid, slotID);
++ memset(&o->u.trust, 0, sizeof(o->u.trust));
++ break;
++ }
++
++ o->nickname = (char *) nss_ZAlloc(NULL, strlen(nickname) + 1);
++ if (o->nickname == NULL)
++ goto fail;
++ strcpy(o->nickname, nickname);
++
++ if (CKR_OK != assignObjectID(o, objid))
++ goto fail;
++
++ o->objClass = objClass;
++ o->type = type;
++ o->slotID = slotID;
++
++ o->derCert = nss_ZNEW(NULL, SECItem);
++ if (o->derCert == NULL)
++ goto fail;
++ o->derCert->data = (void *) nss_ZAlloc(NULL, certDER->len);
++ if (o->derCert->data == NULL)
++ goto fail;
++ o->derCert->len = certDER->len;
++ nsslibc_memcpy(o->derCert->data, certDER->data, certDER->len);
++
++ switch (objClass) {
++ case CKO_CERTIFICATE:
++ case CKO_NETSCAPE_TRUST:
++ if (SECSuccess != GetCertFields(o->derCert->data, o->derCert->len,
++ &issuer, &serial, &derSN, &subject,
++ &valid, &subjkey))
++ goto fail;
++
++ o->u.cert.subject.data = (void *) nss_ZAlloc(NULL, subject.len);
++ if (o->u.cert.subject.data == NULL)
++ goto fail;
++ o->u.cert.subject.size = subject.len;
++ nsslibc_memcpy(o->u.cert.subject.data, subject.data, subject.len);
++
++ o->u.cert.issuer.data = (void *) nss_ZAlloc(NULL, issuer.len);
++ if (o->u.cert.issuer.data == NULL) {
++ nss_ZFreeIf(o->u.cert.subject.data);
++ goto fail;
++ }
++ o->u.cert.issuer.size = issuer.len;
++ nsslibc_memcpy(o->u.cert.issuer.data, issuer.data, issuer.len);
++
++ o->u.cert.serial.data = (void *) nss_ZAlloc(NULL, serial.len);
++ if (o->u.cert.serial.data == NULL) {
++ nss_ZFreeIf(o->u.cert.issuer.data);
++ nss_ZFreeIf(o->u.cert.subject.data);
++ goto fail;
++ }
++ o->u.cert.serial.size = serial.len;
++ nsslibc_memcpy(o->u.cert.serial.data, serial.data, serial.len);
++ break;
++ case CKO_PRIVATE_KEY:
++ o->u.key.key.privateKey = nss_ZNEW(NULL, SECItem);
++ if (o->u.key.key.privateKey == NULL)
++ goto fail;
++ o->u.key.key.privateKey->data =
++ (void *) nss_ZAlloc(NULL, keyDER->len);
++ if (o->u.key.key.privateKey->data == NULL) {
++ nss_ZFreeIf(o->u.key.key.privateKey);
++ goto fail;
++ }
++
++ /* store deep copy of original key DER so we can compare it later on */
++ o->u.key.key.privateKeyOrig = SECITEM_DupItem(keyDER);
++ if (o->u.key.key.privateKeyOrig == NULL) {
++ nss_ZFreeIf(o->u.key.key.privateKey->data);
++ nss_ZFreeIf(o->u.key.key.privateKey);
++ goto fail;
++ }
++
++ o->u.key.key.privateKey->len = keyDER->len;
++ nsslibc_memcpy(o->u.key.key.privateKey->data, keyDER->data,
++ keyDER->len);
++ }
++
++
++ return o;
++
++fail:
++ if (o) {
++ if (o->derCert) {
++ nss_ZFreeIf(o->derCert->data);
++ nss_ZFreeIf(o->derCert);
++ }
++ nss_ZFreeIf(o->id.data);
++ nss_ZFreeIf(o->nickname);
++ nss_ZFreeIf(o);
++ }
++ return NULL;
++}
++
++/* Compare the DER encoding of the internal object against those
++ * of the provided certDER or keyDER according to its objClass.
++ */
++static PRBool
++derEncodingsMatch(CK_OBJECT_CLASS objClass, pemInternalObject * obj,
++ SECItem * certDER, SECItem * keyDER)
++{
++ SECComparison result;
++
++ switch (objClass) {
++ case CKO_CERTIFICATE:
++ case CKO_NETSCAPE_TRUST:
++ result = SECITEM_CompareItem(obj->derCert, certDER);
++ break;
++
++ case CKO_PRIVATE_KEY:
++ result = SECITEM_CompareItem(obj->u.key.key.privateKeyOrig, keyDER);
++ break;
++
++ default:
++ /* unhandled object class */
++ return PR_FALSE;
++ }
++
++ return SECEqual == result;
++}
++
++static CK_RV
++LinkSharedKeyObject(int oldKeyIdx, int newKeyIdx)
++{
++ int i;
++ for (i = 0; i < pem_nobjs; i++) {
++ CK_RV rv;
++ pemInternalObject *obj = gobj[i];
++ if (NULL == obj)
++ continue;
++
++ if (atoi(obj->id.data) != oldKeyIdx)
++ continue;
++
++ nss_ZFreeIf(obj->id.data);
++ rv = assignObjectID(obj, newKeyIdx);
++ if (CKR_OK != rv)
++ return rv;
++ }
++
++ return CKR_OK;
++}
++
++pemInternalObject *
++AddObjectIfNeeded(CK_OBJECT_CLASS objClass,
++ pemObjectType type, SECItem * certDER,
++ SECItem * keyDER, char *filename,
++ int objid, CK_SLOT_ID slotID, PRBool *pAdded)
++{
++ int i;
++ pemInternalObject *io;
++
++ /* FIXME: copy-pasted from CreateObject */
++ const char *nickname = strrchr(filename, '/');
++ if (nickname && CKO_PRIVATE_KEY != objClass)
++ nickname++;
++ else
++ nickname = filename;
++
++ if (pAdded)
++ *pAdded = PR_FALSE;
++
++ /* first look for the object in gobj, it might be already there */
++ for (i = 0; i < pem_nobjs; i++) {
++ if (NULL == gobj[i])
++ continue;
++
++ /* Comparing DER encodings is dependable and frees the PEM module
++ * from having to require clients to provide unique nicknames.
++ */
++ if ((gobj[i]->objClass == objClass)
++ && (gobj[i]->type == type)
++ && (gobj[i]->slotID == slotID)
++ && derEncodingsMatch(objClass, gobj[i], certDER, keyDER)) {
++
++ /* While adding a client certificate we (wrongly?) assumed that the
++ * key object will follow right after the cert object. However, if
++ * the key object is shared by multiple client certificates, such
++ * an assumption does not hold. We have to update the references.
++ */
++ LinkSharedKeyObject(pem_nobjs, i);
++
++ plog("AddObjectIfNeeded: re-using internal object #%i\n", i);
++ gobj[i]->refCount ++;
++ return gobj[i];
++ }
++ }
++
++ /* object not found, we need to create it */
++ io = CreateObject(objClass, type, certDER, keyDER,
++ filename, objid, slotID);
++ if (io == NULL)
++ return NULL;
++
++ /* initialize pointers to functions */
++ pem_CreateMDObject(NULL, io, NULL);
++
++ io->gobjIndex = count;
++
++ /* add object to global array */
++ if (count >= size) {
++ gobj = gobj ?
++ nss_ZREALLOCARRAY(gobj, pemInternalObject *,
++ (size+PEM_ITEM_CHUNK) ) :
++ nss_ZNEWARRAY(NULL, pemInternalObject *,
++ (size+PEM_ITEM_CHUNK) ) ;
++
++ if ((pemInternalObject **)NULL == gobj)
++ return NULL;
++ size += PEM_ITEM_CHUNK;
++ }
++ gobj[count] = io;
++ count++;
++ pem_nobjs++;
++
++ if (pAdded)
++ *pAdded = PR_TRUE;
++
++ io->refCount ++;
++ return io;
++}
++
++CK_RV
++AddCertificate(char *certfile, char *keyfile, PRBool cacert,
++ CK_SLOT_ID slotID)
++{
++ pemInternalObject *o;
++ CK_RV error = 0;
++ int objid, i;
++ int nobjs = 0;
++ SECItem **objs = NULL;
++ char *ivstring = NULL;
++ int cipher;
++
++ nobjs = ReadDERFromFile(&objs, certfile, PR_TRUE, &cipher, &ivstring, PR_TRUE /* certs only */);
++ if (nobjs <= 0) {
++ nss_ZFreeIf(objs);
++ return CKR_GENERAL_ERROR;
++ }
++
++ /* For now load as many certs as are in the file for CAs only */
++ if (cacert) {
++ for (i = 0; i < nobjs; i++) {
++ char nickname[1024];
++ objid = pem_nobjs + 1;
++
++ PR_snprintf(nickname, 1024, "%s - %d", certfile, i);
++
++ o = AddObjectIfNeeded(CKO_CERTIFICATE, pemCert, objs[i], NULL,
++ nickname, 0, slotID, NULL);
++ if (o == NULL) {
++ error = CKR_GENERAL_ERROR;
++ goto loser;
++ }
++
++ /* Add the CA trust object */
++ o = AddObjectIfNeeded(CKO_NETSCAPE_TRUST, pemTrust, objs[i], NULL,
++ nickname, 0, slotID, NULL);
++ if (o == NULL) {
++ error = CKR_GENERAL_ERROR;
++ goto loser;
++ }
++ } /* for */
++ } else {
++ objid = pem_nobjs + 1;
++ o = AddObjectIfNeeded(CKO_CERTIFICATE, pemCert, objs[0], NULL, certfile,
++ objid, slotID, NULL);
++ if (o == NULL) {
++ error = CKR_GENERAL_ERROR;
++ goto loser;
++ }
++
++ o = NULL;
++
++ if (keyfile) { /* add the private key */
++ SECItem **keyobjs = NULL;
++ int kobjs = 0;
++ kobjs =
++ ReadDERFromFile(&keyobjs, keyfile, PR_TRUE, &cipher,
++ &ivstring, PR_FALSE);
++ if (kobjs < 1) {
++ error = CKR_GENERAL_ERROR;
++ goto loser;
++ }
++ o = AddObjectIfNeeded(CKO_PRIVATE_KEY, pemBareKey, objs[0],
++ keyobjs[0], certfile, objid, slotID, NULL);
++ if (o == NULL) {
++ error = CKR_GENERAL_ERROR;
++ goto loser;
++ }
++ }
++ }
++
++ nss_ZFreeIf(objs);
++ return CKR_OK;
++
++ loser:
++ nss_ZFreeIf(objs);
++ nss_ZFreeIf(o);
++ return error;
++}
++
++CK_RV
++pem_Initialize
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSUTF8 * configurationData
++)
++{
++ CK_RV rv;
++ /* parse the initialization string */
++ char **certstrings = NULL;
++ char *modparms = NULL;
++ PRInt32 numcerts = 0;
++ PRBool status, error = PR_FALSE;
++ int i;
++ CK_C_INITIALIZE_ARGS_PTR modArgs = NULL;
++
++ if (!fwInstance) return CKR_ARGUMENTS_BAD;
++
++ modArgs = NSSCKFWInstance_GetInitArgs(fwInstance);
++ if (modArgs &&
++ ((modArgs->flags & CKF_OS_LOCKING_OK) || (modArgs->CreateMutex != 0))) {
++ return CKR_CANT_LOCK;
++ }
++
++ if (pemInitialized) {
++ return CKR_OK;
++ }
++
++ RNG_RNGInit();
++
++ open_log();
++
++ plog("pem_Initialize\n");
++
++ if (!modArgs || !modArgs->LibraryParameters) {
++ goto done;
++ }
++ modparms = (char *) modArgs->LibraryParameters;
++ plog("Initialized with %s\n", modparms);
++
++ /*
++ * The initialization string format is a space-delimited file of
++ * pairs of paths which are delimited by a semi-colon. The first
++ * entry of the pair is the path to the certificate file. The
++ * second is the path to the key file.
++ *
++ * CA certificates do not need the semi-colon.
++ *
++ * Example:
++ * /etc/certs/server.pem;/etc/certs/server.key /etc/certs/ca.pem
++ *
++ */
++ status =
++ pem_ParseString(modparms, ' ', &numcerts,
++ &certstrings);
++ if (status == PR_FALSE) {
++ return CKR_ARGUMENTS_BAD;
++ }
++
++ for (i = 0; i < numcerts && error != PR_TRUE; i++) {
++ char *cert = certstrings[i];
++ PRInt32 attrcount = 0;
++ char **certattrs = NULL;
++ status = pem_ParseString(cert, ';', &attrcount, &certattrs);
++ if (status == PR_FALSE) {
++ error = PR_TRUE;
++ break;
++ }
++
++ if (error == PR_FALSE) {
++ if (attrcount == 1) /* CA certificate */
++ rv = AddCertificate(certattrs[0], NULL, PR_TRUE, 0);
++ else
++ rv = AddCertificate(certattrs[0], certattrs[1], PR_FALSE,
++ 0);
++
++ if (rv != CKR_OK) {
++ error = PR_TRUE;
++ status = PR_FALSE;
++ }
++ }
++ pem_FreeParsedStrings(attrcount, certattrs);
++ }
++ pem_FreeParsedStrings(numcerts, certstrings);
++
++ if (status == PR_FALSE) {
++ return CKR_ARGUMENTS_BAD;
++ }
++
++ for (i = 0; i < NUM_SLOTS; i++)
++ token_needsLogin[i] = PR_FALSE;
++
++ done:
++
++ PR_AtomicSet(&pemInitialized, PR_TRUE);
++
++ return CKR_OK;
++}
++
++void
++pem_Finalize
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ plog("pem_Finalize\n");
++ if (!pemInitialized)
++ return;
++
++ nss_ZFreeIf(gobj);
++ gobj = NULL;
++
++ pem_nobjs = 0;
++ size = 0;
++ count = 0;
++
++ PR_AtomicSet(&pemInitialized, PR_FALSE);
++
++ return;
++}
++
++/*
++ * NSSCKMDInstance methods
++ */
++
++static CK_ULONG
++pem_mdInstance_GetNSlots
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (CK_ULONG) NUM_SLOTS;
++}
++
++static CK_VERSION
++pem_mdInstance_GetCryptokiVersion
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return pem_CryptokiVersion;
++}
++
++static NSSUTF8 *
++pem_mdInstance_GetManufacturerID
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSUTF8 *) pem_ManufacturerID;
++}
++
++static NSSUTF8 *
++pem_mdInstance_GetLibraryDescription
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSUTF8 *) pem_LibraryDescription;
++}
++
++static CK_VERSION
++pem_mdInstance_GetLibraryVersion
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return pem_LibraryVersion;
++}
++
++static CK_RV
++pem_mdInstance_GetSlots
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSCKMDSlot * slots[]
++)
++{
++ int i;
++ CK_RV pError;
++
++ for (i = 0; i < NUM_SLOTS; i++) {
++ slots[i] = (NSSCKMDSlot *) pem_NewSlot(fwInstance, &pError);
++ if (pError != CKR_OK)
++ return pError;
++ }
++ return CKR_OK;
++}
++
++CK_BBOOL
++pem_mdInstance_ModuleHandlesSessionObjects
++(
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return CK_TRUE;
++}
++
++NSS_IMPLEMENT_DATA const NSSCKMDInstance
++pem_mdInstance = {
++ (void *) NULL, /* etc */
++ pem_Initialize, /* Initialize */
++ pem_Finalize, /* Finalize */
++ pem_mdInstance_GetNSlots,
++ pem_mdInstance_GetCryptokiVersion,
++ pem_mdInstance_GetManufacturerID,
++ pem_mdInstance_GetLibraryDescription,
++ pem_mdInstance_GetLibraryVersion,
++ pem_mdInstance_ModuleHandlesSessionObjects,
++ pem_mdInstance_GetSlots,
++ NULL, /* WaitForSlotEvent */
++ (void *) NULL /* null terminator */
++};
+diff --git a/a/nss/lib/ckfw/pem/pobject.c b/b/nss/lib/ckfw/pem/pobject.c
+new file mode 100644
+index 0000000..a13e531
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/pobject.c
+@@ -0,0 +1,1240 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "ckpem.h"
++#include "secasn1.h"
++#include "certt.h"
++#include "prprf.h"
++#include "pk11pub.h"
++
++/*
++ * pobject.c
++ *
++ * This file implements the NSSCKMDObject object for the
++ * "PEM objects" cryptoki module.
++ */
++
++NSS_EXTERN_DATA pemInternalObject **gobj;
++NSS_EXTERN_DATA int pem_nobjs;
++NSS_EXTERN_DATA int token_needsLogin[NUM_SLOTS];
++
++#define APPEND_LIST_ITEM(item) do { \
++ item->next = nss_ZNEW(NULL, pemObjectListItem); \
++ if (NULL == item->next) \
++ goto loser; \
++ item = item->next; \
++} while (0)
++
++const CK_ATTRIBUTE_TYPE certAttrs[] = {
++ CKA_CLASS,
++ CKA_TOKEN,
++ CKA_PRIVATE,
++ CKA_MODIFIABLE,
++ CKA_LABEL,
++ CKA_CERTIFICATE_TYPE,
++ CKA_SUBJECT,
++ CKA_ISSUER,
++ CKA_SERIAL_NUMBER,
++ CKA_VALUE
++};
++const PRUint32 certAttrsCount = NSS_PEM_ARRAY_SIZE(certAttrs);
++
++/* private keys, for now only support RSA */
++const CK_ATTRIBUTE_TYPE privKeyAttrs[] = {
++ CKA_CLASS,
++ CKA_TOKEN,
++ CKA_PRIVATE,
++ CKA_MODIFIABLE,
++ CKA_LABEL,
++ CKA_KEY_TYPE,
++ CKA_DERIVE,
++ CKA_LOCAL,
++ CKA_SUBJECT,
++ CKA_SENSITIVE,
++ CKA_DECRYPT,
++ CKA_SIGN,
++ CKA_SIGN_RECOVER,
++ CKA_UNWRAP,
++ CKA_EXTRACTABLE,
++ CKA_ALWAYS_SENSITIVE,
++ CKA_NEVER_EXTRACTABLE,
++ CKA_MODULUS,
++ CKA_PUBLIC_EXPONENT,
++};
++const PRUint32 privKeyAttrsCount = NSS_PEM_ARRAY_SIZE(privKeyAttrs);
++
++/* public keys, for now only support RSA */
++const CK_ATTRIBUTE_TYPE pubKeyAttrs[] = {
++ CKA_CLASS,
++ CKA_TOKEN,
++ CKA_PRIVATE,
++ CKA_MODIFIABLE,
++ CKA_LABEL,
++ CKA_KEY_TYPE,
++ CKA_DERIVE,
++ CKA_LOCAL,
++ CKA_SUBJECT,
++ CKA_ENCRYPT,
++ CKA_VERIFY,
++ CKA_VERIFY_RECOVER,
++ CKA_WRAP,
++ CKA_MODULUS,
++ CKA_PUBLIC_EXPONENT,
++};
++const PRUint32 pubKeyAttrsCount = NSS_PEM_ARRAY_SIZE(pubKeyAttrs);
++
++/* Trust */
++const CK_ATTRIBUTE_TYPE trustAttrs[] = {
++ CKA_CLASS,
++ CKA_TOKEN,
++ CKA_LABEL,
++ CKA_CERT_SHA1_HASH,
++ CKA_CERT_MD5_HASH,
++ CKA_ISSUER,
++ CKA_SUBJECT,
++ CKA_TRUST_SERVER_AUTH,
++ CKA_TRUST_CLIENT_AUTH,
++ CKA_TRUST_EMAIL_PROTECTION,
++ CKA_TRUST_CODE_SIGNING
++};
++const PRUint32 trustAttrsCount = NSS_PEM_ARRAY_SIZE(trustAttrs);
++
++static const CK_BBOOL ck_true = CK_TRUE;
++static const CK_BBOOL ck_false = CK_FALSE;
++static const CK_CERTIFICATE_TYPE ckc_x509 = CKC_X_509;
++static const CK_KEY_TYPE ckk_rsa = CKK_RSA;
++static const CK_OBJECT_CLASS cko_certificate = CKO_CERTIFICATE;
++static const CK_OBJECT_CLASS cko_private_key = CKO_PRIVATE_KEY;
++static const CK_OBJECT_CLASS cko_public_key = CKO_PUBLIC_KEY;
++static const CK_OBJECT_CLASS cko_trust = CKO_NETSCAPE_TRUST;
++static const CK_TRUST ckt_netscape_trusted = CKT_NETSCAPE_TRUSTED_DELEGATOR;
++static const NSSItem pem_trueItem = {
++ (void *) &ck_true, (PRUint32) sizeof(CK_BBOOL)
++};
++static const NSSItem pem_falseItem = {
++ (void *) &ck_false, (PRUint32) sizeof(CK_BBOOL)
++};
++static const NSSItem pem_x509Item = {
++ (void *) &ckc_x509, (PRUint32) sizeof(CK_ULONG)
++};
++static const NSSItem pem_rsaItem = {
++ (void *) &ckk_rsa, (PRUint32) sizeof(CK_KEY_TYPE)
++};
++static const NSSItem pem_certClassItem = {
++ (void *) &cko_certificate, (PRUint32) sizeof(CK_OBJECT_CLASS)
++};
++static const NSSItem pem_privKeyClassItem = {
++ (void *) &cko_private_key, (PRUint32) sizeof(CK_OBJECT_CLASS)
++};
++static const NSSItem pem_pubKeyClassItem = {
++ (void *) &cko_public_key, (PRUint32) sizeof(CK_OBJECT_CLASS)
++};
++static const NSSItem pem_trustClassItem = {
++ (void *) &cko_trust, (PRUint32) sizeof(CK_OBJECT_CLASS)
++};
++static const NSSItem pem_emptyItem = {
++ (void *) &ck_true, 0
++};
++static const NSSItem pem_trusted = {
++ (void *) &ckt_netscape_trusted, (PRUint32) sizeof(CK_TRUST)
++};
++
++/* SEC_SkipTemplate is already defined and exported by libnssutil */
++#ifdef SEC_SKIP_TEMPLATE
++/*
++ * Template for skipping a subitem.
++ *
++ * Note that it only makes sense to use this for decoding (when you want
++ * to decode something where you are only interested in one or two of
++ * the fields); you cannot encode a SKIP!
++ */
++const SEC_ASN1Template SEC_SkipTemplate[] = {
++ {SEC_ASN1_SKIP}
++};
++#endif
++
++/*
++ * Find the subjectName in a DER encoded certificate
++ */
++const SEC_ASN1Template SEC_CertSubjectTemplate[] = {
++ {SEC_ASN1_SEQUENCE,
++ 0, NULL, sizeof(SECItem)} ,
++ {SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED |
++ SEC_ASN1_CONTEXT_SPECIFIC | 0,
++ 0, SEC_SkipTemplate} , /* version */
++ {SEC_ASN1_SKIP}, /* serial number */
++ {SEC_ASN1_SKIP}, /* signature algorithm */
++ {SEC_ASN1_SKIP}, /* issuer */
++ {SEC_ASN1_SKIP}, /* validity */
++ {SEC_ASN1_ANY, 0, NULL}, /* subject */
++ {SEC_ASN1_SKIP_REST},
++ {0}
++};
++
++void
++pem_FetchLabel
++(
++ pemInternalObject * io
++)
++{
++ pemCertObject *co = &io->u.cert;
++
++ co->label.data = io->nickname;
++ co->label.size = strlen(io->nickname);
++}
++
++const NSSItem
++*pem_FetchCertAttribute
++(
++ pemInternalObject * io,
++ CK_ATTRIBUTE_TYPE type
++)
++{
++ switch (type) {
++ case CKA_CLASS:
++ plog(" fetch cert CKA_CLASS\n");
++ return &pem_certClassItem;
++ case CKA_TOKEN:
++ plog(" fetch cert CKA_TOKEN\n");
++ return &pem_trueItem;
++ case CKA_PRIVATE:
++ return &pem_falseItem;
++ case CKA_CERTIFICATE_TYPE:
++ plog(" fetch cert CKA_CERTIFICATE_TYPE\n");
++ return &pem_x509Item;
++ case CKA_LABEL:
++ if (0 == io->u.cert.label.size) {
++ pem_FetchLabel(io);
++ }
++ plog(" fetch cert CKA_LABEL %s\n", io->u.cert.label.data);
++ return &io->u.cert.label;
++ case CKA_SUBJECT:
++ plog(" fetch cert CKA_SUBJECT size %d\n", io->u.cert.subject.size);
++ return &io->u.cert.subject;
++ case CKA_ISSUER:
++ plog(" fetch cert CKA_ISSUER size %d\n", io->u.cert.issuer.size);
++ return &io->u.cert.issuer;
++ case CKA_SERIAL_NUMBER:
++ plog(" fetch cert CKA_SERIAL_NUMBER size %d value %08x\n", io->u.cert.serial.size, io->u.cert.serial.data);
++ return &io->u.cert.serial;
++ case CKA_VALUE:
++ if (0 == io->u.cert.derCert.size) {
++ io->u.cert.derCert.data = io->derCert->data;
++ io->u.cert.derCert.size = io->derCert->len;
++ }
++ plog(" fetch cert CKA_VALUE\n");
++ return &io->u.cert.derCert;
++ case CKA_ID:
++ plog(" fetch cert CKA_ID val=%s size=%d\n", (char *) io->id.data,
++ io->id.size);
++ return &io->id;
++ case CKA_TRUSTED:
++ plog(" fetch cert CKA_TRUSTED: returning NULL\n");
++ return NULL;
++ default:
++ plog(" fetching cert unknown type %d\n", type);
++ break;
++ }
++ return NULL;
++}
++
++const NSSItem *
++pem_FetchPrivKeyAttribute
++(
++ pemInternalObject * io,
++ CK_ATTRIBUTE_TYPE type
++)
++{
++ PRBool isCertType = (pemCert == io->type);
++ pemKeyParams *kp = isCertType ? &io->u.cert.key : &io->u.key.key;
++
++ switch (type) {
++ case CKA_CLASS:
++ return &pem_privKeyClassItem;
++ case CKA_TOKEN:
++ case CKA_LOCAL:
++ case CKA_SIGN:
++ case CKA_DECRYPT:
++ case CKA_SIGN_RECOVER:
++ return &pem_trueItem;
++ case CKA_SENSITIVE:
++ case CKA_PRIVATE: /* should move in the future */
++ case CKA_MODIFIABLE:
++ case CKA_DERIVE:
++ case CKA_UNWRAP:
++ case CKA_EXTRACTABLE: /* will probably move in the future */
++ case CKA_ALWAYS_SENSITIVE:
++ case CKA_NEVER_EXTRACTABLE:
++ return &pem_falseItem;
++ case CKA_KEY_TYPE:
++ return &pem_rsaItem;
++ case CKA_LABEL:
++ if (!isCertType) {
++ return &pem_emptyItem;
++ }
++ if (0 == io->u.cert.label.size) {
++ pem_FetchLabel(io);
++ }
++ plog(" fetch key CKA_LABEL %s\n", io->u.cert.label.data);
++ return &io->u.cert.label;
++ case CKA_SUBJECT:
++ if (!isCertType) {
++ return &pem_emptyItem;
++ }
++ plog(" fetch key CKA_SUBJECT %s\n", io->u.cert.label.data);
++ return &io->u.cert.subject;
++ case CKA_MODULUS:
++ if (0 == kp->modulus.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_MODULUS\n");
++ return &kp->modulus;
++ case CKA_PUBLIC_EXPONENT:
++ if (0 == kp->modulus.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_PUBLIC_EXPONENT\n");
++ return &kp->exponent;
++ case CKA_PRIVATE_EXPONENT:
++ if (0 == kp->privateExponent.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_PRIVATE_EXPONENT\n");
++ return &kp->privateExponent;
++ case CKA_PRIME_1:
++ if (0 == kp->prime1.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_PRIME_1\n");
++ return &kp->prime1;
++ case CKA_PRIME_2:
++ if (0 == kp->prime2.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_PRIME_2\n");
++ return &kp->prime2;
++ case CKA_EXPONENT_1:
++ if (0 == kp->exponent1.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_EXPONENT_1\n");
++ return &kp->exponent1;
++ case CKA_EXPONENT_2:
++ if (0 == kp->exponent2.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_EXPONENT_2\n");
++ return &kp->exponent2;
++ case CKA_COEFFICIENT:
++ if (0 == kp->coefficient.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ plog(" fetch key CKA_COEFFICIENT_2\n");
++ return &kp->coefficient;
++ case CKA_ID:
++ plog(" fetch key CKA_ID val=%s size=%d\n", (char *) io->id.data,
++ io->id.size);
++ return &io->id;
++ default:
++ return NULL;
++ }
++}
++
++const NSSItem *
++pem_FetchPubKeyAttribute
++(
++ pemInternalObject * io,
++ CK_ATTRIBUTE_TYPE type
++)
++{
++ PRBool isCertType = (pemCert == io->type);
++ pemKeyParams *kp = isCertType ? &io->u.cert.key : &io->u.key.key;
++
++ switch (type) {
++ case CKA_CLASS:
++ return &pem_pubKeyClassItem;
++ case CKA_TOKEN:
++ case CKA_LOCAL:
++ case CKA_ENCRYPT:
++ case CKA_VERIFY:
++ case CKA_VERIFY_RECOVER:
++ return &pem_trueItem;
++ case CKA_PRIVATE:
++ case CKA_MODIFIABLE:
++ case CKA_DERIVE:
++ case CKA_WRAP:
++ return &pem_falseItem;
++ case CKA_KEY_TYPE:
++ return &pem_rsaItem;
++ case CKA_LABEL:
++ if (!isCertType) {
++ return &pem_emptyItem;
++ }
++ if (0 == io->u.cert.label.size) {
++ pem_FetchLabel(io);
++ }
++ return &io->u.cert.label;
++ case CKA_SUBJECT:
++ if (!isCertType) {
++ return &pem_emptyItem;
++ }
++ return &io->u.cert.subject;
++ case CKA_MODULUS:
++ if (0 == kp->modulus.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ return &kp->modulus;
++ case CKA_PUBLIC_EXPONENT:
++ if (0 == kp->modulus.size) {
++ pem_PopulateModulusExponent(io);
++ }
++ return &kp->exponent;
++ case CKA_ID:
++ return &io->id;
++ default:
++ break;
++ }
++ return NULL;
++}
++
++const NSSItem *
++pem_FetchTrustAttribute
++(
++ pemInternalObject * io,
++ CK_ATTRIBUTE_TYPE type
++)
++{
++ static NSSItem hash;
++ SECStatus rv;
++
++ switch (type) {
++ case CKA_CLASS:
++ return &pem_trustClassItem;
++ case CKA_TOKEN:
++ return &pem_trueItem;
++ case CKA_PRIVATE:
++ return &pem_falseItem;
++ case CKA_CERTIFICATE_TYPE:
++ return &pem_x509Item;
++ case CKA_LABEL:
++ if (0 == io->u.cert.label.size) {
++ pem_FetchLabel(io);
++ }
++ plog(" fetch trust CKA_LABEL %s\n", io->u.cert.label.data);
++ return &io->u.cert.label;
++ case CKA_SUBJECT:
++ plog(" fetch trust CKA_SUBJECT\n");
++ return NULL;
++ case CKA_ISSUER:
++ plog(" fetch trust CKA_ISSUER\n");
++ return &io->u.cert.issuer;
++ case CKA_SERIAL_NUMBER:
++ plog(" fetch trust CKA_SERIAL_NUMBER size %d value %08x\n", io->u.cert.serial.size, io->u.cert.serial.data);
++ return &io->u.cert.serial;
++ case CKA_VALUE:
++ return &pem_trueItem;
++ case CKA_ID:
++ plog(" fetch trust CKA_ID val=%s size=%d\n", (char *) io->id.data,
++ io->id.size);
++ return &io->id;
++ case CKA_TRUSTED:
++ return &pem_trusted;
++ case CKA_TRUST_SERVER_AUTH:
++ return &pem_trusted;
++ case CKA_TRUST_CLIENT_AUTH:
++ return &pem_trusted;
++ case CKA_TRUST_CODE_SIGNING:
++ return &pem_trusted;
++ case CKA_TRUST_EMAIL_PROTECTION:
++ return &pem_trusted;
++ case CKA_TRUST_IPSEC_END_SYSTEM:
++ return &pem_trusted;
++ case CKA_TRUST_IPSEC_TUNNEL:
++ return &pem_trusted;
++ case CKA_TRUST_IPSEC_USER:
++ return &pem_trusted;
++ case CKA_TRUST_TIME_STAMPING:
++ return &pem_trusted;
++ case CKA_TRUST_STEP_UP_APPROVED:
++ return &pem_falseItem;
++ case CKA_CERT_SHA1_HASH:
++ hash.size = 0;
++ hash.data = NULL;
++ nsslibc_memset(io->u.cert.sha1_hash, 0, SHA1_LENGTH);
++ rv = SHA1_HashBuf(io->u.cert.sha1_hash, io->derCert->data,
++ io->derCert->len);
++ if (rv == SECSuccess) {
++ hash.data = io->u.cert.sha1_hash;
++ hash.size = sizeof(io->u.cert.sha1_hash);
++ }
++ return &hash;
++ case CKA_CERT_MD5_HASH:
++ hash.size = 0;
++ hash.data = NULL;
++ nsslibc_memset(io->u.cert.sha1_hash, 0, MD5_LENGTH);
++ rv = MD5_HashBuf(io->u.cert.sha1_hash, io->derCert->data,
++ io->derCert->len);
++ if (rv == SECSuccess) {
++ hash.data = io->u.cert.sha1_hash;
++ hash.size = sizeof(io->u.cert.sha1_hash);
++ }
++ return &hash;
++ default:
++ return &pem_trusted;
++ break;
++ }
++ return NULL;
++}
++
++const NSSItem *
++pem_FetchAttribute
++(
++ pemInternalObject * io,
++ CK_ATTRIBUTE_TYPE type
++)
++{
++ CK_ULONG i;
++
++ if (io->type == pemRaw) {
++ for (i = 0; i < io->u.raw.n; i++) {
++ if (type == io->u.raw.types[i]) {
++ return &io->u.raw.items[i];
++ }
++ }
++ return NULL;
++ }
++ /* deal with the common attributes */
++ switch (io->objClass) {
++ case CKO_CERTIFICATE:
++ return pem_FetchCertAttribute(io, type);
++ case CKO_PRIVATE_KEY:
++ return pem_FetchPrivKeyAttribute(io, type);
++ case CKO_NETSCAPE_TRUST:
++ return pem_FetchTrustAttribute(io, type);
++ case CKO_PUBLIC_KEY:
++ return pem_FetchPubKeyAttribute(io, type);
++ }
++ return NULL;
++}
++
++/*
++ * Destroy internal object or list object if refCount becomes zero (after
++ * decrement). Safe to call with NULL argument.
++ */
++void
++pem_DestroyInternalObject
++(
++ pemInternalObject * io
++)
++{
++ if (NULL == io)
++ /* nothing to destroy */
++ return;
++
++ if (NULL != io->list) {
++ /* destroy list object */
++ pemObjectListItem *item = io->list;
++ while (item) {
++ pemObjectListItem *next = item->next;
++
++ /* recursion of maximal depth 1 */
++ pem_DestroyInternalObject(item->io);
++
++ nss_ZFreeIf(item);
++ item = next;
++ }
++ nss_ZFreeIf(io);
++ return;
++ }
++
++ io->refCount --;
++ if (0 < io->refCount)
++ return;
++
++ /* destroy internal object */
++ switch (io->type) {
++ case pemRaw:
++ return;
++ case pemCert:
++ nss_ZFreeIf(io->u.cert.labelData);
++ nss_ZFreeIf(io->u.cert.key.privateKey);
++ nss_ZFreeIf(io->u.cert.key.pubKey);
++ /* go through */
++ case pemTrust:
++ nss_ZFreeIf(io->id.data);
++ nss_ZFreeIf(io->nickname);
++ nss_ZFreeIf(io->derCert->data);
++ nss_ZFreeIf(io->derCert);
++ if (io->u.cert.subject.size > 0) {
++ nss_ZFreeIf(io->u.cert.subject.data);
++ }
++ if (io->u.cert.issuer.size > 0) {
++ nss_ZFreeIf(io->u.cert.issuer.data);
++ }
++ if (io->u.cert.serial.size > 0) {
++ nss_ZFreeIf(io->u.cert.serial.data);
++ }
++ break;
++ case pemBareKey:
++ SECITEM_FreeItem(io->u.key.key.privateKeyOrig, PR_TRUE);
++ nss_ZFreeIf(io->u.key.key.coefficient.data);
++ nss_ZFreeIf(io->u.key.key.exponent2.data);
++ nss_ZFreeIf(io->u.key.key.exponent1.data);
++ nss_ZFreeIf(io->u.key.key.prime2.data);
++ nss_ZFreeIf(io->u.key.key.prime1.data);
++ nss_ZFreeIf(io->u.key.key.privateExponent.data);
++ nss_ZFreeIf(io->u.key.key.exponent.data);
++ nss_ZFreeIf(io->u.key.key.modulus.data);
++ nss_ZFreeIf(io->u.key.key.privateKey->data);
++ nss_ZFreeIf(io->u.key.key.privateKey);
++ nss_ZFreeIf(io->u.key.key.pubKey);
++ nss_ZFreeIf(io->id.data);
++ nss_ZFreeIf(io->nickname);
++ nss_ZFreeIf(io->derCert->data);
++ nss_ZFreeIf(io->derCert);
++
++ /* strdup'd in ReadDERFromFile */
++ if (io->u.key.ivstring)
++ free(io->u.key.ivstring);
++ break;
++ }
++
++ if (NULL != gobj)
++ /* remove reference to self from the global array */
++ gobj[io->gobjIndex] = NULL;
++
++ nss_ZFreeIf(io);
++ return;
++}
++
++/*
++ * Finalize - needed
++ * Destroy - CKR_SESSION_READ_ONLY
++ * IsTokenObject - CK_TRUE
++ * GetAttributeCount
++ * GetAttributeTypes
++ * GetAttributeSize
++ * GetAttribute
++ * SetAttribute - unneeded
++ * GetObjectSize - unneeded
++ */
++
++static void
++pem_mdObject_Finalize
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ pem_DestroyInternalObject((pemInternalObject *) mdObject->etc);
++}
++
++static CK_RV
++pem_mdObject_Destroy
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ pemInternalObject *io = (pemInternalObject *) mdObject->etc;
++
++ pem_DestroyInternalObject(io);
++ return CKR_OK;
++}
++
++static CK_BBOOL
++pem_mdObject_IsTokenObject
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return CK_TRUE;
++}
++
++static CK_ULONG
++pem_mdObject_GetAttributeCount
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ pemInternalObject *io = (pemInternalObject *) mdObject->etc;
++
++ if (NULL != io->list) {
++ /* list object --> use the first item in the list */
++ NSSCKMDObject *md = &(io->list->io->mdObject);
++ return md->GetAttributeCount(md, fwObject, mdSession, fwSession,
++ mdToken, fwToken, mdInstance, fwInstance,
++ pError);
++ }
++
++ if (pemRaw == io->type) {
++ return io->u.raw.n;
++ }
++ switch (io->objClass) {
++ case CKO_CERTIFICATE:
++ return certAttrsCount;
++ case CKO_PUBLIC_KEY:
++ return pubKeyAttrsCount;
++ case CKO_PRIVATE_KEY:
++ return privKeyAttrsCount;
++ case CKO_NETSCAPE_TRUST:
++ return trustAttrsCount;
++ default:
++ break;
++ }
++ return 0;
++}
++
++static CK_RV
++pem_mdObject_GetAttributeTypes
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_ATTRIBUTE_TYPE_PTR typeArray,
++ CK_ULONG ulCount
++)
++{
++ pemInternalObject *io = (pemInternalObject *) mdObject->etc;
++ CK_ULONG i;
++ CK_RV error = CKR_OK;
++ const CK_ATTRIBUTE_TYPE *attrs = NULL;
++ CK_ULONG size;
++
++ if (NULL != io->list) {
++ /* list object --> use the first item in the list */
++ NSSCKMDObject *md = &(io->list->io->mdObject);
++ return md->GetAttributeTypes(md, fwObject, mdSession, fwSession,
++ mdToken, fwToken, mdInstance, fwInstance,
++ typeArray, ulCount);
++ }
++
++ size = pem_mdObject_GetAttributeCount(mdObject, fwObject, mdSession,
++ fwSession, mdToken, fwToken, mdInstance,
++ fwInstance, &error);
++
++ if (size != ulCount) {
++ return CKR_BUFFER_TOO_SMALL;
++ }
++ if (io->type == pemRaw) {
++ attrs = io->u.raw.types;
++ } else
++ switch (io->objClass) {
++ case CKO_CERTIFICATE:
++ attrs = certAttrs;
++ break;
++ case CKO_PUBLIC_KEY:
++ attrs = pubKeyAttrs;
++ break;
++ case CKO_PRIVATE_KEY:
++ attrs = privKeyAttrs;
++ break;
++ default:
++ return CKR_OK;
++ }
++
++ for (i = 0; i < size; i++) {
++ typeArray[i] = attrs[i];
++ }
++
++ return CKR_OK;
++}
++
++static CK_ULONG
++pem_mdObject_GetAttributeSize
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_ATTRIBUTE_TYPE attribute,
++ CK_RV * pError
++)
++{
++ pemInternalObject *io = (pemInternalObject *) mdObject->etc;
++ const NSSItem *b;
++
++ if (NULL != io->list) {
++ /* list object --> use the first item in the list */
++ NSSCKMDObject *md = &(io->list->io->mdObject);
++ return md->GetAttributeSize(md, fwObject, mdSession, fwSession,
++ mdToken, fwToken, mdInstance, fwInstance,
++ attribute, pError);
++ }
++
++ b = pem_FetchAttribute(io, attribute);
++
++ if ((const NSSItem *) NULL == b) {
++ *pError = CKR_ATTRIBUTE_TYPE_INVALID;
++ return 0;
++ }
++ return b->size;
++}
++
++static NSSCKFWItem
++pem_mdObject_GetAttribute
++(
++ NSSCKMDObject * mdObject,
++ NSSCKFWObject * fwObject,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_ATTRIBUTE_TYPE attribute,
++ CK_RV * pError
++)
++{
++ NSSCKFWItem mdItem;
++ pemInternalObject *io = (pemInternalObject *) mdObject->etc;
++
++ if (NULL != io->list) {
++ /* list object --> use the first item in the list */
++ NSSCKMDObject *md = &(io->list->io->mdObject);
++ return md->GetAttribute(md, fwObject, mdSession, fwSession,
++ mdToken, fwToken, mdInstance, fwInstance,
++ attribute, pError);
++ }
++
++ mdItem.needsFreeing = PR_FALSE;
++ mdItem.item = (NSSItem *) pem_FetchAttribute(io, attribute);
++
++ if ((NSSItem *) NULL == mdItem.item) {
++ *pError = CKR_ATTRIBUTE_TYPE_INVALID;
++ }
++
++ return mdItem;
++}
++
++/*
++ * get an attribute from a template. Value is returned in NSS item.
++ * data for the item is owned by the template.
++ */
++CK_RV
++pem_GetAttribute
++(
++ CK_ATTRIBUTE_TYPE type,
++ CK_ATTRIBUTE * template,
++ CK_ULONG templateSize,
++ NSSItem * item
++)
++{
++ CK_ULONG i;
++
++ for (i = 0; i < templateSize; i++) {
++ if (template[i].type == type) {
++ item->data = template[i].pValue;
++ item->size = template[i].ulValueLen;
++ return CKR_OK;
++ }
++ }
++ return CKR_TEMPLATE_INCOMPLETE;
++}
++
++/*
++ * get an attribute which is type CK_ULONG.
++ */
++CK_ULONG
++pem_GetULongAttribute
++(
++ CK_ATTRIBUTE_TYPE type,
++ CK_ATTRIBUTE * template,
++ CK_ULONG templateSize,
++ CK_RV * pError
++)
++{
++ NSSItem item;
++
++ *pError = pem_GetAttribute(type, template, templateSize, &item);
++ if (CKR_OK != *pError) {
++ return (CK_ULONG) 0;
++ }
++ if (item.size != sizeof(CK_ULONG)) {
++ *pError = CKR_ATTRIBUTE_VALUE_INVALID;
++ return (CK_ULONG) 0;
++ }
++ return *(CK_ULONG *) item.data;
++}
++
++/*
++ * get an attribute which is type CK_BBOOL.
++ */
++CK_BBOOL
++pem_GetBoolAttribute
++(
++ CK_ATTRIBUTE_TYPE type,
++ CK_ATTRIBUTE * template,
++ CK_ULONG templateSize,
++ CK_RV * pError
++)
++{
++ NSSItem item;
++
++ *pError = pem_GetAttribute(type, template, templateSize, &item);
++ if (CKR_OK != *pError) {
++ return (CK_BBOOL) 0;
++ }
++ if (item.size != sizeof(CK_BBOOL)) {
++ *pError = CKR_ATTRIBUTE_VALUE_INVALID;
++ return (CK_BBOOL) 0;
++ }
++ return *(CK_BBOOL *) item.data;
++}
++
++/*
++ * Get a string attribute. Caller needs to free this.
++ */
++char *
++pem_GetStringAttribute
++(
++ CK_ATTRIBUTE_TYPE type,
++ CK_ATTRIBUTE * template,
++ CK_ULONG templateSize,
++ CK_RV * pError
++)
++{
++ NSSItem item;
++ char *str;
++
++ /* get the attribute */
++ *pError = pem_GetAttribute(type, template, templateSize, &item);
++ if (CKR_OK != *pError) {
++ return (char *) NULL;
++ }
++ /* make sure it is null terminated */
++ str = nss_ZNEWARRAY(NULL, char, item.size + 1);
++ if ((char *) NULL == str) {
++ *pError = CKR_HOST_MEMORY;
++ return (char *) NULL;
++ }
++
++ nsslibc_memcpy(str, item.data, item.size);
++ str[item.size] = 0;
++
++ return str;
++}
++
++static const NSSCKMDObject
++pem_prototype_mdObject = {
++ (void *) NULL, /* etc */
++ pem_mdObject_Finalize,
++ pem_mdObject_Destroy,
++ pem_mdObject_IsTokenObject,
++ pem_mdObject_GetAttributeCount,
++ pem_mdObject_GetAttributeTypes,
++ pem_mdObject_GetAttributeSize,
++ pem_mdObject_GetAttribute,
++ NULL, /* FreeAttribute */
++ NULL, /* SetAttribute */
++ NULL, /* GetObjectSize */
++ (void *) NULL /* null terminator */
++};
++
++NSS_IMPLEMENT NSSCKMDObject *
++pem_CreateMDObject
++(
++ NSSArena * arena,
++ pemInternalObject * io,
++ CK_RV * pError
++)
++{
++ if ((void *) NULL == io->mdObject.etc) {
++ (void) nsslibc_memcpy(&io->mdObject, &pem_prototype_mdObject,
++ sizeof(pem_prototype_mdObject));
++ io->mdObject.etc = (void *) io;
++ }
++
++ return &io->mdObject;
++}
++
++/*
++ * Each object has an identifier. For a certificate and key pair this id
++ * needs to be the same so we use the right combination. If the target object
++ * is a key we first look to see if its certificate was already added and if
++ * so, use that id. The same thing is done when a key is added.
++ */
++NSS_EXTERN NSSCKMDObject *
++pem_CreateObject
++(
++ NSSCKFWInstance * fwInstance,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ CK_RV * pError
++)
++{
++ CK_OBJECT_CLASS objClass;
++ CK_BBOOL isToken;
++ NSSCKFWSlot *fwSlot;
++ CK_SLOT_ID slotID;
++ CK_BBOOL cacert;
++ char *filename;
++ SECItem **derlist = NULL;
++ int nobjs = 0;
++ int i;
++ int objid;
++ pemToken *token;
++ int cipher;
++ char *ivstring = NULL;
++ pemInternalObject *listObj = NULL;
++ pemObjectListItem *listItem = NULL;
++
++ /*
++ * only create token objects
++ */
++ isToken = pem_GetBoolAttribute(CKA_TOKEN, pTemplate,
++ ulAttributeCount, pError);
++ if (CKR_OK != *pError) {
++ return (NSSCKMDObject *) NULL;
++ }
++ if (!isToken) {
++ *pError = CKR_ATTRIBUTE_VALUE_INVALID;
++ return (NSSCKMDObject *) NULL;
++ }
++
++ /* What slot are we adding the object to? */
++ fwSlot = nssCKFWSession_GetFWSlot(fwSession);
++ if ((NSSCKFWSlot *) NULL == fwSlot) {
++ *pError = CKR_ATTRIBUTE_VALUE_INVALID;
++ *pError = CKR_GENERAL_ERROR;
++ return (NSSCKMDObject *) NULL;
++
++ }
++ slotID = nssCKFWSlot_GetSlotID(fwSlot);
++
++ token = (pemToken *) mdToken->etc;
++
++ /*
++ * only create keys and certs.
++ */
++ objClass = pem_GetULongAttribute(CKA_CLASS, pTemplate,
++ ulAttributeCount, pError);
++ if (CKR_OK != *pError) {
++ return (NSSCKMDObject *) NULL;
++ }
++
++ cacert = pem_GetBoolAttribute(CKA_TRUST, pTemplate,
++ ulAttributeCount, pError);
++
++ filename = pem_GetStringAttribute(CKA_LABEL, pTemplate,
++ ulAttributeCount, pError);
++ if (CKR_OK != *pError) {
++ return (NSSCKMDObject *) NULL;
++ }
++
++#ifdef notdef
++ if (objClass == CKO_PUBLIC_KEY) {
++ return CKR_OK; /* fake public key creation, happens as a side effect of
++ * private key creation */
++ }
++#endif
++
++ listObj = nss_ZNEW(NULL, pemInternalObject);
++ if (NULL == listObj) {
++ nss_ZFreeIf(filename);
++ return NULL;
++ }
++
++ listItem = listObj->list = nss_ZNEW(NULL, pemObjectListItem);
++ if (NULL == listItem) {
++ nss_ZFreeIf(listObj);
++ nss_ZFreeIf(filename);
++ return NULL;
++ }
++
++ if (objClass == CKO_CERTIFICATE) {
++ nobjs = ReadDERFromFile(&derlist, filename, PR_TRUE, &cipher, &ivstring, PR_TRUE /* certs only */);
++ if (nobjs < 1)
++ goto loser;
++
++ /* We're just adding a cert, we'll assume the key is next */
++ objid = pem_nobjs + 1;
++
++ if (cacert) {
++ /* Add the certificate. There may be more than one */
++ int c;
++ for (c = 0; c < nobjs; c++) {
++ char nickname[1024];
++ objid = pem_nobjs + 1;
++
++ PR_snprintf(nickname, 1024, "%s - %d", filename, c);
++
++ if (c)
++ APPEND_LIST_ITEM(listItem);
++ listItem->io = AddObjectIfNeeded(CKO_CERTIFICATE, pemCert,
++ derlist[c], NULL, nickname, 0,
++ slotID, NULL);
++ if (listItem->io == NULL)
++ goto loser;
++
++ /* Add the trust object */
++ APPEND_LIST_ITEM(listItem);
++ listItem->io = AddObjectIfNeeded(CKO_NETSCAPE_TRUST, pemTrust,
++ derlist[c], NULL, nickname, 0,
++ slotID, NULL);
++ if (listItem->io == NULL)
++ goto loser;
++ }
++ } else {
++ listItem->io = AddObjectIfNeeded(CKO_CERTIFICATE, pemCert,
++ derlist[0], NULL, filename, objid,
++ slotID, NULL);
++ if (listItem->io == NULL)
++ goto loser;
++ }
++ } else if (objClass == CKO_PRIVATE_KEY) {
++ /* Brute force: find the id of the certificate, if any, in this slot */
++ int i;
++ SECItem certDER;
++ CK_SESSION_HANDLE hSession;
++ PRBool added;
++
++ nobjs = ReadDERFromFile(&derlist, filename, PR_TRUE, &cipher, &ivstring, PR_FALSE /* keys only */);
++ if (nobjs < 1)
++ goto loser;
++
++ certDER.len = 0; /* in case there is no equivalent cert */
++ certDER.data = NULL;
++
++ objid = -1;
++ for (i = 0; i < pem_nobjs; i++) {
++ if (NULL == gobj[i])
++ continue;
++
++ if ((slotID == gobj[i]->slotID) && (gobj[i]->type == pemCert)) {
++ objid = atoi(gobj[i]->id.data);
++ certDER.data =
++ (void *) nss_ZAlloc(NULL, gobj[i]->derCert->len);
++
++ if (certDER.data == NULL)
++ goto loser;
++
++ certDER.len = gobj[i]->derCert->len;
++ nsslibc_memcpy(certDER.data, gobj[i]->derCert->data,
++ gobj[i]->derCert->len);
++ }
++ }
++
++ /* We're just adding a key, we'll assume the cert is next */
++ if (objid == -1)
++ objid = pem_nobjs + 1;
++
++ listItem->io = AddObjectIfNeeded(CKO_PRIVATE_KEY, pemBareKey, &certDER,
++ derlist[0], filename, objid, slotID,
++ &added);
++ if (listItem->io == NULL)
++ goto loser;
++
++ listItem->io->u.key.ivstring = ivstring;
++ listItem->io->u.key.cipher = cipher;
++ nss_ZFreeIf(certDER.data);
++
++ /* If the key was encrypted then free the session to make it appear that
++ * the token was removed so we can force a login.
++ */
++ if (cipher && added) {
++ /* FIXME: Why 1.0s? Is it enough? Isn't it too much?
++ * What about e.g. 3.14s? */
++ PRIntervalTime onesec = PR_SecondsToInterval(1);
++ token_needsLogin[slotID - 1] = PR_TRUE;
++
++ /* We have to sleep so that NSS will notice that the token was
++ * removed.
++ */
++ PR_Sleep(onesec);
++ hSession =
++ nssCKFWInstance_FindSessionHandle(fwInstance, fwSession);
++ nssCKFWInstance_DestroySessionHandle(fwInstance, hSession);
++ } else {
++ *pError = CKR_KEY_UNEXTRACTABLE;
++ }
++ } else {
++ *pError = CKR_ATTRIBUTE_VALUE_INVALID;
++ }
++
++ loser:
++
++ for (i = 0; i < nobjs; i++) {
++ free(derlist[i]->data);
++ free(derlist[i]);
++ }
++ nss_ZFreeIf(filename);
++ nss_ZFreeIf(derlist);
++ if ((pemInternalObject *) NULL == listItem->io) {
++ pem_DestroyInternalObject(listObj);
++ return (NSSCKMDObject *) NULL;
++ }
++ return pem_CreateMDObject(NULL, listObj, pError);
++}
+diff --git a/a/nss/lib/ckfw/pem/prsa.c b/b/nss/lib/ckfw/pem/prsa.c
+new file mode 100644
+index 0000000..d42e9f7
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/prsa.c
+@@ -0,0 +1,702 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "ckpem.h"
++#include "secdert.h"
++#include "secoid.h"
++#include "nssckmdt.h"
++
++#define SSL3_SHAMD5_HASH_SIZE 36 /* LEN_MD5 (16) + LEN_SHA1 (20) */
++
++SEC_ASN1_MKSUB(SEC_AnyTemplate)
++SEC_ASN1_MKSUB(SECOID_AlgorithmIDTemplate)
++
++/*
++ * prsa.c
++ *
++ * This file implements the NSSCKMDMechnaism and NSSCKMDCryptoOperation objects
++ * for the RSA operation.
++ */
++
++const SEC_ASN1Template pem_RSAPrivateKeyTemplate[] = {
++ {SEC_ASN1_SEQUENCE, 0, NULL, sizeof(pemLOWKEYPrivateKey)} ,
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.version)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.modulus)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.publicExponent)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.privateExponent)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.prime1)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.prime2)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.exponent1)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.exponent2)},
++ {SEC_ASN1_INTEGER, offsetof(pemLOWKEYPrivateKey, u.rsa.coefficient)},
++ {0}
++};
++
++static const SEC_ASN1Template pem_AttributeTemplate[] = {
++ { SEC_ASN1_SEQUENCE,
++ 0, NULL, sizeof(NSSLOWKEYAttribute) },
++ { SEC_ASN1_OBJECT_ID, offsetof(NSSLOWKEYAttribute, attrType) },
++ { SEC_ASN1_SET_OF | SEC_ASN1_XTRN, offsetof(NSSLOWKEYAttribute, attrValue),
++ SEC_ASN1_SUB(SEC_AnyTemplate) },
++ { 0 }
++};
++
++static const SEC_ASN1Template pem_SetOfAttributeTemplate[] = {
++ { SEC_ASN1_SET_OF, 0, pem_AttributeTemplate },
++};
++
++const SEC_ASN1Template pem_PrivateKeyInfoTemplate[] = {
++ { SEC_ASN1_SEQUENCE,
++ 0, NULL, sizeof(NSSLOWKEYPrivateKeyInfo) },
++ { SEC_ASN1_INTEGER,
++ offsetof(NSSLOWKEYPrivateKeyInfo,version) },
++ { SEC_ASN1_INLINE | SEC_ASN1_XTRN,
++ offsetof(NSSLOWKEYPrivateKeyInfo,algorithm),
++ SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
++ { SEC_ASN1_OCTET_STRING,
++ offsetof(NSSLOWKEYPrivateKeyInfo,privateKey) },
++ { SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC | 0,
++ offsetof(NSSLOWKEYPrivateKeyInfo, attributes),
++ pem_SetOfAttributeTemplate },
++ { 0 }
++};
++
++/* Declarations */
++SECStatus pem_RSA_Sign(pemLOWKEYPrivateKey * key, unsigned char *output,
++ unsigned int *outputLen, unsigned int maxOutputLen,
++ unsigned char *input, unsigned int inputLen);
++SECStatus pem_RSA_DecryptBlock(pemLOWKEYPrivateKey * key,
++ unsigned char *output, unsigned int *outputLen,
++ unsigned int maxOutputLen, unsigned char *input,
++ unsigned int inputLen);
++
++void prepare_low_rsa_priv_key_for_asn1(pemLOWKEYPrivateKey * key)
++{
++ key->u.rsa.modulus.type = siUnsignedInteger;
++ key->u.rsa.publicExponent.type = siUnsignedInteger;
++ key->u.rsa.privateExponent.type = siUnsignedInteger;
++ key->u.rsa.prime1.type = siUnsignedInteger;
++ key->u.rsa.prime2.type = siUnsignedInteger;
++ key->u.rsa.exponent1.type = siUnsignedInteger;
++ key->u.rsa.exponent2.type = siUnsignedInteger;
++ key->u.rsa.coefficient.type = siUnsignedInteger;
++}
++
++unsigned int
++pem_PrivateModulusLen(pemLOWKEYPrivateKey * privk)
++{
++
++ unsigned char b0;
++
++ switch (privk->keyType) {
++ case pemLOWKEYRSAKey:
++ b0 = privk->u.rsa.modulus.data[0];
++ return b0 ? privk->u.rsa.modulus.len : privk->u.rsa.modulus.len -
++ 1;
++ default:
++ break;
++ }
++ return 0;
++}
++
++struct SFTKHashSignInfoStr {
++ SECOidTag hashOid;
++ pemLOWKEYPrivateKey *key;
++};
++typedef struct SFTKHashSignInfoStr SFTKHashSignInfo;
++
++void
++pem_DestroyPrivateKey(pemLOWKEYPrivateKey * privk)
++{
++ if (privk && privk->arena) {
++ PORT_FreeArena(privk->arena, PR_TRUE);
++ }
++ nss_ZFreeIf(privk);
++}
++
++/* decode and parse the rawkey into the lpk structure */
++static pemLOWKEYPrivateKey *
++pem_getPrivateKey(PLArenaPool *arena, SECItem *rawkey, CK_RV * pError, NSSItem *modulus)
++{
++ pemLOWKEYPrivateKey *lpk = NULL;
++ SECStatus rv = SECFailure;
++ NSSLOWKEYPrivateKeyInfo *pki = NULL;
++ SECItem *keysrc = NULL;
++
++ /* make sure SECOID is initialized - not sure why we have to do this outside of nss_Init */
++ if (SECSuccess != (rv = SECOID_Init())) {
++ *pError = CKR_GENERAL_ERROR;
++ return NULL; /* wha???? */
++ }
++
++ pki = (NSSLOWKEYPrivateKeyInfo*)PORT_ArenaZAlloc(arena,
++ sizeof(NSSLOWKEYPrivateKeyInfo));
++ if(!pki) {
++ *pError = CKR_HOST_MEMORY;
++ goto done;
++ }
++
++ /* let's first see if this is a "raw" RSA private key or an RSA private key in PKCS#8 format */
++ rv = SEC_ASN1DecodeItem(arena, pki, pem_PrivateKeyInfoTemplate, rawkey);
++ if (rv != SECSuccess) {
++ /* not PKCS#8 - assume it's a "raw" RSA private key */
++ keysrc = rawkey;
++ } else if (SECOID_GetAlgorithmTag(&pki->algorithm) == SEC_OID_PKCS1_RSA_ENCRYPTION) {
++ keysrc = &pki->privateKey;
++ } else { /* unsupported */
++ *pError = CKR_FUNCTION_NOT_SUPPORTED;
++ goto done;
++ }
++
++ lpk = (pemLOWKEYPrivateKey *) nss_ZAlloc(NULL,
++ sizeof(pemLOWKEYPrivateKey));
++ if (lpk == NULL) {
++ *pError = CKR_HOST_MEMORY;
++ goto done;
++ }
++
++ lpk->arena = arena;
++ lpk->keyType = pemLOWKEYRSAKey;
++ prepare_low_rsa_priv_key_for_asn1(lpk);
++
++ /* I don't know what this is supposed to accomplish. We free the old
++ modulus data and set it again, making a copy of the new data.
++ But we just allocated a new empty key structure above with
++ nss_ZAlloc. So lpk->u.rsa.modulus.data is NULL and
++ lpk->u.rsa.modulus.len. If the intention is to free the old
++ modulus data, why not just set it to NULL after freeing? Why
++ go through this unnecessary and confusing copying code?
++ */
++ if (modulus) {
++ nss_ZFreeIf(modulus->data);
++ modulus->data = (void *) nss_ZAlloc(NULL, lpk->u.rsa.modulus.len);
++ modulus->size = lpk->u.rsa.modulus.len;
++ nsslibc_memcpy(modulus->data, lpk->u.rsa.modulus.data,
++ lpk->u.rsa.modulus.len);
++ }
++
++ /* decode the private key and any algorithm parameters */
++ rv = SEC_QuickDERDecodeItem(arena, lpk, pem_RSAPrivateKeyTemplate,
++ keysrc);
++
++ if (rv != SECSuccess) {
++ goto done;
++ }
++
++done:
++ return lpk;
++}
++
++void
++pem_PopulateModulusExponent(pemInternalObject * io)
++{
++ const NSSItem *classItem = pem_FetchAttribute(io, CKA_CLASS);
++ const NSSItem *keyType = pem_FetchAttribute(io, CKA_KEY_TYPE);
++ pemLOWKEYPrivateKey *lpk = NULL;
++ PLArenaPool *arena;
++ CK_RV pError = 0;
++
++ /* make sure we have the right objects */
++ if (((const NSSItem *) NULL == classItem) ||
++ (sizeof(CK_OBJECT_CLASS) != classItem->size) ||
++ (CKO_PRIVATE_KEY != *(CK_OBJECT_CLASS *) classItem->data) ||
++ ((const NSSItem *) NULL == keyType) ||
++ (sizeof(CK_KEY_TYPE) != keyType->size) ||
++ (CKK_RSA != *(CK_KEY_TYPE *) keyType->data)) {
++ return;
++ }
++
++ arena = PORT_NewArena(2048);
++ if (!arena) {
++ return;
++ }
++
++ lpk = pem_getPrivateKey(arena, io->u.key.key.privateKey, &pError, NULL);
++ if (lpk == NULL) {
++ PORT_FreeArena(arena, PR_FALSE);
++ return;
++ }
++
++ nss_ZFreeIf(io->u.key.key.modulus.data);
++ io->u.key.key.modulus.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.modulus.len);
++ io->u.key.key.modulus.size = lpk->u.rsa.modulus.len;
++ nsslibc_memcpy(io->u.key.key.modulus.data, lpk->u.rsa.modulus.data,
++ lpk->u.rsa.modulus.len);
++
++ nss_ZFreeIf(io->u.key.key.exponent.data);
++ io->u.key.key.exponent.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.publicExponent.len);
++ io->u.key.key.exponent.size = lpk->u.rsa.publicExponent.len;
++ nsslibc_memcpy(io->u.key.key.exponent.data,
++ lpk->u.rsa.publicExponent.data,
++ lpk->u.rsa.publicExponent.len);
++
++ nss_ZFreeIf(io->u.key.key.privateExponent.data);
++ io->u.key.key.privateExponent.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.privateExponent.len);
++ io->u.key.key.privateExponent.size = lpk->u.rsa.privateExponent.len;
++ nsslibc_memcpy(io->u.key.key.privateExponent.data,
++ lpk->u.rsa.privateExponent.data,
++ lpk->u.rsa.privateExponent.len);
++
++ nss_ZFreeIf(io->u.key.key.prime1.data);
++ io->u.key.key.prime1.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.prime1.len);
++ io->u.key.key.prime1.size = lpk->u.rsa.prime1.len;
++ nsslibc_memcpy(io->u.key.key.prime1.data, lpk->u.rsa.prime1.data,
++ lpk->u.rsa.prime1.len);
++
++ nss_ZFreeIf(io->u.key.key.prime2.data);
++ io->u.key.key.prime2.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.prime2.len);
++ io->u.key.key.prime2.size = lpk->u.rsa.prime2.len;
++ nsslibc_memcpy(io->u.key.key.prime2.data, lpk->u.rsa.prime2.data,
++ lpk->u.rsa.prime2.len);
++
++ nss_ZFreeIf(io->u.key.key.exponent1.data);
++ io->u.key.key.exponent1.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.exponent1.len);
++ io->u.key.key.exponent1.size = lpk->u.rsa.exponent1.len;
++ nsslibc_memcpy(io->u.key.key.exponent1.data, lpk->u.rsa.exponent1.data,
++ lpk->u.rsa.exponent1.len);
++
++ nss_ZFreeIf(io->u.key.key.exponent2.data);
++ io->u.key.key.exponent2.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.exponent2.len);
++ io->u.key.key.exponent2.size = lpk->u.rsa.exponent2.len;
++ nsslibc_memcpy(io->u.key.key.exponent2.data, lpk->u.rsa.exponent2.data,
++ lpk->u.rsa.exponent2.len);
++
++ nss_ZFreeIf(io->u.key.key.coefficient.data);
++ io->u.key.key.coefficient.data =
++ (void *) nss_ZAlloc(NULL, lpk->u.rsa.coefficient.len);
++ io->u.key.key.coefficient.size = lpk->u.rsa.coefficient.len;
++ nsslibc_memcpy(io->u.key.key.coefficient.data,
++ lpk->u.rsa.coefficient.data,
++ lpk->u.rsa.coefficient.len);
++
++ pem_DestroyPrivateKey(lpk);
++ return;
++}
++
++typedef struct pemInternalCryptoOperationRSAPrivStr
++ pemInternalCryptoOperationRSAPriv;
++struct pemInternalCryptoOperationRSAPrivStr
++{
++ NSSCKMDCryptoOperation mdOperation;
++ NSSCKMDMechanism *mdMechanism;
++ pemInternalObject *iKey;
++ pemLOWKEYPrivateKey *lpk;
++ NSSItem *buffer;
++};
++
++/*
++ * pem_mdCryptoOperationRSAPriv_Create
++ */
++static NSSCKMDCryptoOperation *
++pem_mdCryptoOperationRSAPriv_Create
++(
++ const NSSCKMDCryptoOperation * proto,
++ NSSCKMDMechanism * mdMechanism,
++ NSSCKMDObject * mdKey,
++ CK_RV * pError
++)
++{
++ pemInternalObject *iKey = (pemInternalObject *) mdKey->etc;
++ const NSSItem *classItem = pem_FetchAttribute(iKey, CKA_CLASS);
++ const NSSItem *keyType = pem_FetchAttribute(iKey, CKA_KEY_TYPE);
++ pemInternalCryptoOperationRSAPriv *iOperation;
++ pemLOWKEYPrivateKey *lpk = NULL;
++ PLArenaPool *arena;
++
++ /* make sure we have the right objects */
++ if (((const NSSItem *) NULL == classItem) ||
++ (sizeof(CK_OBJECT_CLASS) != classItem->size) ||
++ (CKO_PRIVATE_KEY != *(CK_OBJECT_CLASS *) classItem->data) ||
++ ((const NSSItem *) NULL == keyType) ||
++ (sizeof(CK_KEY_TYPE) != keyType->size) ||
++ (CKK_RSA != *(CK_KEY_TYPE *) keyType->data)) {
++ *pError = CKR_KEY_TYPE_INCONSISTENT;
++ return (NSSCKMDCryptoOperation *) NULL;
++ }
++
++ arena = PORT_NewArena(2048);
++ if (!arena) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDCryptoOperation *) NULL;
++ }
++
++ lpk = pem_getPrivateKey(arena, iKey->u.key.key.privateKey, pError, &iKey->u.key.key.modulus);
++ if (lpk == NULL) {
++ PORT_FreeArena(arena, PR_FALSE);
++ return (NSSCKMDCryptoOperation *) NULL;
++ }
++
++ iOperation = nss_ZNEW(NULL, pemInternalCryptoOperationRSAPriv);
++ if ((pemInternalCryptoOperationRSAPriv *) NULL == iOperation) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDCryptoOperation *) NULL;
++ }
++ iOperation->mdMechanism = mdMechanism;
++ iOperation->iKey = iKey;
++ iOperation->lpk = lpk;
++
++ nsslibc_memcpy(&iOperation->mdOperation,
++ proto, sizeof(NSSCKMDCryptoOperation));
++ iOperation->mdOperation.etc = iOperation;
++
++ return &iOperation->mdOperation;
++}
++
++static void
++pem_mdCryptoOperationRSAPriv_Destroy
++(
++ NSSCKMDCryptoOperation * mdOperation,
++ NSSCKFWCryptoOperation * fwOperation,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ pemInternalCryptoOperationRSAPriv *iOperation =
++ (pemInternalCryptoOperationRSAPriv *) mdOperation->etc;
++
++ if (iOperation->buffer) {
++ nssItem_Destroy(iOperation->buffer);
++ iOperation->buffer = NULL;
++ }
++ pem_DestroyPrivateKey(iOperation->lpk);
++ iOperation->lpk = NULL;
++ nss_ZFreeIf(iOperation);
++}
++
++static CK_ULONG
++pem_mdCryptoOperationRSA_GetFinalLength
++(
++ NSSCKMDCryptoOperation * mdOperation,
++ NSSCKFWCryptoOperation * fwOperation,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ pemInternalCryptoOperationRSAPriv *iOperation =
++ (pemInternalCryptoOperationRSAPriv *) mdOperation->etc;
++ const NSSItem *modulus =
++ pem_FetchAttribute(iOperation->iKey, CKA_MODULUS);
++
++ if (NULL == modulus) {
++ *pError = CKR_FUNCTION_FAILED;
++ return 0;
++ }
++
++ return modulus->size;
++}
++
++
++/*
++ * pem_mdCryptoOperationRSADecrypt_GetOperationLength
++ * we won't know the length until we actually decrypt the
++ * input block. Since we go to all the work to decrypt the
++ * the block, we'll save if for when the block is asked for
++ */
++static CK_ULONG
++pem_mdCryptoOperationRSADecrypt_GetOperationLength
++(
++ NSSCKMDCryptoOperation * mdOperation,
++ NSSCKFWCryptoOperation * fwOperation,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ const NSSItem * input,
++ CK_RV * pError
++)
++{
++ pemInternalCryptoOperationRSAPriv *iOperation =
++ (pemInternalCryptoOperationRSAPriv *) mdOperation->etc;
++ SECStatus rv;
++
++ /* FIXME: Just because Microsoft is broken doesn't mean I have to be.
++ * but this is faster to do for now */
++
++ /* Microsoft's Decrypt operation works in place. Since we don't want
++ * to trash our input buffer, we make a copy of it */
++ iOperation->buffer = nssItem_Duplicate((NSSItem *) input, NULL, NULL);
++ if ((NSSItem *) NULL == iOperation->buffer) {
++ *pError = CKR_HOST_MEMORY;
++ return 0;
++ }
++
++ rv = pem_RSA_DecryptBlock(iOperation->lpk, iOperation->buffer->data,
++ &iOperation->buffer->size,
++ iOperation->buffer->size, input->data,
++ input->size);
++
++ if (rv != SECSuccess) {
++ return 0;
++ }
++
++ return iOperation->buffer->size;
++}
++
++/*
++ * pem_mdCryptoOperationRSADecrypt_UpdateFinal
++ *
++ * NOTE: pem_mdCryptoOperationRSADecrypt_GetOperationLength is presumed to
++ * have been called previously.
++ */
++static CK_RV
++pem_mdCryptoOperationRSADecrypt_UpdateFinal
++(
++ NSSCKMDCryptoOperation * mdOperation,
++ NSSCKFWCryptoOperation * fwOperation,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ const NSSItem * input,
++ NSSItem * output
++)
++{
++ pemInternalCryptoOperationRSAPriv *iOperation =
++ (pemInternalCryptoOperationRSAPriv *) mdOperation->etc;
++ NSSItem *buffer = iOperation->buffer;
++
++ if ((NSSItem *) NULL == buffer) {
++ return CKR_GENERAL_ERROR;
++ }
++ nsslibc_memcpy(output->data, buffer->data, buffer->size);
++ output->size = buffer->size;
++ return CKR_OK;
++}
++
++/*
++ * pem_mdCryptoOperationRSASign_UpdateFinal
++ *
++ */
++static CK_RV
++pem_mdCryptoOperationRSASign_UpdateFinal
++(
++ NSSCKMDCryptoOperation * mdOperation,
++ NSSCKFWCryptoOperation * fwOperation,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ const NSSItem * input,
++ NSSItem * output
++)
++{
++ pemInternalCryptoOperationRSAPriv *iOperation =
++ (pemInternalCryptoOperationRSAPriv *) mdOperation->etc;
++ CK_RV error = CKR_OK;
++ SECStatus rv = SECSuccess;
++
++ rv = pem_RSA_Sign(iOperation->lpk, output->data, &output->size,
++ output->size, input->data, input->size);
++
++ if (rv != SECSuccess) {
++ error = CKR_GENERAL_ERROR;
++ }
++
++ return error;
++}
++
++NSS_IMPLEMENT_DATA const NSSCKMDCryptoOperation
++pem_mdCryptoOperationRSADecrypt_proto = {
++ NULL, /* etc */
++ pem_mdCryptoOperationRSAPriv_Destroy,
++ NULL, /* GetFinalLengh - not needed for one shot Decrypt/Encrypt */
++ pem_mdCryptoOperationRSADecrypt_GetOperationLength,
++ NULL, /* Final - not needed for one shot operation */
++ NULL, /* Update - not needed for one shot operation */
++ NULL, /* DigestUpdate - not needed for one shot operation */
++ pem_mdCryptoOperationRSADecrypt_UpdateFinal,
++ NULL, /* UpdateCombo - not needed for one shot operation */
++ NULL, /* DigestKey - not needed for one shot operation */
++ (void *) NULL /* null terminator */
++};
++
++NSS_IMPLEMENT_DATA const NSSCKMDCryptoOperation
++pem_mdCryptoOperationRSASign_proto = {
++ NULL, /* etc */
++ pem_mdCryptoOperationRSAPriv_Destroy,
++ pem_mdCryptoOperationRSA_GetFinalLength,
++ NULL, /* GetOperationLengh - not needed for one shot Sign/Verify */
++ NULL, /* Final - not needed for one shot operation */
++ NULL, /* Update - not needed for one shot operation */
++ NULL, /* DigestUpdate - not needed for one shot operation */
++ pem_mdCryptoOperationRSASign_UpdateFinal,
++ NULL, /* UpdateCombo - not needed for one shot operation */
++ NULL, /* DigestKey - not needed for one shot operation */
++ (void *) NULL /* null terminator */
++};
++
++/********** NSSCKMDMechansim functions ***********************/
++/*
++ * pem_mdMechanismRSA_Destroy
++ */
++static void
++pem_mdMechanismRSA_Destroy
++(
++ NSSCKMDMechanism * mdMechanism,
++ NSSCKFWMechanism * fwMechanism,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ nss_ZFreeIf(fwMechanism);
++}
++
++/*
++ * pem_mdMechanismRSA_GetMinKeySize
++ */
++static CK_ULONG
++pem_mdMechanismRSA_GetMinKeySize
++(
++ NSSCKMDMechanism * mdMechanism,
++ NSSCKFWMechanism * fwMechanism,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return 384;
++}
++
++/*
++ * pem_mdMechanismRSA_GetMaxKeySize
++ */
++static CK_ULONG
++pem_mdMechanismRSA_GetMaxKeySize
++(
++ NSSCKMDMechanism * mdMechanism,
++ NSSCKFWMechanism * fwMechanism,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return 16384;
++}
++
++/*
++ * pem_mdMechanismRSA_DecryptInit
++ */
++static NSSCKMDCryptoOperation *
++pem_mdMechanismRSA_DecryptInit
++(
++ NSSCKMDMechanism * mdMechanism,
++ NSSCKFWMechanism * fwMechanism,
++ CK_MECHANISM * pMechanism,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSCKMDObject * mdKey,
++ NSSCKFWObject * fwKey,
++ CK_RV * pError
++)
++{
++ return pem_mdCryptoOperationRSAPriv_Create
++ (&pem_mdCryptoOperationRSADecrypt_proto, mdMechanism, mdKey,
++ pError);
++}
++
++/*
++ * pem_mdMechanismRSA_SignInit
++ */
++static NSSCKMDCryptoOperation *
++pem_mdMechanismRSA_SignInit
++(
++ NSSCKMDMechanism * mdMechanism,
++ NSSCKFWMechanism * fwMechanism,
++ CK_MECHANISM * pMechanism,
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSCKMDObject * mdKey,
++ NSSCKFWObject * fwKey,
++ CK_RV * pError
++)
++{
++ return pem_mdCryptoOperationRSAPriv_Create
++ (&pem_mdCryptoOperationRSASign_proto, mdMechanism, mdKey, pError);
++}
++
++NSS_IMPLEMENT_DATA const NSSCKMDMechanism
++pem_mdMechanismRSA = {
++ (void *) NULL, /* etc */
++ pem_mdMechanismRSA_Destroy,
++ pem_mdMechanismRSA_GetMinKeySize,
++ pem_mdMechanismRSA_GetMaxKeySize,
++ NULL, /* GetInHardware - default false */
++ NULL, /* EncryptInit - default errs */
++ pem_mdMechanismRSA_DecryptInit,
++ NULL, /* DigestInit - default errs */
++ pem_mdMechanismRSA_SignInit,
++ NULL, /* VerifyInit - default errs */
++ pem_mdMechanismRSA_SignInit, /* SignRecoverInit */
++ NULL, /* VerifyRecoverInit - default errs */
++ NULL, /* GenerateKey - default errs */
++ NULL, /* GenerateKeyPair - default errs */
++ NULL, /* GetWrapKeyLength - default errs */
++ NULL, /* WrapKey - default errs */
++ NULL, /* UnwrapKey - default errs */
++ NULL, /* DeriveKey - default errs */
++ (void *) NULL /* null terminator */
++};
+diff --git a/a/nss/lib/ckfw/pem/psession.c b/b/nss/lib/ckfw/pem/psession.c
+new file mode 100644
+index 0000000..70c5407
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/psession.c
+@@ -0,0 +1,388 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "ckpem.h"
++#include "secmodt.h"
++#include "pk11pub.h"
++#include "base64.h"
++#include "blapi.h"
++
++/*
++ * psession.c
++ *
++ * This file implements the NSSCKMDSession object for the
++ * "PEM objects" cryptoki module.
++ */
++
++NSS_EXTERN_DATA pemInternalObject **gobj;
++NSS_EXTERN_DATA int pem_nobjs;
++NSS_EXTERN_DATA int token_needsLogin[NUM_SLOTS];
++NSS_EXTERN_DATA const SEC_ASN1Template pem_RSAPrivateKeyTemplate[];
++
++void prepare_low_rsa_priv_key_for_asn1(NSSLOWKEYPrivateKey * key);
++void pem_DestroyPrivateKey(NSSLOWKEYPrivateKey * privk);
++
++/*
++ * Convert a hex string into bytes.
++ */
++static unsigned char *convert_iv(char *src, int num)
++{
++ int i;
++ char conv[3];
++ unsigned char *c;
++
++ c = (unsigned char *) malloc((num) + 1);
++ if (c == NULL)
++ return NULL;
++
++ conv[2] = '\0';
++ memset(c, 0, num);
++ for (i = 0; i < num; i++) {
++ conv[0] = src[(i * 2)];
++ conv[1] = src[(i * 2) + 1];
++ c[i] = strtol(conv, NULL, 16);
++ }
++ return c;
++}
++
++/*
++ * The key is a 24-bit hash. The first 16 bits are the MD5 hash of the
++ * password and the IV (salt). This has is then re-hashed with the
++ * password and IV again and the first 8 bytes of that are the remaining
++ * bytes of the 24-bit key.
++ */
++static int
++make_key(const unsigned char *salt, const unsigned char *data, int len,
++ unsigned char *key)
++{
++ int nkey = 0;
++ MD5Context *Md5Ctx = MD5_NewContext();
++ unsigned int digestLen;
++ int count, i;
++ unsigned char H[25];
++
++ nkey = 24;
++ count = 0;
++
++ while (nkey > 0) {
++ MD5_Begin(Md5Ctx);
++ if (count)
++ MD5_Update(Md5Ctx, (const unsigned char *) H, digestLen);
++ MD5_Update(Md5Ctx, (const unsigned char *) data, len);
++ MD5_Update(Md5Ctx, (const unsigned char *) salt, 8);
++ MD5_End(Md5Ctx, (unsigned char *) H, &digestLen, sizeof(H));
++
++ i = 0;
++ while (nkey && (i != digestLen)) {
++ *(key++) = H[i];
++ nkey--;
++ i++;
++ }
++ count++;
++ }
++ MD5_DestroyContext(Md5Ctx, PR_TRUE);
++
++ return 24;
++}
++
++static NSSCKMDFindObjects *
++pem_mdSession_FindObjectsInit
++(
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ CK_RV * pError
++)
++{
++ plog("mdSession_FindObjectsInit\n");
++ return pem_FindObjectsInit(fwSession, pTemplate, ulAttributeCount,
++ pError);
++}
++
++static NSSCKMDObject *
++pem_mdSession_CreateObject
++(
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSArena * arena,
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ CK_RV * pError
++)
++{
++ plog("mdSession_CreateObject\n");
++ return pem_CreateObject(fwInstance, fwSession, mdToken, pTemplate,
++ ulAttributeCount, pError);
++}
++
++/*
++ * increase refCount of internal object(s)
++ */
++NSSCKMDObject *
++pem_mdSession_CopyObject
++(
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSCKMDObject * mdOldObject,
++ NSSCKFWObject * fwOldObject,
++ NSSArena * arena,
++ CK_ATTRIBUTE_PTR pTemplate,
++ CK_ULONG ulAttributeCount,
++ CK_RV * pError
++)
++{
++ NSSCKMDObject *rvmdObject = NULL;
++ pemInternalObject *io = (pemInternalObject *) mdOldObject->etc;
++
++ /* make a new mdObject */
++ rvmdObject = nss_ZNEW(arena, NSSCKMDObject);
++ if ((NSSCKMDObject *) NULL == rvmdObject) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDObject *) NULL;
++ }
++
++ if (NULL == io->list) {
++ io->refCount ++;
++ } else {
++ /* go through list of objects */
++ pemObjectListItem *item = io->list;
++ while (item) {
++ item->io->refCount ++;
++ item = item->next;
++ }
++ }
++ /* struct (shallow) copy the old one */
++ *rvmdObject = *mdOldObject;
++
++ return rvmdObject;
++}
++
++CK_RV
++pem_mdSession_Login
++(
++ NSSCKMDSession * mdSession,
++ NSSCKFWSession * fwSession,
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_USER_TYPE userType,
++ NSSItem * pin,
++ CK_STATE oldState,
++ CK_STATE newState
++)
++{
++ NSSCKFWSlot *fwSlot;
++ CK_SLOT_ID slotID;
++ pemInternalObject *io = NULL;
++ unsigned char *iv = 0;
++ unsigned char mykey[32];
++ unsigned char *output = NULL;
++ DESContext *cx = NULL;
++ SECStatus rv;
++ unsigned int len = 0;
++ NSSLOWKEYPrivateKey *lpk = NULL;
++ PLArenaPool *arena;
++ SECItem plain;
++ int i;
++
++ fwSlot = NSSCKFWToken_GetFWSlot(fwToken);
++ slotID = nssCKFWSlot_GetSlotID(fwSlot);
++
++ arena = PORT_NewArena(2048);
++ if (!arena) {
++ return CKR_HOST_MEMORY;
++ }
++
++ plog("pem_mdSession_Login '%s'\n", (char *) pin->data);
++
++ token_needsLogin[slotID - 1] = PR_FALSE;
++
++ /* Find the right key object */
++ for (i = 0; i < pem_nobjs; i++) {
++ if (NULL == gobj[i])
++ continue;
++
++ if ((slotID == gobj[i]->slotID) && (gobj[i]->type == pemBareKey)) {
++ io = gobj[i];
++ break;
++ }
++ }
++
++ if (NULL == io) {
++ rv = CKR_SLOT_ID_INVALID;
++ goto loser;
++ }
++
++ /* Convert the IV from hex into an array of bytes */
++ iv = convert_iv(io->u.key.ivstring, 8);
++
++ /* Convert the PIN and IV into a DES key */
++ make_key(iv, pin->data, pin->size, mykey);
++
++ output =
++ (unsigned char *) nss_ZAlloc(NULL,
++ (io->u.key.key.privateKey->len + 1));
++ if (!output) {
++ rv = CKR_HOST_MEMORY;
++ goto loser;
++ }
++
++ cx = DES_CreateContext((const unsigned char *) mykey, iv,
++ io->u.key.cipher, PR_FALSE);
++ if (!cx) {
++ rv = CKR_HOST_MEMORY;
++ goto loser;
++ }
++
++ rv = DES_Decrypt(cx, output, &len, io->u.key.key.privateKey->len,
++ io->u.key.key.privateKey->data,
++ io->u.key.key.privateKey->len);
++ DES_DestroyContext(cx, PR_TRUE);
++
++ if (iv) {
++ free(iv);
++ iv = NULL;
++ }
++ if (rv != SECSuccess) {
++ rv = CKR_PIN_INCORRECT;
++ goto loser;
++ }
++
++ lpk = (NSSLOWKEYPrivateKey *) nss_ZAlloc(NULL,
++ sizeof (NSSLOWKEYPrivateKey));
++ if (lpk == NULL) {
++ rv = CKR_HOST_MEMORY;
++ goto loser;
++ }
++
++ lpk->arena = arena;
++ lpk->keyType = NSSLOWKEYRSAKey;
++ prepare_low_rsa_priv_key_for_asn1(lpk);
++
++
++ /* Decode the resulting blob and see if it is a decodable DER that fits
++ * our private key template. If so we declare success and move on. If not
++ * then we return an error.
++ */
++ memset(&plain, 0, sizeof(plain));
++ plain.data = output;
++ plain.len = len - output[len - 1];
++ rv = SEC_QuickDERDecodeItem(arena, lpk, pem_RSAPrivateKeyTemplate,
++ &plain);
++ pem_DestroyPrivateKey(lpk);
++ arena = NULL;
++ if (rv != SECSuccess)
++ goto loser;
++
++ nss_ZFreeIf(io->u.key.key.privateKey->data);
++ io->u.key.key.privateKey->len = len - output[len - 1];
++ io->u.key.key.privateKey->data =
++ (void *) nss_ZAlloc(NULL, io->u.key.key.privateKey->len);
++ memcpy(io->u.key.key.privateKey->data, output, len - output[len - 1]);
++
++ rv = CKR_OK;
++
++ loser:
++ if (arena)
++ PORT_FreeArena(arena, PR_FALSE);
++ if (iv)
++ free(iv);
++ nss_ZFreeIf(output);
++
++ return rv;
++}
++
++NSS_IMPLEMENT NSSCKMDSession *
++pem_CreateSession
++(
++ NSSCKFWSession * fwSession,
++ CK_RV * pError
++)
++{
++ NSSArena *arena;
++ NSSCKMDSession *rv;
++
++ plog("pem_CreateSession returning new session\n");
++ arena = NSSCKFWSession_GetArena(fwSession, pError);
++ if ((NSSArena *) NULL == arena) {
++ return (NSSCKMDSession *) NULL;
++ }
++
++ rv = nss_ZNEW(arena, NSSCKMDSession);
++ if ((NSSCKMDSession *) NULL == rv) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDSession *) NULL;
++ }
++
++ /*
++ * rv was zeroed when allocated, so we only
++ * need to set the non-zero members.
++ */
++
++ rv->etc = (void *) fwSession;
++ /* rv->Close */
++ /* rv->GetDeviceError */
++ rv->Login = pem_mdSession_Login;
++ /* rv->Logout */
++ /* rv->InitPIN */
++ /* rv->SetPIN */
++ /* rv->GetOperationStateLen */
++ /* rv->GetOperationState */
++ /* rv->SetOperationState */
++ rv->CreateObject = pem_mdSession_CreateObject;
++ rv->CopyObject = pem_mdSession_CopyObject;
++ rv->FindObjectsInit = pem_mdSession_FindObjectsInit;
++ /* rv->SeedRandom */
++ /* rv->GetRandom */
++ /* rv->null */
++
++ return rv;
++}
+diff --git a/a/nss/lib/ckfw/pem/pslot.c b/b/nss/lib/ckfw/pem/pslot.c
+new file mode 100644
+index 0000000..2f9901b
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/pslot.c
+@@ -0,0 +1,183 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "ckpem.h"
++#include "prprf.h"
++
++/*
++ * pslot.c
++ *
++ * This file implements the NSSCKMDSlot object for the
++ * "PEM objects" cryptoki module.
++ */
++
++static NSSUTF8 *
++pem_mdSlot_GetSlotDescription
++(
++ NSSCKMDSlot * mdSlot,
++ NSSCKFWSlot * fwSlot,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ CK_SLOT_ID slotID;
++ NSSArena *arena;
++ char *slotid;
++
++ arena = NSSCKFWInstance_GetArena(fwInstance, pError);
++ slotID = nssCKFWSlot_GetSlotID(fwSlot);
++
++ slotid = (char *) nss_ZAlloc(arena, 256);
++ PR_snprintf(slotid, 256, "PEM Slot #%ld", slotID);
++
++ return (NSSUTF8 *) slotid;
++}
++
++static NSSUTF8 *
++pem_mdSlot_GetManufacturerID
++(
++ NSSCKMDSlot * mdSlot,
++ NSSCKFWSlot * fwSlot,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSUTF8 *) pem_ManufacturerID;
++}
++
++static CK_VERSION
++pem_mdSlot_GetHardwareVersion
++(
++ NSSCKMDSlot * mdSlot,
++ NSSCKFWSlot * fwSlot,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return pem_HardwareVersion;
++}
++
++static CK_VERSION
++pem_mdSlot_GetFirmwareVersion
++(
++ NSSCKMDSlot * mdSlot,
++ NSSCKFWSlot * fwSlot,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return pem_FirmwareVersion;
++}
++
++static NSSCKMDToken *
++pem_mdSlot_GetToken
++(
++ NSSCKMDSlot * mdSlot,
++ NSSCKFWSlot * fwSlot,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSCKMDToken *) mdSlot->etc;
++}
++
++CK_BBOOL
++pem_mdSlot_GetRemovableDevice
++(
++ NSSCKMDSlot * mdSlot,
++ NSSCKFWSlot * fwSlot,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return CK_TRUE;
++}
++
++NSSCKMDSlot *
++pem_NewSlot
++(
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ NSSArena *arena;
++ NSSCKMDSlot *mdSlot;
++
++ plog("pem_NewSlot\n");
++ arena = NSSCKFWInstance_GetArena(fwInstance, pError);
++ if ((NSSArena *) NULL == arena) {
++ if (CKR_OK == *pError) {
++ *pError = CKR_GENERAL_ERROR;
++ }
++ }
++
++ mdSlot = nss_ZNEW(arena, NSSCKMDSlot);
++ if ((NSSCKMDSlot *) NULL == mdSlot) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDSlot *) NULL;
++ }
++
++ mdSlot->etc = pem_NewToken(fwInstance, pError);
++
++ mdSlot->GetSlotDescription = pem_mdSlot_GetSlotDescription;
++ mdSlot->GetManufacturerID = pem_mdSlot_GetManufacturerID;
++ mdSlot->GetHardwareVersion = pem_mdSlot_GetHardwareVersion;
++ mdSlot->GetFirmwareVersion = pem_mdSlot_GetFirmwareVersion;
++ mdSlot->GetRemovableDevice = pem_mdSlot_GetRemovableDevice;
++ mdSlot->GetToken = pem_mdSlot_GetToken;
++
++ return mdSlot;
++}
++
++NSS_IMPLEMENT_DATA const NSSCKMDSlot
++pem_mdSlot = {
++ (void *) NULL, /* etc */
++ NULL, /* Initialize */
++ NULL, /* Destroy */
++ pem_mdSlot_GetSlotDescription,
++ pem_mdSlot_GetManufacturerID,
++ NULL, /* GetTokenPresent -- defaults to true */
++ pem_mdSlot_GetRemovableDevice,
++ NULL, /* GetHardwareSlot -- defaults to false */
++ pem_mdSlot_GetHardwareVersion,
++ pem_mdSlot_GetFirmwareVersion,
++ pem_mdSlot_GetToken,
++ (void *) NULL /* null terminator */
++};
+diff --git a/a/nss/lib/ckfw/pem/ptoken.c b/b/nss/lib/ckfw/pem/ptoken.c
+new file mode 100644
+index 0000000..6c35b21
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/ptoken.c
+@@ -0,0 +1,334 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "ckpem.h"
++#include "prprf.h"
++
++/*
++ * ptoken.c
++ *
++ * This file implements the NSSCKMDToken object for the
++ * "PEM objects" cryptoki module.
++ */
++
++NSS_EXTERN_DATA int token_needsLogin[NUM_SLOTS];
++
++static NSSUTF8 *
++pem_mdToken_GetLabel
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ NSSCKFWSlot *fwSlot;
++ CK_SLOT_ID slotID;
++ NSSArena *arena;
++ char *tokenid;
++
++ arena = NSSCKFWInstance_GetArena(fwInstance, pError);
++ fwSlot = NSSCKFWToken_GetFWSlot(fwToken);
++ slotID = nssCKFWSlot_GetSlotID(fwSlot);
++
++ tokenid = (char *) nss_ZAlloc(arena, 256);
++ PR_snprintf(tokenid, 256, "PEM Token #%ld", slotID);
++
++ return (NSSUTF8 *) tokenid;
++}
++
++static NSSUTF8 *
++pem_mdToken_GetManufacturerID
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSUTF8 *) pem_ManufacturerID;
++}
++
++static NSSUTF8 *
++pem_mdToken_GetModel
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSUTF8 *) pem_TokenModel;
++}
++
++static NSSUTF8 *
++pem_mdToken_GetSerialNumber
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ return (NSSUTF8 *) pem_TokenSerialNumber;
++}
++
++static CK_BBOOL
++pem_mdToken_GetIsWriteProtected
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return CK_TRUE;
++}
++
++static CK_VERSION
++pem_mdToken_GetHardwareVersion
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return pem_HardwareVersion;
++}
++
++static CK_VERSION
++pem_mdToken_GetFirmwareVersion
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return pem_FirmwareVersion;
++}
++
++static NSSCKMDSession *pem_mdToken_OpenSession
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ NSSCKFWSession * fwSession,
++ CK_BBOOL rw,
++ CK_RV * pError
++)
++{
++ plog("pem_mdToken_OpenSession\n");
++ return pem_CreateSession(fwSession, pError);
++}
++
++static CK_ULONG
++pem_mdToken_GetMechanismCount
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ return (CK_ULONG) 1;
++}
++
++static CK_RV
++pem_mdToken_GetMechanismTypes
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_MECHANISM_TYPE types[]
++)
++{
++ types[0] = CKM_RSA_PKCS;
++ return CKR_OK;
++}
++
++static NSSCKMDMechanism *
++pem_mdToken_GetMechanism
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance,
++ CK_MECHANISM_TYPE which,
++ CK_RV * pError
++)
++{
++ if (which != CKM_RSA_PKCS) {
++ *pError = CKR_MECHANISM_INVALID;
++ return (NSSCKMDMechanism *) NULL;
++ }
++ return (NSSCKMDMechanism *) & pem_mdMechanismRSA;
++}
++
++static CK_BBOOL
++pem_mdToken_GetUserPinInitialized
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ plog("pem_mdToken_GetUserPinInitialized: always TRUE\n");
++ return CK_TRUE;
++}
++
++static CK_BBOOL
++pem_mdToken_GetLoginRequired
++(
++ NSSCKMDToken * mdToken,
++ NSSCKFWToken * fwToken,
++ NSSCKMDInstance * mdInstance,
++ NSSCKFWInstance * fwInstance
++)
++{
++ char *label;
++ CK_RV pError;
++ NSSCKFWSlot *fwSlot;
++ CK_SLOT_ID slotID;
++
++ fwSlot = NSSCKFWToken_GetFWSlot(fwToken);
++ slotID = nssCKFWSlot_GetSlotID(fwSlot);
++
++ label = pem_mdToken_GetLabel(mdToken, fwToken, mdInstance, fwInstance,
++ &pError);
++
++ plog("pem_mdToken_GetLoginRequired %s: %d\n", label,
++ token_needsLogin[slotID - 1]);
++
++ if (token_needsLogin[slotID - 1] == PR_TRUE)
++ return CK_TRUE;
++ else
++ return CK_FALSE;
++}
++
++NSSCKMDToken *
++pem_NewToken
++(
++ NSSCKFWInstance * fwInstance,
++ CK_RV * pError
++)
++{
++ NSSArena *arena;
++ NSSCKMDToken *mdToken;
++ pemToken *token;
++
++ arena = NSSCKFWInstance_GetArena(fwInstance, pError);
++ if ((NSSArena *) NULL == arena) {
++ if (CKR_OK == *pError) {
++ *pError = CKR_GENERAL_ERROR;
++ }
++ }
++
++ mdToken = nss_ZNEW(arena, NSSCKMDToken);
++ if ((NSSCKMDToken *) NULL == mdToken) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDToken *) NULL;
++ }
++
++ token = nss_ZNEW(arena, struct pemTokenStr);
++ if ((struct pemTokenStr *) NULL == token) {
++ *pError = CKR_HOST_MEMORY;
++ return (NSSCKMDToken *) NULL;
++ }
++
++ mdToken->etc = (void *) token;
++ mdToken->GetLabel = pem_mdToken_GetLabel;
++ mdToken->GetManufacturerID = pem_mdToken_GetManufacturerID;
++ mdToken->GetModel = pem_mdToken_GetModel;
++ mdToken->GetSerialNumber = pem_mdToken_GetSerialNumber;
++ mdToken->GetIsWriteProtected = pem_mdToken_GetIsWriteProtected;
++ mdToken->GetLoginRequired = pem_mdToken_GetLoginRequired;
++ mdToken->GetUserPinInitialized = pem_mdToken_GetUserPinInitialized;
++ mdToken->GetHardwareVersion = pem_mdToken_GetHardwareVersion;
++ mdToken->GetFirmwareVersion = pem_mdToken_GetFirmwareVersion;
++ mdToken->OpenSession = pem_mdToken_OpenSession;
++ mdToken->GetMechanismCount = pem_mdToken_GetMechanismCount;
++ mdToken->GetMechanismTypes = pem_mdToken_GetMechanismTypes;
++ mdToken->GetMechanism = pem_mdToken_GetMechanism;
++
++ return mdToken;
++}
++
++#if 0
++NSS_IMPLEMENT_DATA const NSSCKMDToken pem_mdToken = {
++ (void *) NULL, /* etc */
++ NULL, /* Setup */
++ NULL, /* Invalidate */
++ NULL, /* InitToken -- default errs */
++ pem_mdToken_GetLabel,
++ pem_mdToken_GetManufacturerID,
++ pem_mdToken_GetModel,
++ pem_mdToken_GetSerialNumber,
++ NULL, /* GetHasRNG -- default is false */
++ pem_mdToken_GetIsWriteProtected,
++ pem_mdToken_GetLoginRequired,
++ pem_mdToken_GetUserPinInitialized,
++ NULL, /* GetRestoreKeyNotNeeded -- irrelevant */
++ NULL, /* GetHasClockOnToken -- default is false */
++ NULL, /* GetHasProtectedAuthenticationPath -- default is false */
++ NULL, /* GetSupportsDualCryptoOperations -- default is false */
++ NULL, /* GetMaxSessionCount -- default is CK_UNAVAILABLE_INFORMATION */
++ NULL, /* GetMaxRwSessionCount -- default is CK_UNAVAILABLE_INFORMATION */
++ NULL, /* GetMaxPinLen -- irrelevant */
++ NULL, /* GetMinPinLen -- irrelevant */
++ NULL, /* GetTotalPublicMemory -- default is CK_UNAVAILABLE_INFORMATION */
++ NULL, /* GetFreePublicMemory -- default is CK_UNAVAILABLE_INFORMATION */
++ NULL, /* GetTotalPrivateMemory -- default is CK_UNAVAILABLE_INFORMATION */
++ NULL, /* GetFreePrivateMemory -- default is CK_UNAVAILABLE_INFORMATION */
++ pem_mdToken_GetHardwareVersion,
++ pem_mdToken_GetFirmwareVersion,
++ NULL, /* GetUTCTime -- no clock */
++ pem_mdToken_OpenSession,
++ pem_mdToken_GetMechanismCount,
++ pem_mdToken_GetMechanismTypes,
++ pem_mdToken_GetMechanism,
++ (void *) NULL /* null terminator */
++};
++#endif
+diff --git a/a/nss/lib/ckfw/pem/rsawrapr.c b/b/nss/lib/ckfw/pem/rsawrapr.c
+new file mode 100644
+index 0000000..1179f2a
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/rsawrapr.c
+@@ -0,0 +1,808 @@
++/*
++ * PKCS#1 encoding and decoding functions.
++ * This file is believed to contain no code licensed from other parties.
++ *
++ * ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++/* $Id: $ */
++
++#include "ckpem.h"
++#include "blapi.h"
++#include "softoken.h"
++#include "sechash.h"
++#include "base.h"
++
++#include "secerr.h"
++
++#define RSA_BLOCK_MIN_PAD_LEN 8
++#define RSA_BLOCK_FIRST_OCTET 0x00
++#define RSA_BLOCK_PRIVATE0_PAD_OCTET 0x00
++#define RSA_BLOCK_PRIVATE_PAD_OCTET 0xff
++#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
++
++#define OAEP_SALT_LEN 8
++#define OAEP_PAD_LEN 8
++#define OAEP_PAD_OCTET 0x00
++
++#define FLAT_BUFSIZE 512 /* bytes to hold flattened SHA1Context. */
++
++unsigned
++pem_PublicModulusLen(NSSLOWKEYPublicKey *pubk)
++{
++ unsigned char b0;
++
++ /* interpret modulus length as key strength... in
++ * fortezza that's the public key length */
++
++ switch (pubk->keyType) {
++ case pemLOWKEYRSAKey:
++ b0 = pubk->u.rsa.modulus.data[0];
++ return b0 ? pubk->u.rsa.modulus.len : pubk->u.rsa.modulus.len - 1;
++ default:
++ break;
++ }
++ return 0;
++}
++
++static SHA1Context *SHA1_CloneContext(SHA1Context * original)
++{
++ SHA1Context *clone = NULL;
++ unsigned char *pBuf;
++ int sha1ContextSize = SHA1_FlattenSize(original);
++ SECStatus frv;
++ unsigned char buf[FLAT_BUFSIZE];
++
++ PORT_Assert(sizeof buf >= sha1ContextSize);
++ if (sizeof buf >= sha1ContextSize) {
++ pBuf = buf;
++ } else {
++ pBuf = nss_ZAlloc(NULL, sha1ContextSize);
++ if (!pBuf)
++ goto done;
++ }
++
++ frv = SHA1_Flatten(original, pBuf);
++ if (frv == SECSuccess) {
++ clone = SHA1_Resurrect(pBuf, NULL);
++ memset(pBuf, 0, sha1ContextSize);
++ }
++ done:
++ if (pBuf != buf)
++ nss_ZFreeIf(pBuf);
++ return clone;
++}
++
++/*
++ * Modify data by XORing it with a special hash of salt.
++ */
++static SECStatus
++oaep_xor_with_h1(unsigned char *data, unsigned int datalen,
++ unsigned char *salt, unsigned int saltlen)
++{
++ SHA1Context *sha1cx;
++ unsigned char *dp, *dataend;
++ unsigned char end_octet;
++
++ sha1cx = SHA1_NewContext();
++ if (sha1cx == NULL) {
++ return SECFailure;
++ }
++
++ /*
++ * Get a hash of salt started; we will use it several times,
++ * adding in a different end octet (x00, x01, x02, ...).
++ */
++ SHA1_Begin(sha1cx);
++ SHA1_Update(sha1cx, salt, saltlen);
++ end_octet = 0;
++
++ dp = data;
++ dataend = data + datalen;
++
++ while (dp < dataend) {
++ SHA1Context *sha1cx_h1;
++ unsigned int sha1len, sha1off;
++ unsigned char sha1[SHA1_LENGTH];
++
++ /*
++ * Create hash of (salt || end_octet)
++ */
++ sha1cx_h1 = SHA1_CloneContext(sha1cx);
++ SHA1_Update(sha1cx_h1, &end_octet, 1);
++ SHA1_End(sha1cx_h1, sha1, &sha1len, sizeof(sha1));
++ SHA1_DestroyContext(sha1cx_h1, PR_TRUE);
++ PORT_Assert(sha1len == SHA1_LENGTH);
++
++ /*
++ * XOR that hash with the data.
++ * When we have fewer than SHA1_LENGTH octets of data
++ * left to xor, use just the low-order ones of the hash.
++ */
++ sha1off = 0;
++ if ((dataend - dp) < SHA1_LENGTH)
++ sha1off = SHA1_LENGTH - (dataend - dp);
++ while (sha1off < SHA1_LENGTH)
++ *dp++ ^= sha1[sha1off++];
++
++ /*
++ * Bump for next hash chunk.
++ */
++ end_octet++;
++ }
++
++ SHA1_DestroyContext(sha1cx, PR_TRUE);
++ return SECSuccess;
++}
++
++/*
++ * Modify salt by XORing it with a special hash of data.
++ */
++static SECStatus
++oaep_xor_with_h2(unsigned char *salt, unsigned int saltlen,
++ unsigned char *data, unsigned int datalen)
++{
++ unsigned char sha1[SHA1_LENGTH];
++ unsigned char *psalt, *psha1, *saltend;
++ SECStatus rv;
++
++ /*
++ * Create a hash of data.
++ */
++ rv = SHA1_HashBuf(sha1, data, datalen);
++ if (rv != SECSuccess) {
++ return rv;
++ }
++
++ /*
++ * XOR the low-order octets of that hash with salt.
++ */
++ PORT_Assert(saltlen <= SHA1_LENGTH);
++ saltend = salt + saltlen;
++ psalt = salt;
++ psha1 = sha1 + SHA1_LENGTH - saltlen;
++ while (psalt < saltend) {
++ *psalt++ ^= *psha1++;
++ }
++
++ return SECSuccess;
++}
++
++/*
++ * Format one block of data for public/private key encryption using
++ * the rules defined in PKCS #1.
++ */
++static unsigned char *rsa_FormatOneBlock(unsigned modulusLen,
++ RSA_BlockType blockType,
++ SECItem * data)
++{
++ unsigned char *block;
++ unsigned char *bp;
++ int padLen;
++ int i;
++ SECStatus rv;
++
++ block = (unsigned char *) nss_ZAlloc(NULL, modulusLen);
++ if (block == NULL)
++ return NULL;
++
++ bp = block;
++
++ /*
++ * All RSA blocks start with two octets:
++ * 0x00 || BlockType
++ */
++ *bp++ = RSA_BLOCK_FIRST_OCTET;
++ *bp++ = (unsigned char) blockType;
++
++ switch (blockType) {
++
++ /*
++ * Blocks intended for private-key operation.
++ */
++ case RSA_BlockPrivate: /* preferred method */
++ /*
++ * 0x00 || BT || Pad || 0x00 || ActualData
++ * 1 1 padLen 1 data->len
++ * Pad is either all 0x00 or all 0xff bytes, depending on blockType.
++ */
++ padLen = modulusLen - data->len - 3;
++ PORT_Assert(padLen >= RSA_BLOCK_MIN_PAD_LEN);
++ if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
++ nss_ZFreeIf(block);
++ return NULL;
++ }
++ nsslibc_memset(bp, RSA_BLOCK_PRIVATE_PAD_OCTET, padLen);
++ bp += padLen;
++ *bp++ = RSA_BLOCK_AFTER_PAD_OCTET;
++ nsslibc_memcpy(bp, data->data, data->len);
++ break;
++
++ /*
++ * Blocks intended for public-key operation.
++ */
++ case RSA_BlockPublic:
++
++ /*
++ * 0x00 || BT || Pad || 0x00 || ActualData
++ * 1 1 padLen 1 data->len
++ * Pad is all non-zero random bytes.
++ */
++ padLen = modulusLen - data->len - 3;
++ PORT_Assert(padLen >= RSA_BLOCK_MIN_PAD_LEN);
++ if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
++ nss_ZFreeIf(block);
++ return NULL;
++ }
++ for (i = 0; i < padLen; i++) {
++ /* Pad with non-zero random data. */
++ do {
++ rv = RNG_GenerateGlobalRandomBytes(bp + i, 1);
++ } while (rv == SECSuccess
++ && bp[i] == RSA_BLOCK_AFTER_PAD_OCTET);
++ if (rv != SECSuccess) {
++ nss_ZFreeIf(block);
++ return NULL;
++ }
++ }
++ bp += padLen;
++ *bp++ = RSA_BLOCK_AFTER_PAD_OCTET;
++ nsslibc_memcpy(bp, data->data, data->len);
++
++ break;
++
++ default:
++ PORT_Assert(0);
++ nss_ZFreeIf(block);
++ return NULL;
++ }
++
++ return block;
++}
++
++static SECStatus
++rsa_FormatBlock(SECItem * result, unsigned modulusLen,
++ RSA_BlockType blockType, SECItem * data)
++{
++ /*
++ * XXX For now assume that the data length fits in a single
++ * XXX encryption block; the ASSERTs below force this.
++ * XXX To fix it, each case will have to loop over chunks whose
++ * XXX lengths satisfy the assertions, until all data is handled.
++ * XXX (Unless RSA has more to say about how to handle data
++ * XXX which does not fit in a single encryption block?)
++ * XXX And I do not know what the result is supposed to be,
++ * XXX so the interface to this function may need to change
++ * XXX to allow for returning multiple blocks, if they are
++ * XXX not wanted simply concatenated one after the other.
++ */
++
++ switch (blockType) {
++ case RSA_BlockPrivate:
++ case RSA_BlockPublic:
++ /*
++ * 0x00 || BT || Pad || 0x00 || ActualData
++ *
++ * The "3" below is the first octet + the second octet + the 0x00
++ * octet that always comes just before the ActualData.
++ */
++ PORT_Assert(data->len <=
++ (modulusLen - (3 + RSA_BLOCK_MIN_PAD_LEN)));
++
++ result->data = rsa_FormatOneBlock(modulusLen, blockType, data);
++ if (result->data == NULL) {
++ result->len = 0;
++ return SECFailure;
++ }
++ result->len = modulusLen;
++
++ break;
++
++ case RSA_BlockRaw:
++ /*
++ * Pad || ActualData
++ * Pad is zeros. The application is responsible for recovering
++ * the actual data.
++ */
++ if (data->len > modulusLen) {
++ return SECFailure;
++ }
++ result->data = (unsigned char *) nss_ZAlloc(NULL, modulusLen);
++ result->len = modulusLen;
++ nsslibc_memcpy(result->data + (modulusLen - data->len), data->data,
++ data->len);
++ break;
++
++ default:
++ PORT_Assert(0);
++ result->data = NULL;
++ result->len = 0;
++ return SECFailure;
++ }
++
++ return SECSuccess;
++}
++
++/* XXX Doesn't set error code */
++SECStatus
++pem_RSA_Sign(pemLOWKEYPrivateKey * key,
++ unsigned char *output,
++ unsigned int *output_len,
++ unsigned int maxOutputLen,
++ unsigned char *input, unsigned int input_len)
++{
++ SECStatus rv = SECSuccess;
++ unsigned int modulus_len = pem_PrivateModulusLen(key);
++ SECItem formatted;
++ SECItem unformatted;
++
++ if (maxOutputLen < modulus_len)
++ return SECFailure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ return SECFailure;
++
++ unformatted.len = input_len;
++ unformatted.data = input;
++ formatted.data = NULL;
++ rv = rsa_FormatBlock(&formatted, modulus_len, RSA_BlockPrivate,
++ &unformatted);
++ if (rv != SECSuccess)
++ goto done;
++
++ rv = RSA_PrivateKeyOpDoubleChecked(&key->u.rsa, output,
++ formatted.data);
++ *output_len = modulus_len;
++
++ goto done;
++
++ done:
++ if (formatted.data != NULL)
++ nss_ZFreeIf(formatted.data);
++ return rv;
++}
++
++#if 0
++/* XXX Doesn't set error code */
++SECStatus
++RSA_CheckSign(NSSLOWKEYPublicKey * key,
++ unsigned char *sign,
++ unsigned int sign_len,
++ unsigned char *hash, unsigned int hash_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PublicModulusLen(key);
++ unsigned int i;
++ unsigned char *buffer;
++
++ modulus_len = pem_PublicModulusLen(key);
++ if (sign_len != modulus_len)
++ goto failure;
++ /*
++ * 0x00 || BT || Pad || 0x00 || ActualData
++ *
++ * The "3" below is the first octet + the second octet + the 0x00
++ * octet that always comes just before the ActualData.
++ */
++ if (hash_len > modulus_len - (3 + RSA_BLOCK_MIN_PAD_LEN))
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++
++ buffer = (unsigned char *) nss_ZAlloc(NULL, modulus_len + 1);
++ if (!buffer)
++ goto failure;
++
++ rv = RSA_PublicKeyOp(&key->u.rsa, buffer, sign);
++ if (rv != SECSuccess)
++ goto loser;
++
++ /*
++ * check the padding that was used
++ */
++ if (buffer[0] != 0 || buffer[1] != 1)
++ goto loser;
++ for (i = 2; i < modulus_len - hash_len - 1; i++) {
++ if (buffer[i] != 0xff)
++ goto loser;
++ }
++ if (buffer[i] != 0)
++ goto loser;
++
++ /*
++ * make sure we get the same results
++ */
++ if (memcmp(buffer + modulus_len - hash_len, hash, hash_len) != 0)
++ goto loser;
++
++ nss_ZFreeIf(buffer);
++ return SECSuccess;
++
++ loser:
++ nss_ZFreeIf(buffer);
++ failure:
++ return SECFailure;
++}
++
++/* XXX Doesn't set error code */
++SECStatus
++RSA_CheckSignRecover(NSSLOWKEYPublicKey * key,
++ unsigned char *data,
++ unsigned int *data_len,
++ unsigned int max_output_len,
++ unsigned char *sign, unsigned int sign_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PublicModulusLen(key);
++ unsigned int i;
++ unsigned char *buffer;
++
++ if (sign_len != modulus_len)
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++
++ buffer = (unsigned char *) nss_ZAlloc(NULL, modulus_len + 1);
++ if (!buffer)
++ goto failure;
++
++ rv = RSA_PublicKeyOp(&key->u.rsa, buffer, sign);
++ if (rv != SECSuccess)
++ goto loser;
++ *data_len = 0;
++
++ /*
++ * check the padding that was used
++ */
++ if (buffer[0] != 0 || buffer[1] != 1)
++ goto loser;
++ for (i = 2; i < modulus_len; i++) {
++ if (buffer[i] == 0) {
++ *data_len = modulus_len - i - 1;
++ break;
++ }
++ if (buffer[i] != 0xff)
++ goto loser;
++ }
++ if (*data_len == 0)
++ goto loser;
++ if (*data_len > max_output_len)
++ goto loser;
++
++ /*
++ * make sure we get the same results
++ */
++ nsslibc_memcpy(data, buffer + modulus_len - *data_len, *data_len);
++
++ nss_ZFreeIf(buffer);
++ return SECSuccess;
++
++ loser:
++ nss_ZFreeIf(buffer);
++ failure:
++ return SECFailure;
++}
++
++/* XXX Doesn't set error code */
++SECStatus
++RSA_EncryptBlock(NSSLOWKEYPublicKey * key,
++ unsigned char *output,
++ unsigned int *output_len,
++ unsigned int max_output_len,
++ unsigned char *input, unsigned int input_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PublicModulusLen(key);
++ SECItem formatted;
++ SECItem unformatted;
++
++ formatted.data = NULL;
++ if (max_output_len < modulus_len)
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++
++ unformatted.len = input_len;
++ unformatted.data = input;
++ formatted.data = NULL;
++ rv = rsa_FormatBlock(&formatted, modulus_len, RSA_BlockPublic,
++ &unformatted);
++ if (rv != SECSuccess)
++ goto failure;
++
++ rv = RSA_PublicKeyOp(&key->u.rsa, output, formatted.data);
++ if (rv != SECSuccess)
++ goto failure;
++
++ nss_ZFreeIf(formatted.data);
++ *output_len = modulus_len;
++ return SECSuccess;
++
++ failure:
++ if (formatted.data != NULL)
++ nss_ZFreeIf(formatted.data);
++ return SECFailure;
++}
++#endif
++
++/* XXX Doesn't set error code */
++SECStatus
++pem_RSA_DecryptBlock(pemLOWKEYPrivateKey * key,
++ unsigned char *output,
++ unsigned int *output_len,
++ unsigned int max_output_len,
++ unsigned char *input, unsigned int input_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PrivateModulusLen(key);
++ unsigned int i;
++ unsigned char *buffer;
++
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++ if (input_len != modulus_len)
++ goto failure;
++
++ buffer = (unsigned char *) nss_ZAlloc(NULL, modulus_len + 1);
++ if (!buffer)
++ goto failure;
++
++ rv = RSA_PrivateKeyOp(&key->u.rsa, buffer, input);
++ if (rv != SECSuccess) {
++ goto loser;
++ }
++
++ if (buffer[0] != 0 || buffer[1] != 2)
++ goto loser;
++ *output_len = 0;
++ for (i = 2; i < modulus_len; i++) {
++ if (buffer[i] == 0) {
++ *output_len = modulus_len - i - 1;
++ break;
++ }
++ }
++ if (*output_len == 0)
++ goto loser;
++ if (*output_len > max_output_len)
++ goto loser;
++
++ nsslibc_memcpy(output, buffer + modulus_len - *output_len, *output_len);
++
++ nss_ZFreeIf(buffer);
++ return SECSuccess;
++
++ loser:
++ nss_ZFreeIf(buffer);
++ failure:
++ return SECFailure;
++}
++
++#if 0
++/* XXX Doesn't set error code */
++/*
++ * added to make pkcs #11 happy
++ * RAW is RSA_X_509
++ */
++SECStatus
++pem_RSA_SignRaw(pemLOWKEYPrivateKey * key,
++ unsigned char *output,
++ unsigned int *output_len,
++ unsigned int maxOutputLen,
++ unsigned char *input, unsigned int input_len)
++{
++ SECStatus rv = SECSuccess;
++ unsigned int modulus_len = pem_PrivateModulusLen(key);
++ SECItem formatted;
++ SECItem unformatted;
++
++ if (maxOutputLen < modulus_len)
++ return SECFailure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ return SECFailure;
++
++ unformatted.len = input_len;
++ unformatted.data = input;
++ formatted.data = NULL;
++ rv = rsa_FormatBlock(&formatted, modulus_len, RSA_BlockRaw,
++ &unformatted);
++ if (rv != SECSuccess)
++ goto done;
++
++ rv = RSA_PrivateKeyOpDoubleChecked(&key->u.rsa, output,
++ formatted.data);
++ *output_len = modulus_len;
++
++ done:
++ if (formatted.data != NULL)
++ nss_ZFreeIf(formatted.data);
++ return rv;
++}
++
++/* XXX Doesn't set error code */
++SECStatus
++RSA_CheckSignRaw(NSSLOWKEYPublicKey * key,
++ unsigned char *sign,
++ unsigned int sign_len,
++ unsigned char *hash, unsigned int hash_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PublicModulusLen(key);
++ unsigned char *buffer;
++
++ if (sign_len != modulus_len)
++ goto failure;
++ if (hash_len > modulus_len)
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++
++ buffer = (unsigned char *) nss_ZAlloc(NULL, modulus_len + 1);
++ if (!buffer)
++ goto failure;
++
++ rv = RSA_PublicKeyOp(&key->u.rsa, buffer, sign);
++ if (rv != SECSuccess)
++ goto loser;
++
++ /*
++ * make sure we get the same results
++ */
++ /* NOTE: should we verify the leading zeros? */
++ if (memcmp(buffer + (modulus_len - hash_len), hash, hash_len) !=
++ 0)
++ goto loser;
++
++ nss_ZFreeIf(buffer);
++ return SECSuccess;
++
++ loser:
++ nss_ZFreeIf(buffer);
++ failure:
++ return SECFailure;
++}
++
++/* XXX Doesn't set error code */
++SECStatus
++RSA_CheckSignRecoverRaw(NSSLOWKEYPublicKey * key,
++ unsigned char *data,
++ unsigned int *data_len,
++ unsigned int max_output_len,
++ unsigned char *sign, unsigned int sign_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PublicModulusLen(key);
++
++ if (sign_len != modulus_len)
++ goto failure;
++ if (max_output_len < modulus_len)
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++
++ rv = RSA_PublicKeyOp(&key->u.rsa, data, sign);
++ if (rv != SECSuccess)
++ goto failure;
++
++ *data_len = modulus_len;
++ return SECSuccess;
++
++ failure:
++ return SECFailure;
++}
++
++
++/* XXX Doesn't set error code */
++SECStatus
++RSA_EncryptRaw(NSSLOWKEYPublicKey * key,
++ unsigned char *output,
++ unsigned int *output_len,
++ unsigned int max_output_len,
++ unsigned char *input, unsigned int input_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PublicModulusLen(key);
++ SECItem formatted;
++ SECItem unformatted;
++
++ formatted.data = NULL;
++ if (max_output_len < modulus_len)
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++
++ unformatted.len = input_len;
++ unformatted.data = input;
++ formatted.data = NULL;
++ rv = rsa_FormatBlock(&formatted, modulus_len, RSA_BlockRaw,
++ &unformatted);
++ if (rv != SECSuccess)
++ goto failure;
++
++ rv = RSA_PublicKeyOp(&key->u.rsa, output, formatted.data);
++ if (rv != SECSuccess)
++ goto failure;
++
++ nss_ZFreeIf(formatted.data);
++ *output_len = modulus_len;
++ return SECSuccess;
++
++ failure:
++ if (formatted.data != NULL)
++ nss_ZFreeIf(formatted.data);
++ return SECFailure;
++}
++
++/* XXX Doesn't set error code */
++SECStatus
++pem_RSA_DecryptRaw(pemLOWKEYPrivateKey * key,
++ unsigned char *output,
++ unsigned int *output_len,
++ unsigned int max_output_len,
++ unsigned char *input, unsigned int input_len)
++{
++ SECStatus rv;
++ unsigned int modulus_len = pem_PrivateModulusLen(key);
++
++ if (modulus_len <= 0)
++ goto failure;
++ if (modulus_len > max_output_len)
++ goto failure;
++ PORT_Assert(key->keyType == pemLOWKEYRSAKey);
++ if (key->keyType != pemLOWKEYRSAKey)
++ goto failure;
++ if (input_len != modulus_len)
++ goto failure;
++
++ rv = RSA_PrivateKeyOp(&key->u.rsa, output, input);
++ if (rv != SECSuccess) {
++ goto failure;
++ }
++
++ *output_len = modulus_len;
++ return SECSuccess;
++
++ failure:
++ return SECFailure;
++}
++#endif
+diff --git a/a/nss/lib/ckfw/pem/util.c b/b/nss/lib/ckfw/pem/util.c
+new file mode 100644
+index 0000000..e5fb4da
+--- /dev/null
++++ b/b/nss/lib/ckfw/pem/util.c
+@@ -0,0 +1,314 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Netscape security libraries.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1994-2000
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Rob Crittenden (rcritten@redhat.com)
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++/* cribbed from secutil.c */
++
++#include "prtypes.h"
++#include "prtime.h"
++#include "prlong.h"
++#include "prerror.h"
++#include "prlog.h"
++#include "prprf.h"
++#include "plgetopt.h"
++#include "plstr.h"
++#include "prenv.h"
++#include "prnetdb.h"
++#include "base.h"
++#include "base64.h"
++
++#include "cryptohi.h"
++#include "secpkcs7.h"
++#include "secerr.h"
++
++#include "ckpem.h"
++
++#include <stdarg.h>
++
++#define CHUNK_SIZE 512
++#define PUT_Object(obj,err) \
++ { \
++ if (count >= size) { \
++ *derlist = *derlist ? \
++ nss_ZREALLOCARRAY(*derlist, SECItem *, \
++ (size+CHUNK_SIZE) ) : \
++ nss_ZNEWARRAY(NULL, SECItem *, \
++ (size+CHUNK_SIZE) ) ; \
++ if ((SECItem **)NULL == *derlist) { \
++ err = CKR_HOST_MEMORY; \
++ goto loser; \
++ } \
++ size += CHUNK_SIZE; \
++ } \
++ (*derlist)[ count ] = (obj); \
++ count++; \
++ }
++
++/* Read certificates from a flat file */
++
++static SECItem *AllocItem(SECItem * item, unsigned int len)
++{
++ SECItem *result = NULL;
++
++ if (item == NULL) {
++ result = nss_ZAlloc(NULL, sizeof(SECItem));
++ if (result == NULL) {
++ goto loser;
++ }
++ } else {
++ PORT_Assert(item->data == NULL);
++ result = item;
++ }
++
++ result->len = len;
++ if (len) {
++ result->data = nss_ZAlloc(NULL, len);
++ }
++
++ return (result);
++
++ loser:
++ return (NULL);
++}
++
++static SECStatus FileToItem(SECItem * dst, PRFileDesc * src)
++{
++ PRFileInfo info;
++ PRInt32 numBytes;
++ PRStatus prStatus;
++
++ prStatus = PR_GetOpenFileInfo(src, &info);
++
++ if (prStatus != PR_SUCCESS || info.type == PR_FILE_DIRECTORY) {
++ return SECFailure;
++ }
++
++ /* XXX workaround for 3.1, not all utils zero dst before sending */
++ dst->data = 0;
++ if (!AllocItem(dst, info.size+1))
++ goto loser;
++
++ numBytes = PR_Read(src, dst->data, info.size);
++ if (numBytes != info.size) {
++ goto loser;
++ }
++
++ return SECSuccess;
++ loser:
++ nss_ZFreeIf(dst->data);
++ return SECFailure;
++}
++
++int
++ReadDERFromFile(SECItem *** derlist, char *filename, PRBool ascii,
++ int *cipher, char **ivstring, PRBool certsonly)
++{
++ SECStatus rv;
++ PRFileDesc *inFile;
++ int count = 0, size = 0;
++ SECItem *der = NULL;
++ int error;
++ SECItem filedata;
++ char *c, *iv;
++
++ inFile = PR_Open(filename, PR_RDONLY, 0);
++ if (!inFile)
++ return -1;
++
++ if (ascii) {
++ /* First convert ascii to binary */
++ char *asc, *body;
++
++ /* Read in ascii data */
++ rv = FileToItem(&filedata, inFile);
++ if (rv != SECSuccess) {
++ PR_Close(inFile);
++ return -1;
++ }
++ asc = (char *) filedata.data;
++ if (!asc) {
++ PR_Close(inFile);
++ return -1;
++ }
++
++ /* check for headers and trailers and remove them */
++ if (strstr(asc, "-----BEGIN") != NULL) {
++ int key = 0;
++ while ((asc) && ((body = strstr(asc, "-----BEGIN")) != NULL)) {
++ char *trailer;
++ key = 0;
++ if ((strncmp(body, "-----BEGIN RSA PRIVATE KEY", 25) == 0) ||
++ (strncmp(body, "-----BEGIN PRIVATE KEY", 21) == 0)) {
++ key = 1;
++ c = body;
++ body = strchr(body, '\n');
++ if (NULL == body)
++ goto loser;
++ body++;
++ if (strncmp(body, "Proc-Type: 4,ENCRYPTED", 22) == 0) {
++ body = strchr(body, '\n');
++ if (NULL == body)
++ goto loser;
++ body++;
++ if (strncmp(body, "DEK-Info: ", 10) == 0) {
++ body += 10;
++ c = body;
++ body = strchr(body, ',');
++ if (body == NULL)
++ goto loser;
++ *body = '\0';
++ if (!PL_strcasecmp(c, "DES-EDE3-CBC"))
++ *cipher = NSS_DES_EDE3_CBC;
++ else if (!PL_strcasecmp(c, "DES-CBC"))
++ *cipher = NSS_DES_CBC;
++ else {
++ *cipher = -1;
++ goto loser;
++ }
++ body++;
++ iv = body;
++ body = strchr(body, '\n');
++ if (body == NULL)
++ goto loser;
++ *body = '\0';
++ body++;
++ *ivstring = strdup(iv);
++ }
++ } else { /* Else the private key is not encrypted */
++ *cipher = 0;
++ body = c;
++ }
++ }
++ der = (SECItem *) malloc(sizeof(SECItem));
++ if (der == NULL)
++ goto loser;
++
++ trailer = NULL;
++ asc = body;
++ body = strchr(body, '\n');
++ if (!body)
++ body = strchr(asc, '\r'); /* maybe this is a MAC file */
++ if (body) {
++ trailer = strstr(++body, "-----END");
++ }
++ if (trailer != NULL) {
++ asc = trailer + 1;
++ *trailer = '\0';
++ } else {
++ free(der);
++ goto loser;
++ }
++
++ /* Convert to binary */
++ rv = ATOB_ConvertAsciiToItem(der, body);
++ if (rv) {
++ free(der);
++ goto loser;
++ }
++ if ((certsonly && !key) || (!certsonly && key)) {
++ PUT_Object(der, error);
++ } else {
++ free(der->data);
++ free(der);
++ }
++ } /* while */
++ } else { /* No headers and footers, translate the blob */
++ der = (SECItem *) malloc(sizeof(SECItem));
++ if (der == NULL)
++ goto loser;
++
++ rv = ATOB_ConvertAsciiToItem(der, asc);
++ if (rv) {
++ free(der);
++ goto loser;
++ }
++
++ /* NOTE: This code path has never been tested. */
++ PUT_Object(der, error);
++ }
++
++ nss_ZFreeIf(filedata.data);
++ filedata.data = 0;
++ filedata.len = 0;
++ } else {
++ /* Read in binary der */
++ rv = FileToItem(der, inFile);
++ if (rv != SECSuccess) {
++ PR_Close(inFile);
++ return -1;
++ }
++ }
++ PR_Close(inFile);
++ return count;
++
++ loser:
++ if (filedata.len > 0)
++ nss_ZFreeIf(filedata.data);
++ PR_Close(inFile);
++ return -1;
++}
++
++#ifdef DEBUG
++#define LOGGING_BUFFER_SIZE 400
++#define PEM_DEFAULT_LOG_FILE "/tmp/pkcs11.log"
++static const char *pemLogModuleName = "PEM";
++static PRLogModuleInfo* pemLogModule;
++#endif
++
++void open_log()
++{
++#ifdef DEBUG
++ const char *nsprLogFile = PR_GetEnv("NSPR_LOG_FILE");
++
++ pemLogModule = PR_NewLogModule(pemLogModuleName);
++
++ (void) PR_SetLogFile(nsprLogFile ? nsprLogFile : PEM_DEFAULT_LOG_FILE);
++ /* If false, the log file will remain what it was before */
++#endif
++}
++
++void plog(const char *fmt, ...)
++{
++#ifdef DEBUG
++ char buf[LOGGING_BUFFER_SIZE];
++ va_list ap;
++
++ va_start(ap, fmt);
++ PR_vsnprintf(buf, sizeof(buf), fmt, ap);
++ va_end(ap);
++ PR_LOG(pemLogModule, PR_LOG_DEBUG, ("%s", buf));
++#endif
++}
--- /dev/null
+--- a/a/nspr/configure 2010-08-18 07:23:01.000000000 -0500
++++ b/b/nspr/configure 2010-08-18 07:33:11.000000000 -0500
+@@ -2973,7 +2973,8 @@
+ #define SYSV 1
+ EOF
+
+- DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
++ MKSHLIB='$(CCC) -shared $(DSO_LDOPTS) -o $@'
++ DSO_LDOPTS='-Wl,-brtl -Wl,-bnortllib -Wl,-blibpath:/usr/lib:/lib'
+ ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6
+ echo "configure:3477: checking for sys/atomic_op.h" >&5
+@@ -3102,7 +3103,6 @@
+ AIX_LINK_OPTS='-brtl -bnso -berok'
+ ;;
+ esac
+- CFLAGS="$CFLAGS -qro -qroconst"
+ AIX_WRAP='$(DIST)/lib/aixwrap.o'
+ AIX_TMP='./_aix_tmp.o'
+ if test -n "$USE_64"; then
+--- a/a/nspr/configure.in 2010-08-18 07:23:01.000000000 -0500
++++ b/b/nspr/configure.in 2010-08-18 07:32:36.000000000 -0500
+@@ -831,7 +831,8 @@
+ AC_DEFINE(XP_UNIX)
+ AC_DEFINE(AIX)
+ AC_DEFINE(SYSV)
+- DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
++ DSO_LDOPTS='-Wl,-brtl -Wl,-bnortllib -Wl,-blibpath:/usr/lib:/lib'
++ MKSHLIB='$(CCC) -shared $(DSO_LDOPTS) -o $@'
+ AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
+ case "${target_os}" in
+ aix3.2*)
+@@ -871,10 +872,9 @@
+ AC_DEFINE(HAVE_SOCKLEN_T)
+ AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
+ USE_IPV6=1
+- AIX_LINK_OPTS='-brtl -bnso -berok'
++ AIX_LINK_OPTS='-Wl,-brtl -Wl,-bnso -Wl,-berok'
+ ;;
+ esac
+- CFLAGS="$CFLAGS -qro -qroconst"
+ AIX_WRAP='$(DIST)/lib/aixwrap.o'
+ AIX_TMP='./_aix_tmp.o'
+ if test -n "$USE_64"; then
+--- a/a/nspr/pr/src/Makefile.in 2010-08-18 07:23:04.000000000 -0500
++++ b/b/nspr/pr/src/Makefile.in 2010-08-18 07:24:49.000000000 -0500
+@@ -110,7 +110,6 @@
+ endif
+
+ ifeq ($(OS_ARCH),AIX)
+-DSO_LDOPTS += -binitfini::_PR_Fini
+ OS_LIBS = -lodm -lcfg
+ ifeq ($(CLASSIC_NSPR),1)
+ ifeq ($(OS_RELEASE),4.1)
+--- a/a/nss/coreconf/AIX.mk 2010-08-18 07:23:06.000000000 -0500
++++ b/b/nss/coreconf/AIX.mk 2010-08-18 07:26:26.000000000 -0500
+@@ -62,35 +62,30 @@
+
+ DEFAULT_COMPILER = xlc_r
+
+-CC = xlc_r
+-CCC = xlC_r
++CCC = $(CXX)
+
+ CPU_ARCH = rs6000
+
+ RANLIB = ranlib
+
+ OS_CFLAGS = -DAIX -DSYSV
+-OS_LIBS += -blibpath:/usr/lib:/lib -lc -lm
++OS_LIBS += -Wl,-blibpath:/usr/lib:/lib -lc -lm
+
+-DSO_LDOPTS = -brtl -bnortllib -bM:SRE -bnoentry
+-MKSHLIB = $(LD) $(DSO_LDOPTS) -blibpath:/usr/lib:/lib -lc -lm
++DSO_LDOPTS = -Wl,-brtl -Wl,-bnortllib
++MKSHLIB = $(CC) --shared $(DSO_LDOPTS) -Wl,-blibpath:/usr/lib:/lib -lc -lm
+
+ AIX_WRAP = $(DIST)/lib/aixwrap.o
+ AIX_TMP = $(OBJDIR)/_aix_tmp.o
+
+ ifdef MAPFILE
+-DSO_LDOPTS += -bexport:$(MAPFILE)
++DSO_LDOPTS += -Wl,-bexport:$(MAPFILE)
+ else
+-DSO_LDOPTS += -bexpall
++DSO_LDOPTS += -Wl,-bexpall
+ endif
+
+ PROCESS_MAP_FILE = grep -v ';+' $< | grep -v ';-' | \
+ sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' > $@
+
+-ifdef BUILD_OPT
+- OPTIMIZER += -qmaxmem=-1
+-endif
+-
+ ifeq ($(USE_64), 1)
+ OS_CFLAGS += -DAIX_64BIT
+ OBJECT_MODE=64
+--- a/a/nss/cmd/platlibs.mk 2010-08-18 07:23:18.000000000 -0500
++++ b/b/nss/cmd/platlibs.mk 2010-08-18 07:26:48.000000000 -0500
+@@ -136,7 +136,7 @@
+ $(NULL)
+
+ ifeq ($(OS_ARCH), AIX)
+-EXTRA_SHARED_LIBS += -brtl
++EXTRA_SHARED_LIBS += -Wl,-brtl
+ endif
+
+ # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
+@@ -186,7 +186,7 @@
+ $(NULL)
+
+ ifeq ($(OS_ARCH), AIX)
+-EXTRA_SHARED_LIBS += -brtl
++EXTRA_SHARED_LIBS += -Wl,-brtl
+ endif
+
+ # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
+--- a/a/nss/cmd/shlibsign/mangle/Makefile 2010-08-18 07:23:20.000000000 -0500
++++ b/b/nss/cmd/shlibsign/mangle/Makefile 2010-08-18 07:42:44.000000000 -0500
+@@ -75,7 +75,9 @@
+
+ endif
+
+-
++ifeq ($(OS), AIX)
++EXTRA_SHARED_LIBS += -lpthreads
++endif
+
+ #######################################################################
+ # (5) Execute "global" rules. (OPTIONAL) #
+--- a/a/nss/cmd/shlibsign/Makefile 2010-08-18 08:00:17.000000000 -0500
++++ b/b/nss/cmd/shlibsign/Makefile 2010-08-18 07:55:55.000000000 -0500
+@@ -45,6 +45,9 @@
+
+ endif
+
++ifeq ($(OS), AIX)
++EXTRA_SHARED_LIBS += -lpthreads
++endif
+
+ # sign any and all shared libraries that contain the word freebl
+ ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1)
--- /dev/null
+--- a/a/a/nspr/config/Makefile.in.dt 2012-10-29 13:30:49.244696426 +0100
++++ a/a/a/nspr/config/Makefile.in 2012-10-29 13:31:26.541830215 +0100
+@@ -30,7 +30,6 @@ CSRCS = now.c
+
+ # This version hasn't been ported for us; the one in mozilla/config has
+ ifneq ($(OS_ARCH),OS2)
+-CSRCS += nsinstall.c
+
+ PLSRCS = nfspwd.pl
+ endif
+@@ -84,7 +83,6 @@ else
+ ifeq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
+ TARGETS = $(PROGS)
+ else
+-PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
+ TARGETS = $(PROGS) $(PLSRCS:.pl=)
+ endif
+ endif
+--- a/a/a/nss/lib/nss/config.mk.dt 2012-10-30 12:31:06.675726730 +0100
++++ a/a/a/nss/lib/nss/config.mk 2012-10-30 12:31:08.860676053 +0100
+@@ -40,7 +40,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+--- a/a/a/nss/lib/smime/config.mk.dt 2012-10-30 12:30:52.020062600 +0100
++++ a/a/a/nss/lib/smime/config.mk 2012-10-30 12:30:54.504004586 +0100
+@@ -41,7 +41,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ RES = $(OBJDIR)/smime.res.o
+ RESNAME = smime.rc
+--- a/a/a/nss/lib/softoken/config.mk.dt 2012-10-30 12:31:02.707816790 +0100
++++ a/a/a/nss/lib/softoken/config.mk 2012-10-30 12:31:04.388778631 +0100
+@@ -47,7 +47,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+--- a/a/a/nss/lib/softoken/legacydb/config.mk.dt 2012-10-30 12:30:56.531958414 +0100
++++ a/a/a/nss/lib/softoken/legacydb/config.mk 2012-10-30 12:31:00.575865594 +0100
+@@ -48,7 +48,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
+--- a/a/a/nss/lib/sqlite/config.mk.dt 2012-10-30 12:31:10.499638736 +0100
++++ a/a/a/nss/lib/sqlite/config.mk 2012-10-30 12:31:12.624590177 +0100
+@@ -41,7 +41,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ #RES = $(OBJDIR)/$(LIBRARY_NAME).res
+ #RESNAME = $(LIBRARY_NAME).rc
+--- a/a/a/nss/lib/ssl/config.mk.dt 2012-10-30 12:31:14.882539495 +0100
++++ a/a/a/nss/lib/ssl/config.mk 2012-10-30 12:31:16.379504032 +0100
+@@ -53,7 +53,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ RES = $(OBJDIR)/ssl.res.o
+ RESNAME = ssl.rc
+--- a/a/a/nss/lib/sysinit/config.mk.dt 2012-10-30 12:31:18.195462428 +0100
++++ a/a/a/nss/lib/sysinit/config.mk 2012-10-30 12:31:20.277414942 +0100
+@@ -45,7 +45,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ #RES = $(OBJDIR)/$(LIBRARY_NAME).res
+ #RESNAME = $(LIBRARY_NAME).rc
+--- a/a/a/nss/lib/util/config.mk.dt 2012-10-30 12:31:22.179371231 +0100
++++ a/a/a/nss/lib/util/config.mk 2012-10-30 12:31:24.074328169 +0100
+@@ -40,7 +40,7 @@ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+
+ # don't want the 32 in the shared library name
+ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(IMPORT_LIB_SUFFIX)
++IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(IMPORT_LIB_SUFFIX)
+
+ RES = $(OBJDIR)/$(LIBRARY_NAME).res.o
+ RESNAME = $(LIBRARY_NAME).rc
--- /dev/null
+--- a/a/nspr/configure 2010-02-08 19:41:35.000000000 +0100
++++ b/b/nspr/configure 2010-06-11 16:35:54.960188991 +0200
+@@ -3900,7 +3900,7 @@
+ PR_MD_CSRCS=linux.c
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
++ DSO_LDOPTS='-shared -Wl,-z,origin -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
+ _OPTIMIZE_FLAGS=-O2
+ _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
+ # combo is not yet good at debugging inlined
+--- a/a/nss/coreconf/FreeBSD.mk 2009-11-23 05:06:29.000000000 -0500
++++ b/b/nss/coreconf/FreeBSD.mk 2012-08-28 20:27:20.000000000 -0400
+@@ -57,6 +57,7 @@
+
+ DSO_CFLAGS = -fPIC
+ DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
++DSO_LDOPTS += -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
+
+ #
+ # The default implementation strategy for FreeBSD is pthreads.
+--- a/a/nss/coreconf/Linux.mk 2010-01-15 23:19:00.000000000 +0100
++++ b/b/nss/coreconf/Linux.mk 2010-06-11 16:35:54.981151732 +0200
+@@ -46,8 +46,11 @@
+ IMPL_STRATEGY = _PTH
+ endif
+
+-CC = gcc
+-CCC = g++
++# CC is taken from environment automatically.
++#CC = gcc
++# Use CCC from environment.
++#CCC = g++
++CCC = $(CXX)
+ RANLIB = ranlib
+
+ DEFAULT_COMPILER = gcc
+@@ -147,7 +150,7 @@
+ # incorrectly reports undefined references in the libraries we link with, so
+ # we don't use -z defs there.
+ ZDEFS_FLAG = -Wl,-z,defs
+-DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
++DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
+ LDFLAGS += $(ARCHFLAG)
+
+ # On Maemo, we need to use the -rpath-link flag for even the standard system
+@@ -158,8 +161,13 @@
+ endif
+ endif
+
++ifneq ($(SYSTEM_ZLIB),)
++# Currently (3.12.4) only the tools modutil and signtool are linked with libz
++# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
++# is also build in nss.
+ USE_SYSTEM_ZLIB = 1
+ ZLIB_LIBS = -lz
++endif
+
+ # The -rpath '$$ORIGIN' linker option instructs this library to search for its
+ # dependencies in the same directory where it resides.
+--- a/a/nss/coreconf/SunOS5.mk 2009-06-11 02:55:32.000000000 +0200
++++ b/b/nss/coreconf/SunOS5.mk 2010-06-11 16:35:54.985571182 +0200
+@@ -89,8 +89,12 @@
+ # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
+ endif
+ else
+- CC = cc
+- CCC = CC
++# CC is taken from environment automatically.
++# CC = cc
++# Use CXX from environment.
++# CCC = CC
++ CCC = $(CXX)
++
+ ASFLAGS += -Wa,-P
+ OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
+ ifndef BUILD_OPT
+--- a/a/nss/coreconf/arch.mk 2009-06-05 04:14:49.000000000 +0200
++++ b/b/nss/coreconf/arch.mk 2010-06-11 16:35:54.990913282 +0200
+@@ -324,10 +324,15 @@
+ # IMPL_STRATEGY may be defined too.
+ #
+
+-OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
++# OBJDIR_NAME is used to build the directory containing the built objects, for
++# example mozilla/dist/Linux2.6_x86_glibc_PTH_DBG.OBJ
++# We need to deliver the contents of that folder into the solver. To make that easier
++# in the makefile we rename this directory to "out".
++#OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
++OBJDIR_NAME = out
+
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+-ifndef BUILD_OPT
++ifdef THIS_HAS_BEEN_DISABLED_TO_GET_out
+ #
+ # Define USE_DEBUG_RTL if you want to use the debug runtime library
+ # (RTL) in the debug build
+--- a/a/nss/coreconf/rules.mk
++++ b/b/nss/coreconf/rules.mk
+@@ -293,7 +293,7 @@
+ ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
+ $(AR) $(subst /,\\,$(OBJS))
+ else
+- $(AR) $(OBJS)
++ $(AR) cr $@ $(OBJS)
+ endif
+ $(RANLIB) $@
+
+--- a/a/nss/Makefile
++++ b/b/nss/Makefile
+@@ -1,3 +1,5 @@
++export AR
++export RANLIB
+ #! gmake
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+--- a/a/nss/cmd/platlibs.mk 2010-02-04 19:59:10.000000000 +0100
++++ b/b/nss/cmd/platlibs.mk 2010-06-11 16:35:55.004869805 +0200
+@@ -41,17 +41,22 @@
+
+ ifeq ($(OS_ARCH), SunOS)
+ ifeq ($(USE_64), 1)
+-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
++#In OOo we would probable put the executables next to libs
++EXTRA_SHARED_LIBS += -R '$$ORIGIN'
+ else
+-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
++EXTRA_SHARED_LIBS += -R '$$ORIGIN'
+ endif
+ endif
+
++ifeq ($(OS_ARCH), FreeBSD)
++EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
++endif
++
+ ifeq ($(OS_ARCH), Linux)
+ ifeq ($(USE_64), 1)
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
++EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
+ else
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
++EXTRA_SHARED_LIBS += -Wl,-z,origin -Wl,-rpath,'$$ORIGIN'
+ endif
+ endif
+
--- /dev/null
+--- a/a/nspr/config/rules.mk 2008-12-03 00:24:39.000000000 +0100
++++ b/b/nspr/config/rules.mk 2009-11-27 13:36:22.662753328 +0100
+@@ -415,7 +415,7 @@
+
+ ifdef NEED_ABSOLUTE_PATH
+ # The quotes allow absolute paths to contain spaces.
+-pr_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))"
++pr_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(shell cygpath -m $(1))),$(1),$(shell cygpath -m $(CURDIR)/$(1))))"
+ endif
+
+ $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
+--- a/a/nss/coreconf/rules.mk 2008-12-03 00:24:39.000000000 +0100
++++ b/b/nss/coreconf/rules.mk 2009-11-27 13:36:22.662753328 +0100
+@@ -411,7 +411,7 @@
+ endif
+
+ # The quotes allow absolute paths to contain spaces.
+-core_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))"
++core_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(shell cygpath -m $(1))),$(1),$(shell cygpath -m $(PWD)/$(1))))"
+
+ $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
+ @$(MAKE_OBJDIR)
--- /dev/null
+--- a/a/nss/Makefile 2008-12-03 00:24:39.000000000 +0100
++++ b/b/nss/Makefile 2009-11-27 13:36:22.662753328 +0100
+@@ -104,6 +104,9 @@
+ ifeq ($(OS_TARGET),WIN95)
+ NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
+ endif
++ifdef MACOS_SDK_DIR
++NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
++endif
+ ifdef USE_DEBUG_RTL
+ NSPR_CONFIGURE_OPTS += --enable-debug-rtl
+ endif
+--- a/a/nspr/configure
++++ b/b/nspr/configure
+@@ -3888,7 +3889,7 @@
+ fi
+
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
++ DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @__________________________________________________OOO/$@ -headerpad_max_install_names'
+ _OPTIMIZE_FLAGS=-O2
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+ STRIP="$STRIP -x -S"
+--- a/a/nss/coreconf/Darwin.mk
++++ b/b/nss/coreconf/Darwin.mk
+@@ -39,8 +39,12 @@
+
+ DEFAULT_COMPILER = gcc
+
+-CC = gcc
+-CCC = g++
++# CC is taken from environment automatically.
++#CC = cc
++# Use CCC from environment.
++#CCC = c++
++CCC = $(CXX)
++
+ RANLIB = ranlib
+
+ ifndef CPU_ARCH
+@@ -57,19 +57,25 @@
+
+ ifeq (,$(filter-out i%86,$(CPU_ARCH)))
+ ifdef USE_64
++ifeq (,$(findstring -arch ,$(CC)))
+ CC += -arch x86_64
++endif
+ override CPU_ARCH = x86_64
+ else
+ OS_REL_CFLAGS = -Di386
++ifeq (,$(findstring -arch ,$(CC)))
+ CC += -arch i386
++endif
+ override CPU_ARCH = x86
+ endif
+ else
+ ifeq (arm,$(CPU_ARCH))
+ # Nothing set for arm currently.
+ else
+ OS_REL_CFLAGS = -Dppc
++ifeq (,$(findstring -arch ,$(CC)))
+ CC += -arch ppc
++endif
+ endif
+ endif
+
+@@ -64,12 +64,16 @@
+ endif
+
+ ifneq (,$(MACOS_SDK_DIR))
++ CLANG_VERSION_FULL := $(shell $(CC) -v 2>&1 | grep "clang version" | sed -e "s/^.*clang version[ ]*//" | awk '{ print $$1 }')
+ GCC_VERSION_FULL := $(shell $(CC) -dumpversion)
+ GCC_VERSION_MAJOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$1 }')
+ GCC_VERSION_MINOR := $(shell echo $(GCC_VERSION_FULL) | awk -F. '{ print $$2 }')
+ GCC_VERSION = $(GCC_VERSION_MAJOR).$(GCC_VERSION_MINOR)
++ ifneq (,$(CLANG_VERSION_FULL))
++ DARWIN_SDK_CFLAGS = -isysroot $(MACOS_SDK_DIR)
++ DARWIN_SDK_SHLIBFLAGS = -isysroot $(MACOS_SDK_DIR)
+
+- ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
++ else ifeq (,$(filter-out 2 3,$(GCC_VERSION_MAJOR)))
+ # GCC <= 3
+ DARWIN_SDK_FRAMEWORKS = -F$(MACOS_SDK_DIR)/System/Library/Frameworks
+ ifneq (,$(shell find $(MACOS_SDK_DIR)/Library/Frameworks -maxdepth 0))
+@@ -150,7 +150,7 @@
+ # May override this with different compatibility and current version numbers.
+ DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1
+ # May override this with -bundle to create a loadable module.
+-DSO_LDOPTS = -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @executable_path/$(notdir $@) -headerpad_max_install_names
++DSO_LDOPTS = -dynamiclib $(DARWIN_DYLIB_VERSIONS) -install_name @__________________________________________________OOO/$(notdir $@) -headerpad_max_install_names
+
+ MKSHLIB = $(CC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
+ DLL_SUFFIX = dylib
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,opencollada))
+
+$(eval $(call gb_Module_add_targets,opencollada,\
+ StaticLibrary_opencollada_parser \
+ UnpackedTarball_opencollada \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+OpenCOLLADA is a COLLADA SDK that includes plug-ins for Autodesk Maya and 3ds Max.
+LibreOffice mainly use it for parse collada files (*.dae).
+
+From:
+[https://github.com/khronosGroup/OpenCOLLADA/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,opencollada_parser))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,opencollada_parser,opencollada))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,opencollada_parser))
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,opencollada_parser,cpp))
+
+$(eval $(call gb_StaticLibrary_use_externals,opencollada_parser,\
+ libxml2 \
+))
+
+# Avoid warnings
+$(eval $(call gb_StaticLibrary_add_cxxflags,opencollada_parser,-w))
+$(eval $(call gb_StaticLibrary_add_cflags,opencollada_parser,-w))
+
+# Use libxml2 for xml parsing (other option is expat)
+$(eval $(call gb_StaticLibrary_add_defs,opencollada_parser,\
+ -DGENERATEDSAXPARSER_XMLPARSER_LIBXML \
+ -DGENERATEDSAXPARSER_VALIDATION \
+ -DPCRE_STATIC \
+))
+
+# OpenCollada parser part
+$(eval $(call gb_StaticLibrary_set_include,opencollada_parser,\
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADABaseUtils/include \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADABaseUtils/include/Math \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADAFramework/include \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADASaxFrameworkLoader/include \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADASaxFrameworkLoader/include/generated14 \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADASaxFrameworkLoader/include/generated15 \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/MathMLSolver/include \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/MathMLSolver/include/AST \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/UTF/include \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/GeneratedSaxParser/include \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,opencollada_parser,\
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUHashFunctions \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUIDList \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUNativeString \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUPcreCompiledPattern \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUPrecompiledHeaders \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUStringUtils \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUURI \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/COLLADABUUtils \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/Math/COLLADABUMathMatrix3 \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/Math/COLLADABUMathMatrix4 \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/Math/COLLADABUMathQuaternion \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/Math/COLLADABUMathUtils \
+ UnpackedTarball/opencollada/COLLADABaseUtils/src/Math/COLLADABUMathVector3 \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWAxisInfo \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWCamera \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWColor \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWConstants \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWEffect \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWEffectCommon \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWFileInfo \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWFloatOrDoubleArray \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWFormula \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWFormulas \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWGeometry \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWImage \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWInstanceKinematicsScene \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWKinematicsController \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWKinematicsModel \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWKinematicsScene \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWLight \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWLoaderUtils \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWMaterial \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWMatrix \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWMesh \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWMeshPrimitive \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWMorphController \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWNode \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWPrecompiledHeaders \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWRenderState \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWRoot \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWRotate \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWSampler \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWScale \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWSkinController \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWSkinControllerData \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWSpline \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWTexture \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWTransformation \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWTranslate \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWUniqueId \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWValidate \
+ UnpackedTarball/opencollada/COLLADAFramework/src/COLLADAFWVisualScene \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLAssetLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLCOLLADACsymbol \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLDocumentProcessor \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLExtraDataElementHandler \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLExtraDataLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFileLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFilePartLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFormulasLinker \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFormulasLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLGeometryLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLGeometryMaterialIdInfo \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLIError \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLIErrorHandler \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLIExtraDataCallbackHandler \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLIFilePartLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLInputUnshared \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLInstanceArticulatedSystemLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLInstanceKinematicsModelLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLIParserImpl14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLIParserImpl15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLJointsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLKinematicsIntermediateData \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLKinematicsSceneCreator \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryAnimationsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryArticulatedSystemsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryCamerasLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryControllersLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryFormulasLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryImagesLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryJointsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryKinematicsModelsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryKinematicsScenesLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryLightsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryMaterialsLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryNodesLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLMeshLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLMeshPrimitiveInputList \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLNodeLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLPostProcessor \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLPrecompiledHeaders \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLRootParser14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLRootParser15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSaxFWLError \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSaxParserError \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSaxParserErrorHandler \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSceneLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSidAddress \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSidTreeNode \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSourceArrayLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSplineLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLTransformationLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLTypes \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLVersionParser \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLVisualSceneLoader \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLAssetLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14Private \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateEnums \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateFindElementHash \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateFunctionMap \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateFunctionMapFactory \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateNameMap \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateValidation \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLGeometryLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryAnimationsLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryCamerasLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryControllersLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryEffectsLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryImagesLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryLightsLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryMaterialsLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLLibraryNodesLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLMeshLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLNodeLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLSceneLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLSourceArrayLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLSplineLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLVisualSceneLoader14 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLAssetLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15Private \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateEnums \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateFindElementHash \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateFunctionMap \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateFunctionMapFactory \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateNameMap \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateValidation \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLFormulasLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLGeometryLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryAnimationsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryArticulatedSystemsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryCamerasLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryControllersLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryEffectsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryFormulasLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryImagesLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryJointsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryKinematicsModelsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryKinematicsScenesLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryLightsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryMaterialsLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLLibraryNodesLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLMeshLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLNodeLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLSceneLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLSourceArrayLoader15 \
+ UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLVisualSceneLoader15 \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserCoutErrorHandler \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserLibxmlSaxParser \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserNamespaceStack \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserParser \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserParserError \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserParserTemplate \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserParserTemplateBase \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserRawUnknownElementHandler \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserSaxParser \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserStackMemoryManager \
+ UnpackedTarball/opencollada/GeneratedSaxParser/src/GeneratedSaxParserUtils \
+))
+
+# PCRE external library compiled via OpenCollada
+$(eval $(call gb_StaticLibrary_set_include,opencollada_parser,\
+ $$(INCLUDE) \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/pcre/include \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,opencollada_parser,\
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_chartables \
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_compile \
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_exec \
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_globals \
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_newline \
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_tables \
+ UnpackedTarball/opencollada/Externals/pcre/src/pcre_try_flipped \
+))
+
+# UTF external library compiled via OpenCollada
+$(eval $(call gb_StaticLibrary_set_include,opencollada_parser,\
+ $$(INCLUDE) \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/UTF/include \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,opencollada_parser,\
+ UnpackedTarball/opencollada/Externals/UTF/src/ConvertUTF \
+))
+
+# MathMLSolver external library compiled via OpenCollada
+$(eval $(call gb_StaticLibrary_set_include,opencollada_parser,\
+ $$(INCLUDE) \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/MathMLSolver/include \
+ -I$(call gb_UnpackedTarball_get_dir,opencollada)/Externals/MathMLSolver/include/AST \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,opencollada_parser,\
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTArithmeticExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTBinaryComparisionExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTConstantExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTFragmentExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTFunctionExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTLogicExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTStringVisitor \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTUnaryArithmeticExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/AST/MathMLASTVariableExpression \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLEvaluatorVisitor \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLSerializationUtil \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLSerializationVisitor \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLSolverFunctionExtensions \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLSolverPrecompiled \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLString \
+ UnpackedTarball/opencollada/Externals/MathMLSolver/src/MathMLSymbolTable \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,opencollada))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,opencollada,$(OPENCOLLADA_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,opencollada,\
+ external/opencollada/patches/0001-Revert-fix-for-malformed-FBX-COLLADA-id.patch.1 \
+ external/opencollada/patches/0002-Expose-sid-for-textures-in-extras.patch.1 \
+ external/opencollada/patches/opencollada.clang.patch.0 \
+ external/opencollada/patches/opencollada.libxml.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From a54360e9d2a67350f27eec8dfbe1103778b2711c Mon Sep 17 00:00:00 2001
+From: Fabrice Robinet <fabricerobinet@me.com>
+Date: Tue, 13 May 2014 16:31:40 -0700
+Subject: [PATCH 1/2] Revert fix for malformed FBX-COLLADA id
+
+---
+ GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
+index 404306a..1f9a3ee 100644
+--- a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
++++ b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
+@@ -868,11 +868,13 @@ namespace GeneratedSaxParser
+ failed = false;
+ return COLLADABU::URI(0);
+ }
++ const ParserString& string = toStringListItem(buffer, bufferEnd, failed);
++ return COLLADABU::URI(string.str, string.length);
++
++ //FIXME: Testing fails on windows but pass on OSX with this fix.
+ //Just get the string as it is for ids, so that we are able to read FBX-COLLADA
+ //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces
+- //const ParserString& string = toStringListItem(buffer, bufferEnd, failed);
+- //return COLLADABU::URI(string.str, string.length);
+- return COLLADABU::URI((const char*)*buffer, bufferEnd - *buffer);
++ //return COLLADABU::URI((const char*)*buffer, bufferEnd - *buffer);
+ }
+
+ //--------------------------------------------------------------------
+@@ -883,11 +885,14 @@ namespace GeneratedSaxParser
+ failed = false;
+ return COLLADABU::URI(0);
+ }
++
++ const ParserString& string = toStringListItem(buffer, failed);
++ return COLLADABU::URI(string.str, string.length);
++
++ //FIXME: Testing fails on windows but pass on OSX with this fix.
+ //Just get the string as it is for ids, so that we are able to read FBX-COLLADA
+ //Otherwise, calling toStringItem would result in a truncated string when an id contains spaces
+- //const ParserString& string = toStringListItem(buffer, failed);
+- //return COLLADABU::URI(string.str, string.length);
+- return COLLADABU::URI((const char*)*buffer);
++ //return COLLADABU::URI((const char*)*buffer);
+ }
+
+
+--
+1.8.1.4
+
--- /dev/null
+From 3f68b25b9085c577c2cc2db81d9a9f743de077b7 Mon Sep 17 00:00:00 2001
+From: Fabrice Robinet <fabricerobinet@me.com>
+Date: Thu, 22 May 2014 15:15:40 -0700
+Subject: [PATCH 2/2] Expose sid for textures in extras.
+
+---
+ COLLADAFramework/include/COLLADAFWSampler.h | 8 +++++++-
+ .../src/COLLADASaxFWLLibraryEffectsLoader.cpp | 4 +++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/COLLADAFramework/include/COLLADAFWSampler.h b/COLLADAFramework/include/COLLADAFWSampler.h
+index 44936a8..562e47a 100644
+--- a/COLLADAFramework/include/COLLADAFWSampler.h
++++ b/COLLADAFramework/include/COLLADAFWSampler.h
+@@ -129,6 +129,9 @@ namespace COLLADAFW
+ that is used by the sampler to evaluate the MIPmap chain. */
+ float mMipmapBias;
+
++ /* sampler Sid, required to be able to retrieve a sampler from extras */
++ std::string mSid;
++
+ public:
+
+ /** Constructor. */
+@@ -203,8 +206,11 @@ namespace COLLADAFW
+ /** Returns the mipmap Bias.*/
+ void setMipmapBias ( float mipmapBias ) { mMipmapBias = mipmapBias; }
+
+- Sampler* clone() { return FW_NEW Sampler(*this); }
++ void setSid( const std::string &sid) { mSid = sid; }
++
++ const std::string& getSid() { return mSid; }
+
++ Sampler* clone() { return FW_NEW Sampler(*this); }
+ };
+
+ /**
+diff --git a/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp b/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp
+index 36f9c58..5ac99a4 100644
+--- a/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp
++++ b/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryEffectsLoader.cpp
+@@ -1003,18 +1003,20 @@ namespace COLLADASaxFWL
+
+ bool validSampler = false;
+ SidSamplerInfoMap::iterator samplerIt = mEffectProfileSidSamplerInfoMap.find ( samplerSid );
++
+ if ( samplerIt == mEffectProfileSidSamplerInfoMap.end () )
+ {
+ samplerIt = mEffectSidSamplerInfoMap.find ( samplerSid );
+ if ( samplerIt != mEffectSidSamplerInfoMap.end () ) validSampler = true;
+ }
+ else validSampler = true;
+-
++
+ if ( validSampler )
+ {
+ SamplerInfo& samplerInfo = samplerIt->second;
+ samplerInfo.id = samplerArray.getCount();
+ COLLADAFW::Sampler* sampler = samplerInfo.sampler;
++ sampler->setSid(samplerSid);
+ if ( !sampler->getSourceImage().isValid() )
+ {
+ bool validSurface = false;
+--
+1.8.1.4
+
--- /dev/null
+-*- Mode: Diff -*-
+diff -ur opencollada.org/COLLADABaseUtils/include/COLLADABUhash_map.h opencollada/COLLADABaseUtils/include/COLLADABUhash_map.h
+--- COLLADABaseUtils/include/COLLADABUhash_map.h 2014-05-09 11:12:05.740858077 +0200
++++ COLLADABaseUtils/include/COLLADABUhash_map.h 2014-05-09 11:17:38.616861995 +0200
+@@ -60,7 +60,7 @@
+ #define COLLADABU_HASH_NAMESPACE_CLOSE }
+ #define COLLADABU_HASH_FUN hash
+ #endif
+-#elif defined(__FreeBSD__) && defined(_LIBCPP_VERSION)
++#elif (defined(__APPLE__) || defined(__FreeBSD__)) && defined(_LIBCPP_VERSION)
+ #include <unordered_map>
+ #include <unordered_set>
+ #define COLLADABU_HASH_MAP std::unordered_map
+@@ -70,7 +70,7 @@
+ #define COLLADABU_HASH_NAMESPACE_CLOSE
+ #define COLLADABU_HASH_FUN hash
+ #else // Linux or Mac or FreeBSD with GCC
+- #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
++ #if !defined(__clang__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3))
+ #include <ext/hash_map>
+ #include <ext/hash_set>
+ #if !(defined(__APPLE__) && defined(__MACH__))
--- /dev/null
+diff -ur opencollada.org/GeneratedSaxParser/include/GeneratedSaxParserPrerequisites.h opencollada/GeneratedSaxParser/include/GeneratedSaxParserPrerequisites.h
+--- GeneratedSaxParser/include/GeneratedSaxParserPrerequisites.h 2014-05-13 10:37:05.029390239 +0200
++++ GeneratedSaxParser/include/GeneratedSaxParserPrerequisites.h 2014-05-13 10:37:37.093390617 +0200
+@@ -11,8 +11,6 @@
+ #ifndef __GENERATEDSAXPARSER_PREREQUISITES_H__
+ #define __GENERATEDSAXPARSER_PREREQUISITES_H__
+
+-#define LIBXML_STATIC
+-
+ #include <string>
+
+ #include "COLLADABUPlatform.h"
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,openldap))
+
+$(eval $(call gb_ExternalProject_use_externals,openldap,nss3))
+
+$(eval $(call gb_ExternalProject_register_targets,openldap,\
+ build \
+))
+
+openldap_LDFLAGS =
+ifeq ($(SYSTEM_NSS),)
+openldap_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib \
+ $(if $(filter AIX,$(OS)),-Wl$(COMMA)-brtl)
+endif
+# Help openldap's configure determine that it needs -lpthread even if libasan.so
+# contains a pthread_create override:
+ifneq ($(filter -fsanitize=address,$(CC)),)
+openldap_LDFLAGS += -pthread
+endif
+
+$(call gb_ExternalProject_get_state_target,openldap,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ --disable-slapd \
+ --with-pic \
+ --with-tls=moznss \
+ --without-cyrus-sasl \
+ --disable-shared \
+ --enable-static \
+ $(if $(CROSS_COMPILING), \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ --with-yielding_select=yes \
+ ac_cv_func_memcmp_working=yes \
+ ) \
+ $(if $(SYSTEM_NSS), \
+ CPPFLAGS="$(NSS_CFLAGS)" CFLAGS="$(NSS_CFLAGS)" LDFLAGS="$(NSS_LIBS)" \
+ , \
+ CPPFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \
+ CFLAGS="-I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \
+ ) \
+ $(if $(openldap_LDFLAGS),LDFLAGS="$(openldap_LDFLAGS)") \
+ && MAKEFLAGS= && $(MAKE) \
+ )
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,openldap))
+
+ifeq ($(SYSTEM_OPENLDAP),)
+
+$(eval $(call gb_Module_add_targets,openldap,\
+ ExternalProject_openldap \
+ UnpackedTarball_openldap \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,openldap))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,openldap,$(OPENLDAP_TARBALL),,openldap))
+
+$(eval $(call gb_UnpackedTarball_add_patches,openldap,\
+ external/openldap/openldap-2.4.31.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/openldap-2.4.31/Makefile.in 2012-04-22 22:25:08.000000000 +0200
++++ misc/build/openldap-2.4.31/Makefile.in 2012-07-16 13:53:47.140541654 +0200
+@@ -13,7 +13,7 @@
+ ## top-level directory of the distribution or, alternatively, at
+ ## <http://www.OpenLDAP.org/license.html>.
+
+-SUBDIRS= include libraries clients servers tests doc
++SUBDIRS= include libraries
+ CLEANDIRS=
+ INSTALLDIRS=
+
+@@ -32,7 +32,3 @@
+ $(RM) config.status libtool stamp-h stamp-h.in
+
+ distclean: veryclean FORCE
+-
+-check: test
+-test: FORCE
+- cd tests; make test
+--- misc/openldap-2.4.31/libraries/libldap/tls_m.c 2012-04-22 22:25:08.000000000 +0200
++++ misc/build/openldap-2.4.31/libraries/libldap/tls_m.c 2012-07-16 13:53:47.140541654 +0200
+@@ -49,17 +49,17 @@
+ #include <termios.h> /* for echo on/off */
+ #endif
+
+-#include <nspr/nspr.h>
+-#include <nspr/private/pprio.h>
+-#include <nss/nss.h>
+-#include <nss/ssl.h>
+-#include <nss/sslerr.h>
+-#include <nss/sslproto.h>
+-#include <nss/pk11pub.h>
+-#include <nss/secerr.h>
+-#include <nss/keyhi.h>
+-#include <nss/secmod.h>
+-#include <nss/cert.h>
++#include <nspr.h>
++#include <private/pprio.h>
++#include <nss.h>
++#include <ssl.h>
++#include <sslerr.h>
++#include <sslproto.h>
++#include <pk11pub.h>
++#include <secerr.h>
++#include <keyhi.h>
++#include <secmod.h>
++#include <cert.h>
+
+ #undef NSS_VERSION_INT
+ #define NSS_VERSION_INT ((NSS_VMAJOR << 24) | (NSS_VMINOR << 16) | \
+--- misc/openldap-2.4.31/configure.in 2012-04-22 21:25:08.000000000 +0100
++++ misc/build/openldap-2.4.31/configure.in 2012-07-16 13:56:24.000000000 +0100
+@@ -1232,7 +1232,8 @@
+ AC_CHECK_HEADERS([nssutil.h])
+ if test "$ac_cv_header_nssutil_h" = yes ; then
+ AC_CHECK_LIB([nss3], [NSS_Initialize],
+- [ have_moznss=yes ], [ have_moznss=no ])
++ [ have_moznss=yes ], [ have_moznss=no ],
++ [ -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 ])
+ fi
+
+ if test "$have_moznss" = yes ; then
+--- misc/openldap-2.4.31/configure 2012-07-16 14:11:55.000000000 +0100
++++ misc/build/openldap-2.4.31/configure 2012-07-16 13:56:24.000000000 +0100
+@@ -15718,7 +15718,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lnss3 $LIBS"
++LIBS="-lnss3 -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,openssl,openssl))
+
+$(eval $(call gb_ExternalPackage_use_external_project,openssl,openssl))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER),\
+ out32dll/ssleay32.dll \
+ out32dll/libeay32.dll \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,openssl))
+
+$(eval $(call gb_ExternalProject_register_targets,openssl,\
+ build \
+))
+
+# For multi-line conditionals, align the $(if and the corresponding ),
+# putting the latter on a line of its own. Also put the "else" comma
+# on a line of its own. Hopefully should make the logic more clear.
+
+OPENSSL_PLATFORM := \
+ $(if $(filter LINUX FREEBSD ANDROID,$(OS)),\
+ $(if $(filter INTEL,$(CPUNAME)),\
+ $(if $(filter GNU/kFreeBSD,$(shell uname)),debian-kfreebsd-i386,linux-elf)\
+ ,\
+ $(if $(filter X86_64,$(CPUNAME)),\
+ $(if $(filter GNU/kFreeBSD,$(shell uname)),\
+ debian-kfreebsd-amd64\
+ ,\
+ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic64, linux-generic64) no-asm\
+ )\
+ ,\
+ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic32, linux-generic32)\
+ )\
+ )\
+ ,\
+ $(if $(filter SOLARIS,$(OS)),\
+ $(if $(filter INTEL,$(CPUNAME)),solaris-x86-cc,\
+ $(if $(filter X86_64,$(CPUNAME)),solaris64-x86_64-cc,solaris-sparcv9-cc)\
+ )\
+ ,\
+ $(if $(filter IOS,$(OS)),\
+ ios-armv7\
+ ,\
+ $(if $(filter WNT,$(OS)),\
+ $(if $(filter GCC,$(COM)),\
+ mingw\
+ ,\
+ $(if $(filter INTEL,$(CPUNAME)),VC-WIN32,VC-WIN64A)\
+ )\
+ ,\
+ $(if $(filter MACOSX,$(OS)),\
+ $(if $(filter POWERPC,$(CPUNAME)),darwin-ppc-cc)\
+ $(if $(filter INTEL,$(CPUNAME)),darwin-i386-cc)\
+ $(if $(filter X86_64,$(CPUNAME)),darwin64-x86_64-cc)\
+ )\
+ )\
+ )\
+ )\
+ )
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,openssl,build):
+ $(call gb_ExternalProject_run,build,\
+ export CC="$(shell cygpath -w $(filter-out -%,$(CC))) $(filter -%,$(CC))" \
+ && export PERL="$(shell cygpath -w $(PERL))" \
+ && export LIB="$(ILIB)" \
+ && $(PERL) Configure $(OPENSSL_PLATFORM) no-idea \
+ && cmd /c "ms\do_ms.bat $(PERL) $(OPENSSL_PLATFORM)" \
+ && unset MAKEFLAGS \
+ && nmake -f "ms\ntdll.mak" \
+ )
+
+else
+$(call gb_ExternalProject_get_state_target,openssl,build):
+ $(call gb_ExternalProject_run,build,\
+ unset MAKEFLAGS && \
+ $(if $(filter LINUX MACOSX FREEBSD ANDROID SOLARIS IOS,$(OS)), \
+ ./Configure, \
+ $(if $(filter WNT,$(OS)), \
+ $(PERL) Configure, \
+ ./config)) \
+ $(OPENSSL_PLATFORM) no-dso no-shared \
+ $(if $(filter-out WNT,$(OS)),no-idea) \
+ $(if $(filter-out ANDROID IOS WNT,$(OS)), \
+ $(if $(SYSBASE),-I$(SYSBASE)/usr/include -L$(SYSBASE)/usr/lib)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ && $(MAKE) build_libs \
+ CC="$(CC) -fPIC $(if $(filter-out WNT MACOSX,$(OS)),\
+ $(if $(filter TRUE,$(HAVE_GCC_VISIBILITY_FEATURE)),\
+ -fvisibility=hidden))" \
+ )
+endif
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,openssl))
+
+ifeq ($(SYSTEM_OPENSSL),)
+$(eval $(call gb_Module_add_targets,openssl,\
+ UnpackedTarball_openssl \
+ ExternalPackage_openssl \
+ ExternalProject_openssl \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Open Source toolkit implementing SSL and TLS.
+
+From [http://www.openssl.org/].
+
+SSL = Secure Sockets Layer (SSL v2/v3) protocol.
+TLS = Transport Layer Security (TLS v1) protocol.
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,openssl))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl))
+
+# hack to fix symlinks with MSVC
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,openssl,\
+ include/openssl/aes.h \
+ include/openssl/asn1.h \
+ include/openssl/asn1_mac.h \
+ include/openssl/asn1t.h \
+ include/openssl/bio.h \
+ include/openssl/blowfish.h \
+ include/openssl/bn.h \
+ include/openssl/buffer.h \
+ include/openssl/camellia.h \
+ include/openssl/cast.h \
+ include/openssl/cmac.h \
+ include/openssl/cms.h \
+ include/openssl/comp.h \
+ include/openssl/conf.h \
+ include/openssl/conf_api.h \
+ include/openssl/crypto.h \
+ include/openssl/des.h \
+ include/openssl/des_old.h \
+ include/openssl/dh.h \
+ include/openssl/dsa.h \
+ include/openssl/dso.h \
+ include/openssl/dtls1.h \
+ include/openssl/e_os2.h \
+ include/openssl/ebcdic.h \
+ include/openssl/ec.h \
+ include/openssl/ecdh.h \
+ include/openssl/ecdsa.h \
+ include/openssl/engine.h \
+ include/openssl/err.h \
+ include/openssl/evp.h \
+ include/openssl/hmac.h \
+ include/openssl/idea.h \
+ include/openssl/krb5_asn.h \
+ include/openssl/kssl.h \
+ include/openssl/lhash.h \
+ include/openssl/md4.h \
+ include/openssl/md5.h \
+ include/openssl/mdc2.h \
+ include/openssl/modes.h \
+ include/openssl/obj_mac.h \
+ include/openssl/objects.h \
+ include/openssl/ocsp.h \
+ include/openssl/opensslconf.h \
+ include/openssl/opensslv.h \
+ include/openssl/ossl_typ.h \
+ include/openssl/pem.h \
+ include/openssl/pem2.h \
+ include/openssl/pkcs12.h \
+ include/openssl/pkcs7.h \
+ include/openssl/pqueue.h \
+ include/openssl/rand.h \
+ include/openssl/rc2.h \
+ include/openssl/rc4.h \
+ include/openssl/ripemd.h \
+ include/openssl/rsa.h \
+ include/openssl/safestack.h \
+ include/openssl/seed.h \
+ include/openssl/sha.h \
+ include/openssl/srp.h \
+ include/openssl/srtp.h \
+ include/openssl/ssl.h \
+ include/openssl/ssl2.h \
+ include/openssl/ssl23.h \
+ include/openssl/ssl3.h \
+ include/openssl/stack.h \
+ include/openssl/symhacks.h \
+ include/openssl/tls1.h \
+ include/openssl/ts.h \
+ include/openssl/txt_db.h \
+ include/openssl/ui.h \
+ include/openssl/ui_compat.h \
+ include/openssl/whrlpool.h \
+ include/openssl/x509.h \
+ include/openssl/x509_vfy.h \
+ include/openssl/x509v3.h \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,openssl,\
+ $(if $(filter LINUX FREEBSD ANDROID,$(OS)),external/openssl/openssllnx.patch) \
+ $(if $(filter WNTGCC,$(OS)$(COM)),external/openssl/opensslmingw.patch) \
+ $(if $(filter MSC,$(COM)),external/openssl/opensslwnt.patch) \
+ $(if $(filter MSC,$(COM)),external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1) \
+ $(if $(filter SOLARIS,$(OS)),external/openssl/opensslsol.patch) \
+ $(if $(filter IOS,$(OS)),external/openssl/opensslios.patch) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- openssl.org/util/pl/VC-32.pl 2014-05-18 23:41:39.336594400 +0200
++++ openssl/util/pl/VC-32.pl 2014-05-18 23:47:40.055279300 +0200
+@@ -49,7 +49,7 @@
+ $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
+ $opt_cflags=$f.' /Ox';
+ $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
+- $lflags="/nologo /subsystem:console /opt:ref";
++ $lflags="/nologo /subsystem:console,5.02 /opt:ref";
+
+ *::perlasm_compile_target = sub {
+ my ($target,$source,$bname)=@_;
+@@ -131,7 +131,7 @@
+ $ff = "/fixed";
+ $opt_cflags=$f.' -Ox -O2 -Ob2';
+ $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG';
+- $lflags="/nologo /subsystem:console /opt:ref";
++ $lflags="/nologo /subsystem:console,5.01 /opt:ref";
+ }
+ $mlflags='';
+
--- /dev/null
+--- misc/openssl-0.9.8v/Configure
++++ build/openssl-0.9.8v/Configure
+@@ -530,6 +530,9 @@
+ # iPhoneOS/iOS
+ "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+
++##### iOS in the LibreOffice case
++"ios-armv7","gcc:-O3 -fomit-frame-pointer -DL_ENDIAN:::IOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:::::",
++
+ ##### A/UX
+ "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
+
--- /dev/null
+--- build/openssl-0.9.8v/Configure-old 2010-04-17 13:51:42.000000000 +0200
++++ build/openssl-0.9.8v/Configure 2010-04-17 13:52:03.000000000 +0200
+@@ -388,6 +388,9 @@
+
+ "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
++"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++
+ "nextstep", "cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
+ "nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
+
+--- build/openssl-0.9.8v/Makefile.org 2010-01-27 17:06:36.000000000 +0100
++++ build/openssl-0.9.8v/Makefile.org 2010-09-20 09:24:00.000000000 +0100
+@@ -199,7 +199,7 @@
+
+ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
+ CC='$(CC)' CFLAG='$(CFLAG)' \
+- AS='$(CC)' ASFLAG='$(CFLAG) -c' \
++ AS='$(CC)' ASFLAG='$(CFLAG) -c -Wa,--noexecstack' \
+ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
+ CROSS_COMPILE='$(CROSS_COMPILE)' \
+ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
--- /dev/null
+--- misc/openssl-0.9.8v/Makefile.shared 2008-09-17 17:56:40.000000000 +0200
++++ misc/build/openssl-0.9.8v/Makefile.shared 2009-03-30 11:52:53.684538000 +0200
+@@ -254,13 +254,17 @@
+ base=-Wl,--enable-auto-image-base; \
+ if expr $(PLATFORM) : 'mingw' > /dev/null; then \
+ SHLIB=$(LIBNAME)eay32; \
+- base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
++ base=; \
++ if test $(LIBNAME) = "crypto"; then \
++ SHLIB=libeay32; \
++ base=-Wl,--image-base,0x63000000; \
++ fi; \
+ fi; \
+ SHLIB_SUFFIX=.dll; \
+- SHLIB_SOVER=-$(LIBVERSION); \
++ SHLIB_SOVER=; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
++ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--export-all-symbols -Wl,--out-implib,lib$(LIBNAME).dll.a"; \
+ [ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \
+ [ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \
+ $(LINK_SO_A) || exit 1; \
+--- misc/openssl-0.9.8v/e_os2.h 2005-12-19 03:57:07.000000000 +0900
++++ misc/build/openssl-0.9.8v/e_os2.h 2009-04-04 23:07:15.324250000 +0900
+@@ -264,7 +264,7 @@
+ # define OPENSSL_IMPLEMENT_GLOBAL(type,name) \
+ extern type _hide_##name; \
+ type *_shadow_##name(void) { return &_hide_##name; } \
+- static type _hide_##name
++ type _hide_##name
+ # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
+ # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
+ #else
+--- misc/openssl-0.9.8v/ms/mingw32.bat 2006-05-05 15:19:32.000000000 +0200
++++ misc/build/openssl-0.9.8v/ms/mingw32.bat 2009-03-30 11:54:10.000000000 +0200
+@@ -79,15 +79,41 @@
+ rem copy ms\tlhelp32.h outinc
+
+ echo Building the libraries
+-mingw32-make -f ms/mingw32a.mak
++make -f ms/mingw32a.mak
+ if errorlevel 1 goto end
+
+ echo Generating the DLLs and input libraries
+-dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32
++mv out/libcrypto.a out/libcrypto_static.a
++mv out/libssl.a out/libssl_static.a
++dlltool --dllname libeay32.dll --output-lib out/libcrypto.a --input-def ms/libeay32.def
+ if errorlevel 1 goto end
+-dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a
++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
+ if errorlevel 1 goto end
++dlltool --dllname ssleay32.dll --output-lib out/libssl.a --input-def ms/ssleay32.def
++if errorlevel 1 goto end
++if "%MINGW_SHARED_GXXLIB%"=="TRUE" goto shared_gxxlib
++if "%MINGW_SHARED_GCCLIB%"=="TRUE" goto shared_gcclib
++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
++if errorlevel 1 goto end
++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto
++if errorlevel 1 goto end
++goto finished
++
++:shared_gcclib
++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32
++if errorlevel 1 goto end
++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto
++if errorlevel 1 goto end
++goto finished
++
++:shared_gxxlib
++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 %MINGW_SHARED_LIBSTDSPP%
++if errorlevel 1 goto end
++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto %MINGW_SHARED_LIBSTDSPP%
++if errorlevel 1 goto end
++goto finished
+
++:finished
+ echo Done compiling OpenSSL
+
+ :end
+--- misc/openssl-0.9.8v/util/pl/Mingw32.pl 2006-05-05 15:19:34.000000000 +0200
++++ misc/build/openssl-0.9.8v/util/pl/Mingw32.pl 2009-03-30 11:55:04.000000000 +0200
+@@ -6,11 +6,11 @@
+ $o='/';
+ $cp='cp';
+ $rm='rm -f';
+-$mkdir='gmkdir';
++#$mkdir='gmkdir';
+
+-$o='\\';
+-$cp='copy';
+-$rm='del';
++#$o='\\';
++#$cp='copy';
++#$rm='del';
+ $mkdir='mkdir';
+
+ # C compiler stuff
+@@ -87,7 +87,8 @@
+ ($Name=$name) =~ tr/a-z/A-Z/;
+
+ $ret.="$target: \$(${Name}OBJ)\n";
+- $ret.="\tif exist $target \$(RM) $target\n";
++ $ret.="\t\$(RM) $target\n";
++# $ret.="\tif exist $target \$(RM) $target\n";
+ $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
+ $ret.="\t\$(RANLIB) $target\n\n";
+ }
--- /dev/null
+--- misc/openssl-0.9.8v/Configure Mon Nov 9 15:14:26 2009
++++ build/openssl-0.9.8v/Configure Fri Mar 26 16:01:32 2010
+@@ -212,8 +212,8 @@
+ "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
+ #### Solaris x86 with Sun C setups
+-"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+-"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"solaris-x86-cc","cc:-O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"solaris64-x86_64-cc","cc:-xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
+ #### SPARC Solaris with GNU C setups
+ "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+--- misc/openssl-0.9.8v/Makefile.shared Wed Sep 17 17:56:40 2008
++++ build/openssl-0.9.8v/Makefile.shared Fri Mar 26 16:04:41 2010
+@@ -93,7 +93,7 @@
+ LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
++ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
+ $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
+
+ LINK_SO= \
+@@ -103,7 +103,7 @@
+ SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
++ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
+ $${SHAREDCMD} $${SHAREDFLAGS} \
+ -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
+ $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
+--- misc/openssl-0.9.8v/config Tue Mar 9 18:08:24 2010
++++ build/openssl-0.9.8v/config Fri Mar 26 16:07:55 2010
+@@ -399,28 +399,25 @@
+ # this is where the translation occurs into SSLeay terms
+ # ---------------------------------------------------------------------------
+
+-GCCVER=`(gcc -dumpversion) 2>/dev/null`
+-if [ "$GCCVER" != "" ]; then
+- # then strip off whatever prefix egcs prepends the number with...
+- # Hopefully, this will work for any future prefixes as well.
+- GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
+- # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
+- # does give us what we want though, so we use that. We just just the
+- # major and minor version numbers.
+- # peak single digit before and after first dot, e.g. 2.95.1 gives 29
+- GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
++if [ -z "$CC" ];then
++ GCCVER=`(gcc -dumpversion) 2>/dev/null`
++ if [ "$GCCVER" != "" ]; then
++ CC=gcc
++ # then strip off whatever prefix egcs prepends the number with...
++ # Hopefully, this will work for any future prefixes as well.
++ GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
++ # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
++ # does give us what we want though, so we use that. We just just the
++ # major and minor version numbers.
++ # peak single digit before and after first dot, e.g. 2.95.1 gives 29
++ GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
++ else
++ CC=cc
++ fi
++else
++ CC=`echo $CC | sed 's/^[^ ]*\/\(..\).*/\1/'`
+ fi
+
+-# Only set CC if not supplied already
+-if [ -z "$CC" ]; then
+-# figure out if gcc is available and if so we use it otherwise
+-# we fallback to whatever cc does on the system
+- if [ "$GCCVER" != "" ]; then
+- CC=gcc
+- else
+- CC=cc
+- fi
+-fi
+ GCCVER=${GCCVER:-0}
+ if [ "$SYSTEM" = "HP-UX" ];then
+ # By default gcc is a ILP32 compiler (with long long == 64).
--- /dev/null
+--- misc/openssl-0.9.8v/crypto/x509v3/v3_pci.c 2007-03-05 01:06:47.000000000 +0100
++++ build/openssl-0.9.8v/crypto/x509v3/v3_pci.c 2010-03-26 12:04:20.961547300 +0100
+@@ -2,7 +2,7 @@
+ /* Contributed to the OpenSSL Project 2004
+ * by Richard Levitte (richard@levitte.org)
+ */
+-/* Copyright (c) 2004 Kungliga Tekniska Högskolan
++/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+--- misc/openssl-0.9.8v/crypto/x509v3/v3_pcia.c 2004-12-28 01:21:33.000000000 +0100
++++ build/openssl-0.9.8v/crypto/x509v3/v3_pcia.c 2010-03-26 12:04:20.961547300 +0100
+@@ -2,7 +2,7 @@
+ /* Contributed to the OpenSSL Project 2004
+ * by Richard Levitte (richard@levitte.org)
+ */
+-/* Copyright (c) 2004 Kungliga Tekniska Högskolan
++/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+--- misc/openssl-0.9.8v/ms/do_ms.bat 2009-07-28 14:51:19.000000000 +0200
++++ build/openssl-0.9.8v/ms/do_ms.bat 2010-03-26 12:19:19.399047300 +0100
+@@ -1,11 +1,11 @@
+
+-perl util\mkfiles.pl >MINFO
+-perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak
+-perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak
++%1 util\mkfiles.pl >MINFO
++if %2 == VC-WIN32 goto not64a
++perl ms\uplink.pl win64a > ms\uptable.asm
++ml64 -c -Foms\uptable.obj ms\uptable.asm
++:not64a
++%1 util\mk1mf.pl no-asm %2 >ms\nt.mak
++%1 util\mk1mf.pl dll no-asm %2 >ms\ntdll.mak
+-if x%OSVERSION% == x goto skipce
+-perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak
+-perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak
+-:skipce
+
+-perl util\mkdef.pl 32 libeay > ms\libeay32.def
+-perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
++%1 util\mkdef.pl 32 libeay > ms\libeay32.def
++%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
+--- misc/openssl-0.9.8v/util/mk1mf.pl 2009-09-20 14:46:42.000000000 +0200
++++ build/openssl-0.9.8v/util/mk1mf.pl 2010-03-26 12:04:20.977172300 +0100
+@@ -128,7 +128,7 @@
+ $inc_def="outinc";
+ $tmp_def="tmp";
+
+-$perl="perl" unless defined $perl;
++$perl="$ENV{PERL}" unless defined $perl;
+ $mkdir="-mkdir" unless defined $mkdir;
+
+ ($ssl,$crypto)=("ssl","crypto");
+@@ -290,6 +290,11 @@
+ chop;
+
+ ($key,$val)=/^([^=]+)=(.*)/;
++
++ # On some Windows machines, $val has linefeeds at the end, which confuses
++ # subsequent code in this file. So we strip all whitespace at the end.
++ $val =~ s/\s+$//;
++
+ if ($key eq "RELATIVE_DIRECTORY")
+ {
+ if ($lib ne "")
+@@ -529,7 +529,7 @@
+ # Set your compiler options
+ PLATFORM=$platform
+ CC=$bin_dir${cc}
+-CFLAG=$cflags
++CFLAG=$cflags \$(SOLARINC)
+ APP_CFLAG=$app_cflag
+ LIB_CFLAG=$lib_cflag
+ SHLIB_CFLAG=$shl_cflag
+@@ -544,7 +544,7 @@
+
+ LINK=$link
+ LFLAGS=$lflags
+-RSC=$rsc
++RSC=$rsc \$(SOLARINC)
+
+ # The output directory for everything intersting
+ OUT_D=$out_dir
+@@ -730,7 +735,7 @@
+ printf OUT <<EOF;
+ #ifdef $platform_cpp_symbol
+ /* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */
+- #define CFLAGS "$cc $cflags"
++ #define CFLAGS "$cflags"
+ #define PLATFORM "$platform"
+ EOF
+ printf OUT " #define DATE \"%s\"\n", scalar gmtime();
+--- misc/openssl-0.9.8v/util/pl/VC-32.pl 2010-02-04 02:10:24.000000000 +0100
++++ build/openssl-0.9.8v/util/pl/VC-32.pl 2010-03-26 12:04:20.977172300 +0100
+@@ -32,7 +32,7 @@
+ my $ff = "";
+
+ # C compiler stuff
+-$cc='cl';
++$cc=$ENV{'CC'};
+ if ($FLAVOR =~ /WIN64/)
+ {
+ # Note that we currently don't have /WX on Win64! There is a lot of
+@@ -103,22 +103,22 @@
+ }
+
+ $cc='$(CC)';
+- $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
++ $base_cflags=' -W3 -GF -Gy -nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
+ $base_cflags.=" $wcecdefs";
+ $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
+ $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
+- $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
+- $dbg_cflags=' /MC /Od -DDEBUG -D_DEBUG';
++ $opt_cflags=' -MC -O1i'; # optimize for space, but with intrinsics...
++ $dbg_cflags=' -MC -Od -DDEBUG -D_DEBUG';
+ $lflags="/nologo /opt:ref $wcelflag";
+ }
+ else # Win32
+ {
+- $base_cflags= " $mf_cflag";
++ $base_cflags= " $mf_cflag";
+- my $f = $shlib || $fips ?' /MD':' /MT';
+- $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
++ my $f = $shlib || $fips ? (($ENV{MSVC_USE_DEBUG_RUNTIME} eq "TRUE") ? ' -MDd' : ' -MD' ):' -MT';
++ $lib_cflag='-Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
+ $ff = "/fixed";
+- $opt_cflags=$f.' /Ox /O2 /Ob2';
+- $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
++ $opt_cflags=$f.' -Ox -O2 -Ob2';
++ $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG';
+ $lflags="/nologo /subsystem:console /opt:ref";
+ }
+ $mlflags='';
+@@ -138,7 +138,7 @@
+
+ $obj='.obj';
+ $asm_suffix='.asm';
+-$ofile="/Fo";
++$ofile="-Fo.\\";
+
+ # EXE linking stuff
+ $link="link";
+--- build/openssl-0.9.8v/ms/uplink.c
++++ build/openssl-0.9.8v/ms/uplink.c
+@@ -1,5 +1,6 @@
+ #if (defined(_WIN64) || defined(_WIN32_WCE)) && !defined(UNICODE)
+ #define UNICODE
++#define _CRT_NON_CONFORMING_SWPRINTFS
+ #endif
+ #if defined(UNICODE) && !defined(_UNICODE)
+ #define _UNICODE
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,poppler))
+
+$(eval $(call gb_ExternalProject_use_autoconf,poppler,build))
+
+$(eval $(call gb_ExternalProject_register_targets,poppler,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,poppler,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)") \
+ ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --enable-xpdf-headers \
+ --disable-poppler-cpp \
+ --disable-libopenjpeg \
+ --disable-libtiff \
+ --disable-libjpeg \
+ --disable-libpng \
+ --disable-zlib \
+ --disable-libcurl \
+ --disable-splash-output \
+ --disable-cairo-output \
+ --disable-poppler-glib \
+ --disable-poppler-qt4 \
+ --disable-gtk-test \
+ --disable-utils \
+ --disable-cms \
+ $(if $(filter WNT MACOSX,$(OS)),--with-font-configuration=win32,--with-font-configuration=fontconfig) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,poppler))
+
+ifeq ($(SYSTEM_POPPLER),)
+
+$(eval $(call gb_Module_add_targets,poppler,\
+ ExternalProject_poppler \
+ UnpackedTarball_poppler \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+From [http://poppler.freedesktop.org/]. Not modified. PDF rendering library based on the xpdf-3.0 code base.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,poppler))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler))
+
+$(eval $(call gb_UnpackedTarball_add_patches,poppler,\
+ external/poppler/poppler-notests.patch.1 \
+ external/poppler/poppler-snprintf.patch.1 \
+ external/poppler/poppler-mac-fake.patch.1 \
+ external/poppler/poppler-nochecknew.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff -ur poppler.org/poppler/GlobalParams.cc poppler/poppler/GlobalParams.cc
+--- poppler.org/poppler/GlobalParams.cc 2013-07-09 06:24:38.000000000 -0500
++++ poppler/poppler/GlobalParams.cc 2013-07-09 06:25:18.000000000 -0500
+@@ -1327,7 +1327,7 @@
+ return path;
+ }
+
+-#elif WITH_FONTCONFIGURATION_WIN32
++#elif WITH_FONTCONFIGURATION_WIN32 && defined(_WIN32)
+ #include "GlobalParamsWin.cc"
+
+ GooString *GlobalParams::findBase14FontFile(GooString *base14Name, GfxFont *font) {
+
--- /dev/null
+--- poppler-0.22.5/configure
++++ poppler-0.22.5/configure
+@@ -24014,7 +24014,7 @@
+ fi
+ case "$enable_compile_warnings" in
+ no) ;;
+- yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS";
++ yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-common $CXXFLAGS";
+ CFLAGS="-Wall $CFLAGS" ;;
+ kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
+ -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
--- /dev/null
+--- poppler-0.22.5/Makefile.in 2013-06-16 18:24:09.000000000 +0200
++++ poppler-0.22.5/Makefile.in 2013-07-08 17:10:53.382213184 +0200
+@@ -456,7 +456,7 @@
+ @BUILD_POPPLER_CPP_TRUE@cpp_subdir = cpp
+ @BUILD_POPPLER_CPP_TRUE@cpp_pc_file = poppler-cpp.pc
+ @BUILD_UTILS_TRUE@utils_subdir = utils
+-SUBDIRS = goo fofi $(splash_subdir) poppler $(utils_subdir) $(glib_subdir) test $(qt4_subdir) $(cpp_subdir)
++SUBDIRS = goo fofi $(splash_subdir) poppler $(utils_subdir) $(glib_subdir) $(qt4_subdir) $(cpp_subdir)
+
+ # Add CMake buildsystem files here so they get added on make dist
+ EXTRA_DIST = README-XPDF poppler.pc.in poppler-uninstalled.pc.in \
--- /dev/null
+--- poppler-0.22.5/poppler/Catalog.cc 2013-06-09 12:16:12.000000000 +0200
++++ poppler-0.22.5/poppler/Catalog.cc 2013-07-08 16:54:30.712095880 +0200
+@@ -40,6 +40,14 @@
+
+ #include <stddef.h>
+ #include <stdlib.h>
++#ifdef _WIN32
++# ifdef __MINGW32__
++# define _SNPRINTF_DLLIMPORT
++# endif
++# ifdef _MSC_VER
++# include <systools/win32/snprintf.h>
++# endif
++#endif
+ #include "goo/gmem.h"
+ #include "Object.h"
+ #include "PDFDoc.h"
+--- poppler-0.22.5/poppler/GlobalParams.cc 2013-03-25 22:48:34.000000000 +0100
++++ poppler-0.22.5/poppler/GlobalParams.cc 2013-07-08 16:55:04.753303654 +0200
+@@ -57,6 +57,12 @@
+ #ifdef _WIN32
+ # include <shlobj.h>
+ # include <mbstring.h>
++# ifdef __MINGW32__
++# define _SNPRINTF_DLLIMPORT
++# endif
++# ifdef _MSC_VER
++# include <systools/win32/snprintf.h>
++# endif
+ #endif
+ #include "goo/gmem.h"
+ #include "goo/GooString.h"
+--- poppler-0.22.5/poppler/PageLabelInfo.cc 2013-03-25 22:48:34.000000000 +0100
++++ poppler-0.22.5/poppler/PageLabelInfo.cc 2013-07-08 16:56:47.977901129 +0200
+@@ -17,6 +17,14 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <assert.h>
++#ifdef _WIN32
++# ifdef __MINGW32__
++# define _SNPRINTF_DLLIMPORT
++# endif
++# ifdef _MSC_VER
++# include <systools/win32/snprintf.h>
++# endif
++#endif
+
+ #include "PageLabelInfo.h"
+
+Only in poppler-0.22.5: poppler-snprintf.patch.1
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,postgresql))
+
+$(eval $(call gb_ExternalProject_use_externals,postgresql,\
+ openldap \
+ openssl \
+ zlib \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,postgresql,\
+ build \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+
+$(call gb_ExternalProject_get_state_target,postgresql,build) :
+ $(call gb_ExternalProject_run,build,\
+ MAKEFLAGS= && nmake -f win32.mak USE_SSL=1 USE_LDAP=1 \
+ ,src)
+
+else
+
+postgresql_CPPFLAGS := $(ZLIB_CFLAGS)
+postgresql_LDFLAGS :=
+
+ifeq ($(DISABLE_OPENSSL),)
+ifeq ($(SYSTEM_OPENSSL),)
+postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include
+postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/
+endif
+endif
+
+ifeq ($(SYSTEM_OPENLDAP),)
+postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openldap)/include
+postgresql_LDFLAGS += \
+ -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap_r/.libs \
+ -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/libldap/.libs \
+ -L$(call gb_UnpackedTarball_get_dir,openldap)/libraries/liblber/.libs \
+ $(if $(SYSTEM_NSS),,\
+ -L$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib) \
+
+endif
+
+
+$(call gb_ExternalProject_get_state_target,postgresql,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ --without-readline --disable-shared --with-ldap \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(DISABLE_OPENSSL),,--with-openssl \
+ $(if $(WITH_KRB5), --with-krb5) \
+ $(if $(WITH_GSSAPI),--with-gssapi)) \
+ CPPFLAGS="$(postgresql_CPPFLAGS)" \
+ LDFLAGS="$(postgresql_LDFLAGS)" \
+ EXTRA_LDAP_LIBS="-llber -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4" \
+ && cd src/interfaces/libpq \
+ && MAKEFLAGS= && $(MAKE) all-static-lib)
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,postgresql))
+
+ifeq ($(SYSTEM_POSTGRESQL),)
+
+$(eval $(call gb_Module_add_targets,postgresql,\
+ ExternalProject_postgresql \
+ UnpackedTarball_postgresql \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+PostgreSQL object-relational database management system
+
+We use some pieces of this code for the postgresql database connector.
\ No newline at end of file
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,postgresql))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,postgresql,$(POSTGRESQL_TARBALL),,postgresql))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,postgresql,3))
+
+$(eval $(call gb_UnpackedTarball_add_patches,postgresql, \
+ external/postgresql/postgresql-libs-leak.patch \
+ external/postgresql/postgresql-9.2.1-autoreconf.patch \
+ external/postgresql/postgresql-9.2.1-libreoffice.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/build/postgresql-9.1.1/configure 2011-09-22 23:57:57.000000000 +0200
++++ misc/build/postgresql-9.1.1.patched/configure 2012-02-03 11:50:07.000000000 +0100
+@@ -830,6 +830,7 @@
+ with_krb_srvnam
+ with_pam
+ with_ldap
++with_mozldap
+ with_bonjour
+ with_openssl
+ with_selinux
+@@ -1527,6 +1528,7 @@
+ [postgres]
+ --with-pam build with PAM support
+ --with-ldap build with LDAP support
++ --with-mozldap build with Mozilla LDAP support
+ --with-bonjour build with Bonjour support
+ --with-openssl build with OpenSSL support
+ --with-selinux build with SELinux support
+@@ -5412,6 +5414,42 @@
+
+
+
++{ $as_echo "$as_me:$LINENO: checking whether to use Mozilla C SDK for LDAP support" >&5
++$as_echo_n "checking whether to use Mozilla C SDK for LDAP support... " >&6; }
++
++
++
++# Check whether --with-mozldap was given.
++if test "${with_mozldap+set}" = set; then
++ withval=$with_mozldap;
++ case $withval in
++ yes)
++
++cat >>confdefs.h <<\_ACEOF
++#define USE_MOZLDAP 1
++_ACEOF
++
++ ;;
++ no)
++ :
++ ;;
++ *)
++ { { $as_echo "$as_me:$LINENO: error: no argument expected for --with-mozldap option" >&5
++$as_echo "$as_me: error: no argument expected for --with-mozldap option" >&2;}
++ { (exit 1); exit 1; }; }
++ ;;
++ esac
++
++else
++ with_mozldap=no
++
++fi
++
++
++{ $as_echo "$as_me:$LINENO: result: $with_mozldap" >&5
++$as_echo "$with_mozldap" >&6; }
++
++
+
+ #
+ # Kerberos configuration parameters
+@@ -8627,11 +8665,11 @@
+ *** Not using spinlocks will cause poor performance." >&2;}
+ fi
+
+-if test "$with_gssapi" = yes ; then
++if test "$with_krb5" = yes ; then
+ if test "$PORTNAME" != "win32"; then
+- { $as_echo "$as_me:$LINENO: checking for library containing gss_init_sec_context" >&5
+-$as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
+-if test "${ac_cv_search_gss_init_sec_context+set}" = set; then
++ { $as_echo "$as_me:$LINENO: checking for library containing com_err" >&5
++$as_echo_n "checking for library containing com_err... " >&6; }
++if test "${ac_cv_search_com_err+set}" = set; then
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -8648,16 +8686,16 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char gss_init_sec_context ();
++char com_err ();
+ int
+ main ()
+ {
+-return gss_init_sec_context ();
++return com_err ();
+ ;
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
++for ac_lib in '' com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+@@ -8685,7 +8723,7 @@
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+- ac_cv_search_gss_init_sec_context=$ac_res
++ ac_cv_search_com_err=$ac_res
+ else
+ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+@@ -8696,40 +8734,33 @@
+ rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+- if test "${ac_cv_search_gss_init_sec_context+set}" = set; then
++ if test "${ac_cv_search_com_err+set}" = set; then
+ break
+ fi
+ done
+-if test "${ac_cv_search_gss_init_sec_context+set}" = set; then
++if test "${ac_cv_search_com_err+set}" = set; then
+ :
+ else
+- ac_cv_search_gss_init_sec_context=no
++ ac_cv_search_com_err=no
+ fi
+ rm conftest.$ac_ext
+ LIBS=$ac_func_search_save_LIBS
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gss_init_sec_context" >&5
+-$as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
+-ac_res=$ac_cv_search_gss_init_sec_context
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
++$as_echo "$ac_cv_search_com_err" >&6; }
++ac_res=$ac_cv_search_com_err
+ if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ else
+- { { $as_echo "$as_me:$LINENO: error: could not find function 'gss_init_sec_context' required for GSSAPI" >&5
+-$as_echo "$as_me: error: could not find function 'gss_init_sec_context' required for GSSAPI" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
++$as_echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+- else
+- LIBS="$LIBS -lgssapi32"
+- fi
+-fi
+-
+-if test "$with_krb5" = yes ; then
+- if test "$PORTNAME" != "win32"; then
+- { $as_echo "$as_me:$LINENO: checking for library containing com_err" >&5
+-$as_echo_n "checking for library containing com_err... " >&6; }
+-if test "${ac_cv_search_com_err+set}" = set; then
++ { $as_echo "$as_me:$LINENO: checking for library containing krb5_sendauth" >&5
++$as_echo_n "checking for library containing krb5_sendauth... " >&6; }
++if test "${ac_cv_search_krb5_sendauth+set}" = set; then
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -8746,16 +8777,16 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char com_err ();
++char krb5_sendauth ();
+ int
+ main ()
+ {
+-return com_err ();
++return krb5_sendauth ();
+ ;
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' com_err 'com_err -lssl -lcrypto'; do
++for ac_lib in '' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+@@ -8783,7 +8814,7 @@
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+- ac_cv_search_com_err=$ac_res
++ ac_cv_search_krb5_sendauth=$ac_res
+ else
+ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+@@ -8794,33 +8825,34 @@
+ rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+- if test "${ac_cv_search_com_err+set}" = set; then
++ if test "${ac_cv_search_krb5_sendauth+set}" = set; then
+ break
+ fi
+ done
+-if test "${ac_cv_search_com_err+set}" = set; then
++if test "${ac_cv_search_krb5_sendauth+set}" = set; then
+ :
+ else
+- ac_cv_search_com_err=no
++ ac_cv_search_krb5_sendauth=no
+ fi
+ rm conftest.$ac_ext
+ LIBS=$ac_func_search_save_LIBS
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
+-$as_echo "$ac_cv_search_com_err" >&6; }
+-ac_res=$ac_cv_search_com_err
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_krb5_sendauth" >&5
++$as_echo "$ac_cv_search_krb5_sendauth" >&6; }
++ac_res=$ac_cv_search_krb5_sendauth
+ if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ else
+- { { $as_echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
+-$as_echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&5
++$as_echo "$as_me: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+- { $as_echo "$as_me:$LINENO: checking for library containing krb5_sendauth" >&5
+-$as_echo_n "checking for library containing krb5_sendauth... " >&6; }
+-if test "${ac_cv_search_krb5_sendauth+set}" = set; then
++ else
++ { $as_echo "$as_me:$LINENO: checking for library containing com_err" >&5
++$as_echo_n "checking for library containing com_err... " >&6; }
++if test "${ac_cv_search_com_err+set}" = set; then
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -8837,16 +8869,16 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char krb5_sendauth ();
++char com_err ();
+ int
+ main ()
+ {
+-return krb5_sendauth ();
++return com_err ();
+ ;
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'; do
++for ac_lib in '' 'comerr32 -lkrb5_32'; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+@@ -8874,7 +8906,7 @@
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+- ac_cv_search_krb5_sendauth=$ac_res
++ ac_cv_search_com_err=$ac_res
+ else
+ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+@@ -8885,34 +8917,38 @@
+ rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+- if test "${ac_cv_search_krb5_sendauth+set}" = set; then
++ if test "${ac_cv_search_com_err+set}" = set; then
+ break
+ fi
+ done
+-if test "${ac_cv_search_krb5_sendauth+set}" = set; then
++if test "${ac_cv_search_com_err+set}" = set; then
+ :
+ else
+- ac_cv_search_krb5_sendauth=no
++ ac_cv_search_com_err=no
+ fi
+ rm conftest.$ac_ext
+ LIBS=$ac_func_search_save_LIBS
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_krb5_sendauth" >&5
+-$as_echo "$ac_cv_search_krb5_sendauth" >&6; }
+-ac_res=$ac_cv_search_krb5_sendauth
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
++$as_echo "$ac_cv_search_com_err" >&6; }
++ac_res=$ac_cv_search_com_err
+ if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ else
+- { { $as_echo "$as_me:$LINENO: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&5
+-$as_echo "$as_me: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
++$as_echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+- else
+- { $as_echo "$as_me:$LINENO: checking for library containing com_err" >&5
+-$as_echo_n "checking for library containing com_err... " >&6; }
+-if test "${ac_cv_search_com_err+set}" = set; then
++ fi
++fi
++
++if test "$with_gssapi" = yes ; then
++ if test "$PORTNAME" != "win32"; then
++ { $as_echo "$as_me:$LINENO: checking for library containing gss_init_sec_context" >&5
++$as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
++if test "${ac_cv_search_gss_init_sec_context+set}" = set; then
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -8929,16 +8965,16 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char com_err ();
++char gss_init_sec_context ();
+ int
+ main ()
+ {
+-return com_err ();
++return gss_init_sec_context ();
+ ;
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' 'comerr32 -lkrb5_32'; do
++for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+@@ -8966,7 +9002,7 @@
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+- ac_cv_search_com_err=$ac_res
++ ac_cv_search_gss_init_sec_context=$ac_res
+ else
+ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+@@ -8977,30 +9013,32 @@
+ rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+- if test "${ac_cv_search_com_err+set}" = set; then
++ if test "${ac_cv_search_gss_init_sec_context+set}" = set; then
+ break
+ fi
+ done
+-if test "${ac_cv_search_com_err+set}" = set; then
++if test "${ac_cv_search_gss_init_sec_context+set}" = set; then
+ :
+ else
+- ac_cv_search_com_err=no
++ ac_cv_search_gss_init_sec_context=no
+ fi
+ rm conftest.$ac_ext
+ LIBS=$ac_func_search_save_LIBS
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
+-$as_echo "$ac_cv_search_com_err" >&6; }
+-ac_res=$ac_cv_search_com_err
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gss_init_sec_context" >&5
++$as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
++ac_res=$ac_cv_search_gss_init_sec_context
+ if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ else
+- { { $as_echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
+-$as_echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: could not find function 'gss_init_sec_context' required for GSSAPI" >&5
++$as_echo "$as_me: error: could not find function 'gss_init_sec_context' required for GSSAPI" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
++ else
++ LIBS="$LIBS -lgssapi32"
+ fi
+ fi
+
+@@ -13598,7 +13636,7 @@
+ fi
+
+ if test "$with_ldap" = yes ; then
+- if test "$PORTNAME" != "win32"; then
++ if test "$PORTNAME" != "win32" || test "$with_mozldap" = "yes"; then
+
+ for ac_header in ldap.h
+ do
+@@ -13823,6 +13861,11 @@
+
+ done
+
++
++cat >>confdefs.h <<\_ACEOF
++#define USE_MICROSOFT_LDAP 1
++_ACEOF
++
+ fi
+ fi
+
+@@ -23483,7 +23526,99 @@
+ # We can test for libldap_r only after we know PTHREAD_LIBS
+ if test "$with_ldap" = yes ; then
+ _LIBS="$LIBS"
++ if test "$with_mozldap" = "yes"; then
+ if test "$PORTNAME" != "win32"; then
++ mozlibname=ldap50
++ else
++ mozlibname=nsldap32v50
++ fi
++
++as_ac_Lib=`$as_echo "ac_cv_lib_$mozlibname''_ldap_bind" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for ldap_bind in -l$mozlibname" >&5
++$as_echo_n "checking for ldap_bind in -l$mozlibname... " >&6; }
++if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-l$mozlibname $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char ldap_bind ();
++int
++main ()
++{
++return ldap_bind ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
++ (eval "$ac_link") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
++ eval "$as_ac_Lib=yes"
++else
++ $as_echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ eval "$as_ac_Lib=no"
++fi
++
++rm -rf conftest.dSYM
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++ac_res=`eval 'as_val=${'$as_ac_Lib'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++as_val=`eval 'as_val=${'$as_ac_Lib'}
++ $as_echo "$as_val"'`
++ if test "x$as_val" = x""yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `$as_echo "HAVE_LIB$mozlibname" | $as_tr_cpp` 1
++_ACEOF
++
++ LIBS="-l$mozlibname $LIBS"
++
++else
++ { { $as_echo "$as_me:$LINENO: error: library \"$mozlibname\" is required for Mozilla LDAP" >&5
++$as_echo "$as_me: error: library \"$mozlibname\" is required for Mozilla LDAP" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++ LDAP_LIBS_FE="-l$mozlibname $EXTRA_LDAP_LIBS"
++ LDAP_LIBS_BE="-l$mozlibname $EXTRA_LDAP_LIBS"
++ elif test "$PORTNAME" != "win32"; then
+
+ { $as_echo "$as_me:$LINENO: checking for ldap_bind in -lldap" >&5
+ $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
+--- misc/build/postgresql-9.1.1/src/include/pg_config.h.in 2011-09-22 23:57:57.000000000 +0200
++++ misc/build/postgresql-9.1.1.patched/src/include/pg_config.h.in 2012-02-03 11:50:07.000000000 +0100
+@@ -758,6 +758,13 @@
+ (--with-libxslt) */
+ #undef USE_LIBXSLT
+
++/* Defined when using Microsof LDAP */
++#undef USE_MICROSOFT_LDAP
++
++/* Define to 1 to use the Mozilla LDAP C SDK instead of platform default
++ (OpenLDAP or Microsoft LDAP). (--with-mozldap) */
++#undef USE_MOZLDAP
++
+ /* Define to select named POSIX semaphores. */
+ #undef USE_NAMED_POSIX_SEMAPHORES
+
+
--- /dev/null
+--- misc/build/postgresql-9.1.1/src/interfaces/libpq/Makefile 2011-09-22 23:57:57.000000000 +0200
++++ misc/build/postgresql-9.1.1.patched/src/interfaces/libpq/Makefile 2011-12-15 09:02:18.000000000 +0100
+@@ -148,3 +148,6 @@
+ maintainer-clean: distclean maintainer-clean-lib
+ $(MAKE) -C test $@
+ rm -f libpq-dist.rc
++
++libpq-flags.mk:
++ @printf '%s\n' 'LIBPQ_DEP_LIBS+=$(SHLIB_LINK)' > '$@'
+--- misc/build/postgresql-9.1.1/src/interfaces/libpq/win32.mak 2011-12-14 14:28:59.000000000 +0100
++++ misc/build/postgresql-9.1.1.patched/src/interfaces/libpq/win32.mak 2011-12-15 09:11:37.000000000 +0100
+@@ -11,14 +11,12 @@
+ !ENDIF
+
+ !IFDEF DEBUG
+-OPT=/Od /Zi /MDd
++OPT=/Od /Zi
+ LOPT=/DEBUG
+-DEBUGDEF=/D _DEBUG
+-OUTFILENAME=libpqd
++OUTFILENAME=libpq
+ !ELSE
+ OPT=/O2 /MD
+ LOPT=
+-DEBUGDEF=/D NDEBUG
+ OUTFILENAME=libpq
+ !ENDIF
+
+@@ -67,18 +66,11 @@
+ CPP=cl.exe
+ RSC=rc.exe
+
+-!IFDEF DEBUG
+-OUTDIR=.\Debug
+-INTDIR=.\Debug
+-CPP_OBJS=.\Debug/
+-!ELSE
+-OUTDIR=.\Release
+-INTDIR=.\Release
+-CPP_OBJS=.\Release/
+-!ENDIF
+-
++OUTDIR=.
++INTDIR=.
++CPP_OBJS=./
+
+-ALL : config "$(OUTDIR)\$(OUTFILENAME).lib" "$(OUTDIR)\$(OUTFILENAME).dll"
++ALL : config "$(OUTDIR)\$(OUTFILENAME).lib"
+
+ CLEAN :
+ -@erase "$(INTDIR)\getaddrinfo.obj"
+@@ -178,10 +170,11 @@
+ "$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+-CPP_PROJ=/nologo /W3 /EHsc $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. /I "$(SSL_INC)" \
++CPP_PROJ=/nologo /W3 /EHsc $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. $(SOLARINC) /I $(WORKDIR)/UnpackedTarball/openssl/include \
+ /D "FRONTEND" $(DEBUGDEF) \
+ /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" \
+ /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
++ /D "_CRT_NONSTDC_NO_DEPRECATE" \
+ /D "_CRT_SECURE_NO_DEPRECATE" $(ADD_DEFINES)
+
+ !IFDEF USE_SSL
+@@ -222,7 +215,7 @@
+ <<
+
+ "$(INTDIR)\libpq.res" : "$(INTDIR)" libpq-dist.rc
+- $(RSC) $(RSC_PROJ) libpq-dist.rc
++ $(RSC) $(SOLARINC) $(RSC_PROJ) libpq-dist.rc
+
+
+ "$(OUTDIR)\$(OUTFILENAME).dll" : "$(OUTDIR)" "$(INTDIR)\libpq.res"
+
--- /dev/null
+diff --recursive -u misc/build/postgresql-9.1.1/configure.in misc/build/postgresql-9.1.1.patched/configure.in
+--- misc/build/postgresql-9.1.1/configure.in 2011-09-22 23:57:57.000000000 +0200
++++ misc/build/postgresql-9.1.1.patched/configure.in 2012-02-03 11:42:45.000000000 +0100
+@@ -903,18 +903,9 @@
+ *** Not using spinlocks will cause poor performance.])
+ fi
+
+-if test "$with_gssapi" = yes ; then
+- if test "$PORTNAME" != "win32"; then
+- AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
+- [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
+- else
+- LIBS="$LIBS -lgssapi32"
+- fi
+-fi
+-
+ if test "$with_krb5" = yes ; then
+ if test "$PORTNAME" != "win32"; then
+- AC_SEARCH_LIBS(com_err, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' com_err 'com_err -lssl -lcrypto'], [],
++ AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
+ [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
+ AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
+ [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
+@@ -924,6 +915,15 @@
+ fi
+ fi
+
++if test "$with_gssapi" = yes ; then
++ if test "$PORTNAME" != "win32"; then
++ AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
++ [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
++ else
++ LIBS="$LIBS -lgssapi32"
++ fi
++fi
++
+ if test "$with_openssl" = yes ; then
+ dnl Order matters!
+ if test "$PORTNAME" != "win32"; then
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,python3,python3))
+
+$(eval $(call gb_ExternalPackage_use_external_project,python3,python3))
+
+ifeq ($(OS)-$(COM),WNT-MSC)
+ifeq ($(CPUNAME),X86_64)
+python_arch_subdir=amd64/
+endif
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/bin/python.exe,LO_lib/$(python_arch_subdir)python$(if $(MSVC_USE_DEBUG_RUNTIME),_d).exe))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if $(MSVC_USE_DEBUG_RUNTIME),_d).dll,LO_lib/$(python_arch_subdir)python$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if $(MSVC_USE_DEBUG_RUNTIME),_d).dll))
+ifeq ($(MSVC_USE_DEBUG_RUNTIME),)
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR).dll,LO_lib/$(python_arch_subdir)python$(PYTHON_VERSION_MAJOR).dll))
+endif
+$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
+ LO_lib/$(python_arch_subdir)_ctypes$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_ctypes_test$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_decimal$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_elementtree$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_msi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_multiprocessing$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_socket$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_ssl$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_testbuffer$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)_testcapi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)pyexpat$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)select$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)unicodedata$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ LO_lib/$(python_arch_subdir)winsound$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+))
+else ifeq ($(OS),WNT) # MinGW
+# TODO how are C modules called on this platform?
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/bin/python.exe,python.exe))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR).dll,python$(PYTHON_VERSION_MAJOR).dll))
+else
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).so,libpython$(PYTHON_VERSION_MAJOR).so))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so-gdb.py,Tools/gdb/libpython.py))
+# versioned lib/libpython3.3m.so.1.0 appears to be unnecessary?
+
+# Unfortunately the python build system does not allow to explicitly enable or
+# disable these, it just tries to build them and then prints which did not
+# build successfully without stopping; so the build will break on delivering if
+# one of these failed to build.
+# Obviously this list should not contain stuff with external dependencies
+# that may not be available on baseline systems.
+ifneq ($(OS),AIX)
+$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib-dynload,\
+ LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/atexit.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_ctypes_test.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ $(if $(DISABLE_OPENSSL),, \
+ LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ ) \
+ LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/nis.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ $(if $(DISABLE_OPENSSL),, \
+ LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ ) \
+ LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_testbuffer.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_testcapi.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/time.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)m.so \
+))
+endif
+endif
+
+# headers are not delivered, but used from unpacked dir Include/
+# (+ toplevel for pyconfig.h)
+
+# that one is generated...
+ifneq ($(OS)-$(COM),WNT-MSC)
+$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
+ LO_lib/_sysconfigdata.py \
+))
+endif
+
+# packages not shipped:
+# dbm, sqlite3 - need some database stuff
+# curses - need curses to build the C module
+# idlelib, tkinter, turtledemo - need Tk to build the C module
+# test - probably unnecessary? was explicitly removed #i116738#
+# venv - why would we need virtual environments
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-linux,\
+ Lib/plat-linux/regen \
+ Lib/plat-linux/CDROM.py \
+ Lib/plat-linux/DLFCN.py \
+ Lib/plat-linux/IN.py \
+ Lib/plat-linux/TYPES.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-darwin,\
+ Lib/plat-darwin/IN.py \
+ Lib/plat-darwin/regen \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-sunos5,\
+ Lib/plat-sunos5/regen \
+ Lib/plat-sunos5/CDIO.py \
+ Lib/plat-sunos5/DLFCN.py \
+ Lib/plat-sunos5/IN.py \
+ Lib/plat-sunos5/STROPTS.py \
+ Lib/plat-sunos5/TYPES.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-aix4,\
+ Lib/plat-aix4/regen \
+ Lib/plat-aix4/IN.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
+ LICENSE \
+ Lib/__future__.py \
+ Lib/__phello__.foo.py \
+ Lib/_compat_pickle.py \
+ Lib/_dummy_thread.py \
+ Lib/_markupbase.py \
+ Lib/_osx_support.py \
+ Lib/_pyio.py \
+ Lib/_strptime.py \
+ Lib/_threading_local.py \
+ Lib/_weakrefset.py \
+ Lib/abc.py \
+ Lib/aifc.py \
+ Lib/antigravity.py \
+ Lib/argparse.py \
+ Lib/ast.py \
+ Lib/asynchat.py \
+ Lib/asyncore.py \
+ Lib/base64.py \
+ Lib/bdb.py \
+ Lib/binhex.py \
+ Lib/bisect.py \
+ Lib/bz2.py \
+ Lib/cProfile.py \
+ Lib/calendar.py \
+ Lib/cgi.py \
+ Lib/cgitb.py \
+ Lib/chunk.py \
+ Lib/cmd.py \
+ Lib/code.py \
+ Lib/codecs.py \
+ Lib/codeop.py \
+ Lib/colorsys.py \
+ Lib/compileall.py \
+ Lib/configparser.py \
+ Lib/contextlib.py \
+ Lib/copy.py \
+ Lib/copyreg.py \
+ Lib/crypt.py \
+ Lib/csv.py \
+ Lib/datetime.py \
+ Lib/decimal.py \
+ Lib/difflib.py \
+ Lib/dis.py \
+ Lib/doctest.py \
+ Lib/dummy_threading.py \
+ Lib/filecmp.py \
+ Lib/fileinput.py \
+ Lib/fnmatch.py \
+ Lib/formatter.py \
+ Lib/fractions.py \
+ Lib/ftplib.py \
+ Lib/functools.py \
+ Lib/genericpath.py \
+ Lib/getopt.py \
+ Lib/getpass.py \
+ Lib/gettext.py \
+ Lib/glob.py \
+ Lib/gzip.py \
+ Lib/hashlib.py \
+ Lib/heapq.py \
+ Lib/hmac.py \
+ Lib/imaplib.py \
+ Lib/imghdr.py \
+ Lib/imp.py \
+ Lib/inspect.py \
+ Lib/io.py \
+ Lib/ipaddress.py \
+ Lib/keyword.py \
+ Lib/linecache.py \
+ Lib/locale.py \
+ Lib/lzma.py \
+ Lib/macpath.py \
+ Lib/macurl2path.py \
+ Lib/mailbox.py \
+ Lib/mailcap.py \
+ Lib/mimetypes.py \
+ Lib/modulefinder.py \
+ Lib/netrc.py \
+ Lib/nntplib.py \
+ Lib/ntpath.py \
+ Lib/nturl2path.py \
+ Lib/numbers.py \
+ Lib/opcode.py \
+ Lib/optparse.py \
+ Lib/os.py \
+ Lib/os2emxpath.py \
+ Lib/pdb.py \
+ Lib/pickle.py \
+ Lib/pickletools.py \
+ Lib/pipes.py \
+ Lib/pkgutil.py \
+ Lib/platform.py \
+ Lib/plistlib.py \
+ Lib/poplib.py \
+ Lib/posixpath.py \
+ Lib/pprint.py \
+ Lib/profile.py \
+ Lib/pstats.py \
+ Lib/pty.py \
+ Lib/py_compile.py \
+ Lib/pyclbr.py \
+ Lib/pydoc.py \
+ Lib/queue.py \
+ Lib/quopri.py \
+ Lib/random.py \
+ Lib/re.py \
+ Lib/reprlib.py \
+ Lib/rlcompleter.py \
+ Lib/runpy.py \
+ Lib/sched.py \
+ Lib/shelve.py \
+ Lib/shlex.py \
+ Lib/shutil.py \
+ Lib/site.py \
+ Lib/smtpd.py \
+ Lib/smtplib.py \
+ Lib/sndhdr.py \
+ Lib/socket.py \
+ Lib/socketserver.py \
+ Lib/sre_compile.py \
+ Lib/sre_constants.py \
+ Lib/sre_parse.py \
+ Lib/ssl.py \
+ Lib/stat.py \
+ Lib/string.py \
+ Lib/stringprep.py \
+ Lib/struct.py \
+ Lib/subprocess.py \
+ Lib/sunau.py \
+ Lib/symbol.py \
+ Lib/symtable.py \
+ Lib/sysconfig.py \
+ Lib/tabnanny.py \
+ Lib/tarfile.py \
+ Lib/telnetlib.py \
+ Lib/tempfile.py \
+ Lib/textwrap.py \
+ Lib/this.py \
+ Lib/threading.py \
+ Lib/timeit.py \
+ Lib/token.py \
+ Lib/tokenize.py \
+ Lib/trace.py \
+ Lib/traceback.py \
+ Lib/tty.py \
+ Lib/turtle.py \
+ Lib/types.py \
+ Lib/uu.py \
+ Lib/uuid.py \
+ Lib/warnings.py \
+ Lib/wave.py \
+ Lib/weakref.py \
+ Lib/webbrowser.py \
+ Lib/xdrlib.py \
+ Lib/zipfile.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/collections,\
+ Lib/collections/__init__.py \
+ Lib/collections/__main__.py \
+ Lib/collections/abc.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/concurrent,\
+ Lib/concurrent/__init__.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/concurrent/futures,\
+ Lib/concurrent/futures/__init__.py \
+ Lib/concurrent/futures/_base.py \
+ Lib/concurrent/futures/process.py \
+ Lib/concurrent/futures/thread.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/ctypes,\
+ Lib/ctypes/__init__.py \
+ Lib/ctypes/_endian.py \
+ Lib/ctypes/util.py \
+ Lib/ctypes/wintypes.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/ctypes/macholib,\
+ Lib/ctypes/macholib/README.ctypes \
+ Lib/ctypes/macholib/fetch_macholib \
+ Lib/ctypes/macholib/fetch_macholib.bat \
+ Lib/ctypes/macholib/__init__.py \
+ Lib/ctypes/macholib/dyld.py \
+ Lib/ctypes/macholib/dylib.py \
+ Lib/ctypes/macholib/framework.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/distutils,\
+ Lib/distutils/README \
+ Lib/distutils/__init__.py \
+ Lib/distutils/archive_util.py \
+ Lib/distutils/bcppcompiler.py \
+ Lib/distutils/ccompiler.py \
+ Lib/distutils/cmd.py \
+ Lib/distutils/config.py \
+ Lib/distutils/core.py \
+ Lib/distutils/cygwinccompiler.py \
+ Lib/distutils/debug.py \
+ Lib/distutils/dep_util.py \
+ Lib/distutils/dir_util.py \
+ Lib/distutils/dist.py \
+ Lib/distutils/emxccompiler.py \
+ Lib/distutils/errors.py \
+ Lib/distutils/extension.py \
+ Lib/distutils/fancy_getopt.py \
+ Lib/distutils/filelist.py \
+ Lib/distutils/file_util.py \
+ Lib/distutils/log.py \
+ Lib/distutils/msvc9compiler.py \
+ Lib/distutils/msvccompiler.py \
+ Lib/distutils/spawn.py \
+ Lib/distutils/sysconfig.py \
+ Lib/distutils/text_file.py \
+ Lib/distutils/unixccompiler.py \
+ Lib/distutils/util.py \
+ Lib/distutils/versionpredicate.py \
+ Lib/distutils/version.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/distutils/command,\
+ Lib/distutils/command/__init__.py \
+ Lib/distutils/command/bdist_dumb.py \
+ Lib/distutils/command/bdist_msi.py \
+ Lib/distutils/command/bdist.py \
+ Lib/distutils/command/bdist_rpm.py \
+ Lib/distutils/command/bdist_wininst.py \
+ Lib/distutils/command/build_clib.py \
+ Lib/distutils/command/build_ext.py \
+ Lib/distutils/command/build.py \
+ Lib/distutils/command/build_py.py \
+ Lib/distutils/command/build_scripts.py \
+ Lib/distutils/command/check.py \
+ Lib/distutils/command/clean.py \
+ Lib/distutils/command/config.py \
+ Lib/distutils/command/install_data.py \
+ Lib/distutils/command/install_egg_info.py \
+ Lib/distutils/command/install_headers.py \
+ Lib/distutils/command/install_lib.py \
+ Lib/distutils/command/install.py \
+ Lib/distutils/command/install_scripts.py \
+ Lib/distutils/command/register.py \
+ Lib/distutils/command/sdist.py \
+ Lib/distutils/command/upload.py \
+ Lib/distutils/command/wininst-10.0-amd64.exe \
+ Lib/distutils/command/wininst-10.0.exe \
+ Lib/distutils/command/wininst-6.0.exe \
+ Lib/distutils/command/wininst-7.1.exe \
+ Lib/distutils/command/wininst-8.0.exe \
+ Lib/distutils/command/wininst-9.0-amd64.exe \
+ Lib/distutils/command/wininst-9.0.exe \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email,\
+ Lib/email/__init__.py \
+ Lib/email/_encoded_words.py \
+ Lib/email/_header_value_parser.py \
+ Lib/email/_parseaddr.py \
+ Lib/email/_policybase.py \
+ Lib/email/architecture.rst \
+ Lib/email/base64mime.py \
+ Lib/email/charset.py \
+ Lib/email/encoders.py \
+ Lib/email/errors.py \
+ Lib/email/feedparser.py \
+ Lib/email/generator.py \
+ Lib/email/header.py \
+ Lib/email/headerregistry.py \
+ Lib/email/iterators.py \
+ Lib/email/message.py \
+ Lib/email/parser.py \
+ Lib/email/policy.py \
+ Lib/email/quoprimime.py \
+ Lib/email/utils.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email/mime,\
+ Lib/email/mime/__init__.py \
+ Lib/email/mime/application.py \
+ Lib/email/mime/audio.py \
+ Lib/email/mime/base.py \
+ Lib/email/mime/image.py \
+ Lib/email/mime/message.py \
+ Lib/email/mime/multipart.py \
+ Lib/email/mime/nonmultipart.py \
+ Lib/email/mime/text.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/encodings,\
+ Lib/encodings/__init__.py \
+ Lib/encodings/aliases.py \
+ Lib/encodings/ascii.py \
+ Lib/encodings/base64_codec.py \
+ Lib/encodings/big5hkscs.py \
+ Lib/encodings/big5.py \
+ Lib/encodings/bz2_codec.py \
+ Lib/encodings/charmap.py \
+ Lib/encodings/cp037.py \
+ Lib/encodings/cp1006.py \
+ Lib/encodings/cp1026.py \
+ Lib/encodings/cp1140.py \
+ Lib/encodings/cp1250.py \
+ Lib/encodings/cp1251.py \
+ Lib/encodings/cp1252.py \
+ Lib/encodings/cp1253.py \
+ Lib/encodings/cp1254.py \
+ Lib/encodings/cp1255.py \
+ Lib/encodings/cp1256.py \
+ Lib/encodings/cp1257.py \
+ Lib/encodings/cp1258.py \
+ Lib/encodings/cp424.py \
+ Lib/encodings/cp437.py \
+ Lib/encodings/cp500.py \
+ Lib/encodings/cp65001.py \
+ Lib/encodings/cp720.py \
+ Lib/encodings/cp737.py \
+ Lib/encodings/cp775.py \
+ Lib/encodings/cp850.py \
+ Lib/encodings/cp852.py \
+ Lib/encodings/cp855.py \
+ Lib/encodings/cp856.py \
+ Lib/encodings/cp857.py \
+ Lib/encodings/cp858.py \
+ Lib/encodings/cp860.py \
+ Lib/encodings/cp861.py \
+ Lib/encodings/cp862.py \
+ Lib/encodings/cp863.py \
+ Lib/encodings/cp864.py \
+ Lib/encodings/cp865.py \
+ Lib/encodings/cp866.py \
+ Lib/encodings/cp869.py \
+ Lib/encodings/cp874.py \
+ Lib/encodings/cp875.py \
+ Lib/encodings/cp932.py \
+ Lib/encodings/cp949.py \
+ Lib/encodings/cp950.py \
+ Lib/encodings/euc_jis_2004.py \
+ Lib/encodings/euc_jisx0213.py \
+ Lib/encodings/euc_jp.py \
+ Lib/encodings/euc_kr.py \
+ Lib/encodings/gb18030.py \
+ Lib/encodings/gb2312.py \
+ Lib/encodings/gbk.py \
+ Lib/encodings/hex_codec.py \
+ Lib/encodings/hp_roman8.py \
+ Lib/encodings/hz.py \
+ Lib/encodings/idna.py \
+ Lib/encodings/iso2022_jp_1.py \
+ Lib/encodings/iso2022_jp_2004.py \
+ Lib/encodings/iso2022_jp_2.py \
+ Lib/encodings/iso2022_jp_3.py \
+ Lib/encodings/iso2022_jp_ext.py \
+ Lib/encodings/iso2022_jp.py \
+ Lib/encodings/iso2022_kr.py \
+ Lib/encodings/iso8859_10.py \
+ Lib/encodings/iso8859_11.py \
+ Lib/encodings/iso8859_13.py \
+ Lib/encodings/iso8859_14.py \
+ Lib/encodings/iso8859_15.py \
+ Lib/encodings/iso8859_16.py \
+ Lib/encodings/iso8859_1.py \
+ Lib/encodings/iso8859_2.py \
+ Lib/encodings/iso8859_3.py \
+ Lib/encodings/iso8859_4.py \
+ Lib/encodings/iso8859_5.py \
+ Lib/encodings/iso8859_6.py \
+ Lib/encodings/iso8859_7.py \
+ Lib/encodings/iso8859_8.py \
+ Lib/encodings/iso8859_9.py \
+ Lib/encodings/johab.py \
+ Lib/encodings/koi8_r.py \
+ Lib/encodings/koi8_u.py \
+ Lib/encodings/latin_1.py \
+ Lib/encodings/mac_arabic.py \
+ Lib/encodings/mac_centeuro.py \
+ Lib/encodings/mac_croatian.py \
+ Lib/encodings/mac_cyrillic.py \
+ Lib/encodings/mac_farsi.py \
+ Lib/encodings/mac_greek.py \
+ Lib/encodings/mac_iceland.py \
+ Lib/encodings/mac_latin2.py \
+ Lib/encodings/mac_romanian.py \
+ Lib/encodings/mac_roman.py \
+ Lib/encodings/mac_turkish.py \
+ Lib/encodings/mbcs.py \
+ Lib/encodings/palmos.py \
+ Lib/encodings/ptcp154.py \
+ Lib/encodings/punycode.py \
+ Lib/encodings/quopri_codec.py \
+ Lib/encodings/raw_unicode_escape.py \
+ Lib/encodings/rot_13.py \
+ Lib/encodings/shift_jis_2004.py \
+ Lib/encodings/shift_jis.py \
+ Lib/encodings/shift_jisx0213.py \
+ Lib/encodings/tis_620.py \
+ Lib/encodings/undefined.py \
+ Lib/encodings/unicode_escape.py \
+ Lib/encodings/unicode_internal.py \
+ Lib/encodings/utf_16_be.py \
+ Lib/encodings/utf_16_le.py \
+ Lib/encodings/utf_16.py \
+ Lib/encodings/utf_32_be.py \
+ Lib/encodings/utf_32_le.py \
+ Lib/encodings/utf_32.py \
+ Lib/encodings/utf_7.py \
+ Lib/encodings/utf_8.py \
+ Lib/encodings/utf_8_sig.py \
+ Lib/encodings/uu_codec.py \
+ Lib/encodings/zlib_codec.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/html,\
+ Lib/html/__init__.py \
+ Lib/html/entities.py \
+ Lib/html/parser.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/http,\
+ Lib/http/__init__.py \
+ Lib/http/client.py \
+ Lib/http/cookiejar.py \
+ Lib/http/cookies.py \
+ Lib/http/server.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/importlib,\
+ Lib/importlib/__init__.py \
+ Lib/importlib/_bootstrap.py \
+ Lib/importlib/abc.py \
+ Lib/importlib/machinery.py \
+ Lib/importlib/util.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/json,\
+ Lib/json/__init__.py \
+ Lib/json/decoder.py \
+ Lib/json/encoder.py \
+ Lib/json/scanner.py \
+ Lib/json/tool.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib2to3,\
+ Lib/lib2to3/Grammar.txt \
+ Lib/lib2to3/PatternGrammar.txt \
+ Lib/lib2to3/__init__.py \
+ Lib/lib2to3/__main__.py \
+ Lib/lib2to3/btm_matcher.py \
+ Lib/lib2to3/btm_utils.py \
+ Lib/lib2to3/fixer_base.py \
+ Lib/lib2to3/fixer_util.py \
+ Lib/lib2to3/main.py \
+ Lib/lib2to3/patcomp.py \
+ Lib/lib2to3/pygram.py \
+ Lib/lib2to3/pytree.py \
+ Lib/lib2to3/refactor.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib2to3/fixes,\
+ Lib/lib2to3/fixes/__init__.py \
+ Lib/lib2to3/fixes/fix_apply.py \
+ Lib/lib2to3/fixes/fix_basestring.py \
+ Lib/lib2to3/fixes/fix_buffer.py \
+ Lib/lib2to3/fixes/fix_callable.py \
+ Lib/lib2to3/fixes/fix_dict.py \
+ Lib/lib2to3/fixes/fix_except.py \
+ Lib/lib2to3/fixes/fix_execfile.py \
+ Lib/lib2to3/fixes/fix_exec.py \
+ Lib/lib2to3/fixes/fix_exitfunc.py \
+ Lib/lib2to3/fixes/fix_filter.py \
+ Lib/lib2to3/fixes/fix_funcattrs.py \
+ Lib/lib2to3/fixes/fix_future.py \
+ Lib/lib2to3/fixes/fix_getcwdu.py \
+ Lib/lib2to3/fixes/fix_has_key.py \
+ Lib/lib2to3/fixes/fix_idioms.py \
+ Lib/lib2to3/fixes/fix_import.py \
+ Lib/lib2to3/fixes/fix_imports2.py \
+ Lib/lib2to3/fixes/fix_imports.py \
+ Lib/lib2to3/fixes/fix_input.py \
+ Lib/lib2to3/fixes/fix_intern.py \
+ Lib/lib2to3/fixes/fix_isinstance.py \
+ Lib/lib2to3/fixes/fix_itertools_imports.py \
+ Lib/lib2to3/fixes/fix_itertools.py \
+ Lib/lib2to3/fixes/fix_long.py \
+ Lib/lib2to3/fixes/fix_map.py \
+ Lib/lib2to3/fixes/fix_metaclass.py \
+ Lib/lib2to3/fixes/fix_methodattrs.py \
+ Lib/lib2to3/fixes/fix_ne.py \
+ Lib/lib2to3/fixes/fix_next.py \
+ Lib/lib2to3/fixes/fix_nonzero.py \
+ Lib/lib2to3/fixes/fix_numliterals.py \
+ Lib/lib2to3/fixes/fix_operator.py \
+ Lib/lib2to3/fixes/fix_paren.py \
+ Lib/lib2to3/fixes/fix_print.py \
+ Lib/lib2to3/fixes/fix_raise.py \
+ Lib/lib2to3/fixes/fix_raw_input.py \
+ Lib/lib2to3/fixes/fix_reduce.py \
+ Lib/lib2to3/fixes/fix_renames.py \
+ Lib/lib2to3/fixes/fix_repr.py \
+ Lib/lib2to3/fixes/fix_set_literal.py \
+ Lib/lib2to3/fixes/fix_standarderror.py \
+ Lib/lib2to3/fixes/fix_sys_exc.py \
+ Lib/lib2to3/fixes/fix_throw.py \
+ Lib/lib2to3/fixes/fix_tuple_params.py \
+ Lib/lib2to3/fixes/fix_types.py \
+ Lib/lib2to3/fixes/fix_unicode.py \
+ Lib/lib2to3/fixes/fix_urllib.py \
+ Lib/lib2to3/fixes/fix_ws_comma.py \
+ Lib/lib2to3/fixes/fix_xrange.py \
+ Lib/lib2to3/fixes/fix_xreadlines.py \
+ Lib/lib2to3/fixes/fix_zip.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/pgen2,\
+ Lib/lib2to3/pgen2/__init__.py \
+ Lib/lib2to3/pgen2/conv.py \
+ Lib/lib2to3/pgen2/driver.py \
+ Lib/lib2to3/pgen2/grammar.py \
+ Lib/lib2to3/pgen2/literals.py \
+ Lib/lib2to3/pgen2/parse.py \
+ Lib/lib2to3/pgen2/pgen.py \
+ Lib/lib2to3/pgen2/tokenize.py \
+ Lib/lib2to3/pgen2/token.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/logging,\
+ Lib/logging/__init__.py \
+ Lib/logging/config.py \
+ Lib/logging/handlers.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/multiprocessing,\
+ Lib/multiprocessing/__init__.py \
+ Lib/multiprocessing/connection.py \
+ Lib/multiprocessing/forking.py \
+ Lib/multiprocessing/heap.py \
+ Lib/multiprocessing/managers.py \
+ Lib/multiprocessing/pool.py \
+ Lib/multiprocessing/process.py \
+ Lib/multiprocessing/queues.py \
+ Lib/multiprocessing/reduction.py \
+ Lib/multiprocessing/sharedctypes.py \
+ Lib/multiprocessing/synchronize.py \
+ Lib/multiprocessing/util.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/multiprocessing/dummy,\
+ Lib/multiprocessing/dummy/__init__.py \
+ Lib/multiprocessing/dummy/connection.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/pydoc_data,\
+ Lib/pydoc_data/__init__.py \
+ Lib/pydoc_data/_pydoc.css \
+ Lib/pydoc_data/topics.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest,\
+ Lib/unittest/__init__.py \
+ Lib/unittest/__main__.py \
+ Lib/unittest/case.py \
+ Lib/unittest/loader.py \
+ Lib/unittest/main.py \
+ Lib/unittest/mock.py \
+ Lib/unittest/result.py \
+ Lib/unittest/runner.py \
+ Lib/unittest/signals.py \
+ Lib/unittest/suite.py \
+ Lib/unittest/util.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest/test,\
+ Lib/unittest/test/__init__.py \
+ Lib/unittest/test/dummy.py \
+ Lib/unittest/test/support.py \
+ Lib/unittest/test/test_assertions.py \
+ Lib/unittest/test/test_break.py \
+ Lib/unittest/test/test_case.py \
+ Lib/unittest/test/test_discovery.py \
+ Lib/unittest/test/test_functiontestcase.py \
+ Lib/unittest/test/test_loader.py \
+ Lib/unittest/test/test_program.py \
+ Lib/unittest/test/test_result.py \
+ Lib/unittest/test/test_runner.py \
+ Lib/unittest/test/test_setups.py \
+ Lib/unittest/test/test_skipping.py \
+ Lib/unittest/test/test_suite.py \
+ Lib/unittest/test/_test_warnings.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest/test/testmock,\
+ Lib/unittest/test/testmock/__init__.py \
+ Lib/unittest/test/testmock/support.py \
+ Lib/unittest/test/testmock/testcallable.py \
+ Lib/unittest/test/testmock/testhelpers.py \
+ Lib/unittest/test/testmock/testmagicmethods.py \
+ Lib/unittest/test/testmock/testmock.py \
+ Lib/unittest/test/testmock/testpatch.py \
+ Lib/unittest/test/testmock/testsentinel.py \
+ Lib/unittest/test/testmock/testwith.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/urllib,\
+ Lib/urllib/__init__.py \
+ Lib/urllib/error.py \
+ Lib/urllib/parse.py \
+ Lib/urllib/request.py \
+ Lib/urllib/response.py \
+ Lib/urllib/robotparser.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/wsgiref,\
+ Lib/wsgiref/__init__.py \
+ Lib/wsgiref/handlers.py \
+ Lib/wsgiref/headers.py \
+ Lib/wsgiref/simple_server.py \
+ Lib/wsgiref/util.py \
+ Lib/wsgiref/validate.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml,\
+ Lib/xml/__init__.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/dom,\
+ Lib/xml/dom/__init__.py \
+ Lib/xml/dom/NodeFilter.py \
+ Lib/xml/dom/domreg.py \
+ Lib/xml/dom/expatbuilder.py \
+ Lib/xml/dom/minicompat.py \
+ Lib/xml/dom/minidom.py \
+ Lib/xml/dom/pulldom.py \
+ Lib/xml/dom/xmlbuilder.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/etree,\
+ Lib/xml/etree/__init__.py \
+ Lib/xml/etree/ElementInclude.py \
+ Lib/xml/etree/ElementPath.py \
+ Lib/xml/etree/ElementTree.py \
+ Lib/xml/etree/cElementTree.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/parsers,\
+ Lib/xml/parsers/__init__.py \
+ Lib/xml/parsers/expat.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/sax,\
+ Lib/xml/sax/__init__.py \
+ Lib/xml/sax/_exceptions.py \
+ Lib/xml/sax/expatreader.py \
+ Lib/xml/sax/handler.py \
+ Lib/xml/sax/saxutils.py \
+ Lib/xml/sax/xmlreader.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xmlrpc,\
+ Lib/xmlrpc/__init__.py \
+ Lib/xmlrpc/client.py \
+ Lib/xmlrpc/server.py \
+))
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/site-packages,\
+ Lib/site-packages/README \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,python3))
+
+$(eval $(call gb_ExternalProject_use_externals,python3,\
+ expat \
+ openssl \
+ zlib \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,python3,\
+ build \
+ $(if $(filter MACOSX,$(OS)),\
+ fixscripts \
+ fixinstallnames \
+ executables \
+ ) \
+))
+
+ifeq ($(OS)$(COM),WNTMSC)
+
+# TODO: using Debug configuration and related mangling of pyconfig.h
+
+# at least for MSVC 2008 it is necessary to clear MAKEFLAGS because
+# nmake is invoked
+$(call gb_ExternalProject_get_state_target,python3,build) :
+ $(call gb_ExternalProject_run,build,\
+ MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
+ $(if $(filter 100,$(VCVER)), \
+ /ToolsVersion:4.0, \
+ /p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) \
+ /p:VisualStudioVersion=11.0) \
+ && cd $(EXTERNAL_WORKDIR) \
+ && ln -s PCbuild LO_lib \
+ ,PCBuild)
+
+else
+
+# this was added in 2004, hopefully is obsolete now (and why only intel anyway)? $(if $(filter SOLARIS-INTEL,$(OS)$(CPUNAME)),--disable-ipv6)
+
+# --with-system-expat: this should find the one in the solver (or system)
+
+# create a symlink "LO_lib" because the .so are in a directory with platform
+# specific name like build/lib.linux-x86_64-3.3
+
+python3_cflags = $(ZLIB_CFLAGS)
+ifneq (,$(ENABLE_VALGRIND))
+ python3_cflags += $(VALGRIND_CFLAGS)
+endif
+
+$(call gb_ExternalProject_get_state_target,python3,build) :
+ $(call gb_ExternalProject_run,build,\
+ ./configure \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(ENABLE_VALGRIND),--with-valgrind) \
+ --prefix=/python-inst \
+ $(if $(filter MACOSX,$(OS)),,--with-system-expat) \
+ $(if $(filter AIX,$(OS)), \
+ --disable-ipv6 --with-threads OPT="-g0 -fwrapv -O3 -Wall", \
+ $(if $(gb_Module_CURRENTMODULE_DEBUG_ENABLED), \
+ OPT="$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS)")) \
+ $(if $(filter WNT-GCC,$(OS)-$(COM)),--with-threads ac_cv_printf_zd_format=no) \
+ $(if $(filter MACOSX,$(OS)), \
+ $(if $(filter INTEL POWERPC,$(CPUNAME)),--enable-universalsdk=$(MACOSX_SDK_PATH) --with-universal-archs=32-bit) --enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \
+ --enable-shared \
+ ) \
+ CC="$(strip $(CC) \
+ $(if $(SYSTEM_OPENSSL),,-I$(call gb_UnpackedTarball_get_dir,openssl)/include \
+ $(if $(DISABLE_OPENSSL),,-I$(call gb_UnpackedTarball_get_dir,openssl)/include)) \
+ $(if $(SYSTEM_EXPAT),,-I$(call gb_UnpackedTarball_get_dir,expat)/lib) \
+ $(if $(SYSBASE), -I$(SYSBASE)/usr/include) \
+ )" \
+ $(if $(python3_cflags),CFLAGS='$(python3_cflags)') \
+ LDFLAGS="$(strip $(LDFLAGS) \
+ $(if $(SYSTEM_OPENSSL),,-L$(call gb_UnpackedTarball_get_dir,openssl)) \
+ $(if $(SYSTEM_EXPAT),,-L$(gb_StaticLibrary_WORKDIR)) \
+ $(if $(SYSBASE), -L$(SYSBASE)/usr/lib) \
+ $(if $(filter WNT-GCC,$(OS)-$(COM)), -shared-libgcc \
+ $(if $(MINGW_SHARED_GCCLIB),-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 -Wl$(COMMA)--export-all-symbols)) \
+ $(gb_LTOFLAGS) \
+ )" \
+ && MAKEFLAGS= $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),DESTDIR=$(EXTERNAL_WORKDIR)/python-inst install) \
+ && ln -s build/lib.* LO_lib \
+ )
+
+endif
+
+ifeq ($(OS),MACOSX)
+
+python3_fw_prefix=$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO/LibreOfficePython.framework
+
+# rule to allow relocating the whole framework, removing reference to buildinstallation directory
+$(call gb_ExternalProject_get_state_target,python3,fixscripts) : $(call gb_ExternalProject_get_state_target,python3,build)
+ $(call gb_Output_announce,python3 - remove reference to installroot from scripts,build,CUS,5)
+ $(COMMAND_ECHO)for file in \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3 \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/idle$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m-config \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pyvenv-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) ; do \
+ { rm "$$file" && $(gb_AWK) '\
+ BEGIN {print "#!/bin/bash\n\
+origpath=$$(pwd)\n\
+bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\
+cd \"$$origpath\"\n\
+\"$$bindir/../Resources/Python.app/Contents/MacOS/LibreOfficePython\" - $$@ <<EOF"} \
+ FNR==1{next} \
+ {print} \
+ END {print "EOF"}' > "$$file" ; } < "$$file" ; chmod +x "$$file" ; done
+ touch $@
+
+$(call gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_ExternalProject_get_state_target,python3,build)
+ $(INSTALL_NAME_TOOL) -change \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \
+ @executable_path/../../../../LibreOfficePython \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython
+ touch $@
+
+# also delete binaries that are symlinked in scp2
+$(call gb_ExternalProject_get_state_target,python3,executables) : $(call gb_ExternalProject_get_state_target,python3,build)
+ cd $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin ; \
+ for file in python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
+ python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \
+ pythonw$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) ; do \
+ $(INSTALL_NAME_TOOL) -change \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \
+ @executable_path/../LibreOfficePython $$file ; done
+ touch $@
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_GeneratedPackage_GeneratedPackage,python3,$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@__________________________________________________OOO))
+
+$(eval $(call gb_GeneratedPackage_use_unpacked,python3,python3))
+
+$(eval $(call gb_GeneratedPackage_use_external_project,python3,python3))
+
+$(eval $(call gb_GeneratedPackage_add_dir,python3,$(INSTROOT)/$(if $(ENABLE_MACOSX_MACLIKE_APP_STRUCTURE),Frameworks,$(LIBO_BIN_FOLDER))/LibreOfficePython.framework,LibreOfficePython.framework))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,python3))
+
+ifneq ($(DISABLE_PYTHON),TRUE)
+ifeq ($(SYSTEM_PYTHON),)
+
+$(eval $(call gb_Module_add_targets,python3,\
+ UnpackedTarball_python3 \
+ ExternalProject_python3 \
+ $(if $(filter MACOSX,$(OS)),GeneratedPackage_python3,ExternalPackage_python3) \
+))
+
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+CPython implementation of Python 3 from http://www.python.org
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,python3))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,python3,$(PYTHON_TARBALL),,python3))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\
+ PCbuild/pcbuild.sln \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,python3,\
+ external/python3/i100492-freebsd.patch.1 \
+ external/python3/python-3.3.0-i42553.patch.2 \
+ external/python3/python-3.3.3-aix.patch.1 \
+ external/python3/python-3.3.0-darwin.patch.1 \
+ external/python3/python-3.3.0-msvc2012.patch.1 \
+ external/python3/python-3.3.0-msvc-disable.patch.1 \
+ external/python3/python-3.3.0-msvc-x64.patch.1 \
+ external/python3/python-3.3.0-ssl.patch.1 \
+ external/python3/python-3.3.0-gcc-4.8.patch.1 \
+ external/python3/python-3.3.0-pythreadstate.patch.1 \
+ external/python3/python-3.3.0-clang.patch.1 \
+ external/python3/python-3.3.3-py17797.patch.1 \
+ external/python3/python-3.3.3-msvc2012-winxp.patch.1 \
+ external/python3/python-3.3.5-pyexpat-symbols.patch.1 \
+))
+
+ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
+$(eval $(call gb_UnpackedTarball_add_patches,python3,\
+ external/python3/python-3.3.3-elf-rpath.patch.1 \
+))
+endif
+
+ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,python3,\
+ external/python3/python-3.3.3-disable-obmalloc.patch.0 \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+FreeBSD porting fixes, patch by maho@openoffice.org
+
+--- Python-3.3.0/configure 2012-11-28 09:00:41.094955090 +0000
++++ Python-3.3.0/configure 2012-11-28 09:01:13.033329526 +0000
+@@ -5545,11 +5545,6 @@
+ LDLIBRARY='libpython$(LDVERSION).so'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+- case $ac_sys_system in
+- FreeBSD*)
+- SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
+- ;;
+- esac
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ if test "$with_pydebug" != yes
+ then
+--- Python-3.3.0/Lib/test/test_threading.py 2012-11-28 09:00:41.292957412 +0000
++++ Python-3.3.0/Lib/test/test_threading.py 2012-11-28 09:01:13.017329339 +0000
+@@ -451,7 +451,7 @@
+ # #12316 and #11870), and fork() from a worker thread is known to trigger
+ # problems with some operating systems (issue #3863): skip problematic tests
+ # on platforms known to behave badly.
+- platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
++ platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'netbsd5',
+ 'os2emx', 'hp-ux11')
+
+ def _run_and_join(self, script):
+--- Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:00:41.097955124 +0000
++++ Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:01:13.018329351 +0000
+@@ -42,6 +42,10 @@
+ #endif
+ #endif
+
++#ifdef __FreeBSD__
++#include <osreldate.h>
++#endif
++
+ /* The POSIX spec says that implementations supporting the sem_*
+ family of functions must indicate this by defining
+ _POSIX_SEMAPHORES. */
+@@ -60,7 +64,6 @@
+ in default setting. So the process scope is preferred to get
+ enough number of threads to work. */
+ #ifdef __FreeBSD__
+-#include <osreldate.h>
+ #if __FreeBSD_version >= 500000 && __FreeBSD_version < 504101
+ #undef PTHREAD_SYSTEM_SCHED_SUPPORTED
+ #endif
+@@ -186,6 +189,9 @@
+ {
+ pthread_t th;
+ int status;
++#ifdef __FreeBSD__
++ sigset_t set, oset;
++#endif
+ #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ pthread_attr_t attrs;
+ #endif
+@@ -214,7 +220,10 @@
+ #if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
+ #endif
+-
++#ifdef __FreeBSD__
++ sigfillset(&set);
++ SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset);
++#endif
+ status = pthread_create(&th,
+ #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ &attrs,
+@@ -225,6 +234,9 @@
+ (void *)arg
+ );
+
++#ifdef __FreeBSD__
++ SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
++#endif
+ #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ pthread_attr_destroy(&attrs);
+ #endif
--- /dev/null
+-*- Mode: diff -*-
+
+--- python3/setup.py
++++ python3/setup.py
+@@ -436,7 +436,7 @@
+ if ret >> 8 == 0:
+ with open(tmpfile) as fp:
+ for line in fp.readlines():
+- if line.startswith("gcc version"):
++ if line.startswith("gcc version") or line.startswith("clang -cc1 version"):
+ is_gcc = True
+ elif line.startswith("#include <...>"):
+ in_incdirs = True
--- /dev/null
+-*- Mode: diff -*-
+
+LO needs to build both against MacOSX SDK and not produce universal binaries.
+
+diff -ru python3.old_/configure python3/configure
+--- python3.old_/configure 2012-09-29 10:00:50.000000000 +0200
++++ python3/configure 2012-11-13 16:37:26.030013256 +0100
+@@ -6353,7 +6353,19 @@
+ if test "${enable_universalsdk}"; then
+ UNIVERSAL_ARCH_FLAGS=""
+ if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
+- UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
++ # LO does not use Universal Binaries (but the only way to set a SDK
++ # here implies that, so de-universalize here...)
++ case `/usr/bin/arch` in
++ i386)
++ UNIVERSAL_ARCH_FLAGS="-arch i386"
++ ;;
++ ppc)
++ UNIVERSAL_ARCH_FLAGS="-arch ppc"
++ ;;
++ *)
++ as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
++ ;;
++ esac
+ ARCH_RUN_32BIT=""
+ LIPO_32BIT_FLAGS=""
+ elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
+
+On OS X avoid /usr/local/lib and include like the plague, we don't
+want to accidentally get some MacPorts etc stuff.
+
+On OS X, always run the compiler (which is Clang, not gcc) to find out
+what the include paths are. On a clean modern installation, there is
+no /usr/include.
+
+--- python3/setup.py
++++ python3/setup.py
+@@ -460,11 +460,11 @@
+ # Ensure that /usr/local is always used, but the local build
+ # directories (i.e. '.' and 'Include') must be first. See issue
+ # 10520.
+- if not cross_compiling:
++ if not cross_compiling and host_platform != 'darwin':
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ # only change this for cross builds for 3.3, issues on Mageia
+- if cross_compiling:
++ if cross_compiling or host_platform == 'darwin':
+ self.add_gcc_paths()
+ self.add_multiarch_paths()
+
+--- python3/Mac/Makefile.in.orig 2013-09-13 20:16:50.558137603 +0200
++++ python3/Mac/Makefile.in 2013-09-13 21:57:14.790962423 +0200
+@@ -39,7 +39,7 @@
+ INSTALL_SCRIPT= @INSTALL_SCRIPT@
+ INSTALL_DATA=@INSTALL_DATA@
+ LN=@LN@
+-STRIPFLAG=-s
++STRIPFLAG=
+ CPMAC=CpMac
+
+ APPTEMPLATE=$(srcdir)/Resources/app
--- /dev/null
+--- Python-3.3.0/Include/modsupport.h 2012-09-29 10:00:26.000000000 +0200
++++ Python-3.3.0/Include/modsupport.h 2013-03-08 10:46:28.671938738 +0100
+@@ -26,7 +26,11 @@
+ /* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */
+ #if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
+ PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
+-PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
++PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...)
++#ifdef PY_SSIZE_T_CLEAN
++ Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3)
++#endif
++ ;
+ PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
+ const char *, char **, ...);
+ PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *);
--- /dev/null
+definition of gethostbyname conflicts with system /usr/include/unistd.h,
+available since at least Solaris 2.6 according to python-Bugs-837046
+Author: taniguchi@openoffice.org
+
+--- misc/Python-2.6.1/Include/pyport.h 2008-06-11 09:41:16.000000000 +0200
++++ misc/build/Python-2.6.1/Include/pyport.h 2011-06-06 17:31:17.000000000 +0200
+@@ -449,11 +449,6 @@
+ in platform-specific #ifdefs.
+ **************************************************************************/
+
+-#ifdef SOLARIS
+-/* Unchecked */
+-extern int gethostname(char *, int);
+-#endif
+-
+ #ifdef HAVE__GETPTY
+ #include <sys/types.h> /* we need to import mode_t */
+ extern char * _getpty(int *, int, mode_t, int);
--- /dev/null
+Disable some stuff LO does not need, especially stuff with external dependencies
+
+diff -ru python3/PCbuild/pcbuild.sln python3.new/PCbuild/pcbuild.sln
+--- python3/PCbuild/pcbuild.sln 2012-09-29 10:00:48.000000000 +0200
++++ python3.new/PCbuild/pcbuild.sln 2012-11-12 22:13:49.445159668 +0100
+@@ -12,10 +12,6 @@
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"
+ EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcxproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}"
+-EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcxproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}"
+-EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_buildinfo", "make_buildinfo.vcxproj", "{C73F0EC1-358B-4177-940F-0846AC8B04CD}"
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}"
+@@ -32,30 +28,16 @@
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}"
+ EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcxproj", "{13CECB97-4119-4316-9D42-8534019A5A44}"
+-EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}"
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"
+ EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"
+-EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bz2", "_bz2.vcxproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}"
+-EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcxproj", "{18CAE28C-B454-46C1-87A0-493D91D97F03}"
+ EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_lzma", "_lzma.vcxproj", "{F9D71780-F393-11E0-BE50-0800200C9A66}"
+-EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicodedata", "unicodedata.vcxproj", "{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}"
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcxproj", "{D06B6426-4762-44CC-8BAD-D79052507F2F}"
+ EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdist_wininst", "bdist_wininst.vcxproj", "{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}"
+-EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcxproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}"
+-EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}"
+-EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}"
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl", "ssl.vcxproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"
--- /dev/null
+Fix Python build for x64 Windows
+
+diff -ru python3/PCbuild/pcbuild.sln python3.new/PCbuild/pcbuild.sln
+--- python3/PCbuild/pcbuild.sln 2012-09-29 10:00:48.000000000 +0200
++++ python3.new/PCbuild/pcbuild.sln 2012-11-12 22:13:49.445159668 +0100
+@@ -104,20 +84,20 @@
+ {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release|x64.Build.0 = Release|x64
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|Win32.Build.0 = Debug|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.ActiveCfg = Debug|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.Build.0 = Debug|Win32
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.ActiveCfg = Debug|x64
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug|x64.Build.0 = Debug|x64
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|Win32.ActiveCfg = Release|Win32
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|Win32.Build.0 = Release|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|x64.ActiveCfg = Release|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|x64.Build.0 = Release|Win32
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|x64.ActiveCfg = Release|x64
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGInstrument|x64.Build.0 = Release|x64
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|Win32.ActiveCfg = Release|Win32
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|Win32.Build.0 = Release|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|x64.ActiveCfg = Release|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|x64.Build.0 = Release|Win32
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|x64.ActiveCfg = Release|x64
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.PGUpdate|x64.Build.0 = Release|x64
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|Win32.ActiveCfg = Release|Win32
+ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|Win32.Build.0 = Release|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.ActiveCfg = Release|Win32
+- {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.Build.0 = Release|Win32
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.ActiveCfg = Release|x64
++ {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release|x64.Build.0 = Release|x64
+ {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|Win32.Build.0 = Debug|Win32
+ {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug|x64.ActiveCfg = Debug|x64
+@@ -168,20 +148,20 @@
+ {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.Build.0 = Release|x64
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.ActiveCfg = Release|Win32
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.Build.0 = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.ActiveCfg = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.Build.0 = Release|Win32
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.ActiveCfg = Release|x64
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.Build.0 = Release|x64
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|Win32.ActiveCfg = Release|Win32
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|Win32.Build.0 = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.ActiveCfg = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.Build.0 = Release|Win32
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.ActiveCfg = Release|x64
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.Build.0 = Release|x64
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|Win32.ActiveCfg = Release|Win32
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|Win32.Build.0 = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.ActiveCfg = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.Build.0 = Release|Win32
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.ActiveCfg = Release|x64
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.Build.0 = Release|x64
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.ActiveCfg = Release|Win32
+ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.Build.0 = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.ActiveCfg = Release|Win32
+- {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.Build.0 = Release|Win32
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.ActiveCfg = Release|x64
++ {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.Build.0 = Release|x64
+ {28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|Win32.ActiveCfg = Debug|Win32
+ {28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|Win32.Build.0 = Debug|Win32
+ {28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|x64.ActiveCfg = Debug|x64
+@@ -577,38 +557,38 @@
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Debug|x64.Build.0 = Debug|x64
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+- {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGInstrument|x64.ActiveCfg = PGInstrument|Win32
+- {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGInstrument|x64.Build.0 = PGInstrument|Win32
++ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
++ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+- {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGUpdate|x64.ActiveCfg = PGUpdate|Win32
+- {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGUpdate|x64.Build.0 = PGUpdate|Win32
++ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
++ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.PGUpdate|x64.Build.0 = PGUpdate|x64
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Release|Win32.ActiveCfg = Release|Win32
+ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Release|Win32.Build.0 = Release|Win32
+- {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Release|x64.ActiveCfg = Release|Win32
+- {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Release|x64.Build.0 = Release|Win32
++ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Release|x64.ActiveCfg = Release|x64
++ {7B2727B5-5A3F-40EE-A866-43A13CD31446}.Release|x64.Build.0 = Release|x64
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Debug|Win32.Build.0 = Debug|Win32
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Debug|x64.ActiveCfg = Debug|x64
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Debug|x64.Build.0 = Debug|x64
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+- {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGInstrument|x64.ActiveCfg = PGInstrument|Win32
+- {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGInstrument|x64.Build.0 = PGInstrument|Win32
++ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
++ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+- {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGUpdate|x64.ActiveCfg = PGUpdate|Win32
+- {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGUpdate|x64.Build.0 = PGUpdate|Win32
++ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
++ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.PGUpdate|x64.Build.0 = PGUpdate|x64
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Release|Win32.ActiveCfg = Release|Win32
+ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Release|Win32.Build.0 = Release|Win32
+- {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Release|x64.ActiveCfg = Release|Win32
+- {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Release|x64.Build.0 = Release|Win32
++ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Release|x64.ActiveCfg = Release|x64
++ {1D4B18D3-7C12-4ECB-9179-8531FF876CE6}.Release|x64.Build.0 = Release|x64
+ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Debug|x64.ActiveCfg = Debug|x64
+ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|Win32.ActiveCfg = Release|Win32
+- {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|x64.ActiveCfg = Release|Win32
++ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGInstrument|x64.ActiveCfg = Release|x64
+ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|Win32.ActiveCfg = Release|Win32
+- {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|x64.ActiveCfg = Release|Win32
++ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.PGUpdate|x64.ActiveCfg = Release|x64
+ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|Win32.ActiveCfg = Release|Win32
+ {19C0C13F-47CA-4432-AFF3-799A296A4DDC}.Release|x64.ActiveCfg = Release|x64
+ EndGlobalSection
+--- python3/PCbuild/make_buildinfo.vcxproj
++++ python3/PCbuild/make_buildinfo.vcxproj
+@@ -5,6 +5,10 @@
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
++ <ProjectConfiguration Include="Release|x64">
++ <Configuration>Release</Configuration>
++ <Platform>x64</Platform>
++ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C73F0EC1-358B-4177-940F-0846AC8B04CD}</ProjectGuid>
+@@ -16,6 +20,10 @@
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
++ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
++ <ConfigurationType>Application</ConfigurationType>
++ <CharacterSet>NotSet</CharacterSet>
++ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+@@ -24,17 +32,38 @@
+ <Import Project="pyproject.props" />
+ <Import Project="release.props" />
+ </ImportGroup>
++ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
++ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
++ <Import Project="pyproject.props" />
++ <Import Project="x64.props" />
++ <Import Project="release.props" />
++ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
++ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
++ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
++ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
++ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
++ </ClCompile>
++ <Link>
++ <OutputFile>$(OutDir)make_buildinfo.exe</OutputFile>
++ <SubSystem>Console</SubSystem>
++ </Link>
++ </ItemDefinitionGroup>
++ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
++ <ClCompile>
++ <Optimization>Disabled</Optimization>
++ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+--- python3/PCbuild/make_versioninfo.vcxproj
++++ python3/PCbuild/make_versioninfo.vcxproj
+@@ -114,24 +114,25 @@
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <CustomBuildStep>
+ <Message>Build PC/pythonnt_rc(_d).h</Message>
+ <Command>cd $(SolutionDir)
+-make_versioninfo.exe > ..\PC\pythonnt_rc.h
++amd64\make_versioninfo.exe > ..\PC\pythonnt_rc.h
+ </Command>
+ <Outputs>$(SolutionDir)..\PC\pythonnt_rc.h;%(Outputs)</Outputs>
+ </CustomBuildStep>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+- <OutputFile>$(SolutionDir)make_versioninfo.exe</OutputFile>
++ <OutputFile>$(SolutionDir)amd64\make_versioninfo.exe</OutputFile>
++ <SubSystem>Console</SubSystem>
+ </Link>
+ <PostBuildEvent>
+ <Command>cd $(SolutionDir)
+-make_versioninfo.exe > ..\PC\python_nt.h
++amd64\make_versioninfo.exe > ..\PC\python_nt.h
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+--- python3/PCbuild/pythoncore.vcxproj
++++ python3/PCbuild/pythoncore.vcxproj
+@@ -195,35 +195,35 @@
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalIncludeDirectories>..\Python;..\Modules\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Generate build information...</Message>
+- <Command>"$(SolutionDir)make_buildinfo.exe" Release "$(IntDir)"</Command>
++ <Command>"$(SolutionDir)amd64\make_buildinfo.exe" Release "$(IntDir)"</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>$(IntDir)getbuildinfo.o;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <BaseAddress>0x1e000000</BaseAddress>
+ </Link>
+ <PreBuildEvent>
+ <Command>$(KillPythonExe)
+ IF %ERRORLEVEL% NEQ 0 (
+ echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+ exit /b 0
+ )</Command>
+ </PreBuildEvent>
+ <PreBuildEvent>
+ <Message>Killing any running $(PythonExe) instances...</Message>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
--- /dev/null
+Adapt VC10/MSVC2010 stuff for VC11/MSVC2012 (apparently builds with both then)
+
+diff -ru python3.old_/PCbuild/_msi.vcxproj python3/PCbuild/_msi.vcxproj
+--- python3.old_/PCbuild/_msi.vcxproj 2012-09-29 10:00:48.000000000 +0200
++++ python3/PCbuild/_msi.vcxproj 2012-11-13 15:52:40.656101165 +0100
+@@ -151,7 +151,7 @@
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -160,13 +160,13 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -175,13 +175,13 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -190,14 +190,14 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -206,7 +206,7 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <Link>
+- <AdditionalDependencies>fci.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <BaseAddress>0x1D160000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
--- /dev/null
+disable a check in PyThreadState_Swap that is hopefully not a "real" problem
+
+--- python3/Python/pystate.c 2013-04-17 22:45:00.799800000 +0200
++++ python3/Python/pystate.c 2013-04-17 22:46:53.743800000 +0200
+@@ -437,7 +437,9 @@
+ to be used for a thread. Check this the best we can in debug
+ builds.
+ */
+-#if defined(Py_DEBUG) && defined(WITH_THREAD)
++#if defined(Py_DEBUG) && defined(WITH_THREAD) && 0
++ /* disable this for LO - it is triggered by nested PyThreadAttach
++ which do not appear to be a real problem */
+ if (newts) {
+ /* This can be called from PyEval_RestoreThread(). Similar
+ to it, we need to ensure errno doesn't change.
--- /dev/null
+-*- Mode: diff -*-
+
+Tweak SSL build to find OpenSSL in solver & not build it itself in "ssl.vcproj" etc.
+
+diff -ru python3.old_/Modules/Setup.dist python3/Modules/Setup.dist
+--- python3.old_/Modules/Setup.dist 2012-09-29 10:00:42.000000000 +0200
++++ python3/Modules/Setup.dist 2012-11-13 14:19:01.994158111 +0100
+@@ -236,14 +236,14 @@
+ # The _md5 module implements the RSA Data Security, Inc. MD5
+ # Message-Digest Algorithm, described in RFC 1321.
+
+-#_md5 md5module.c
++_md5 md5module.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-#_sha1 sha1module.c
+-#_sha256 sha256module.c
+-#_sha512 sha512module.c
++_sha1 sha1module.c
++_sha256 sha256module.c
++_sha512 sha512module.c
+
+
+ # The _tkinter module.
+diff -ru python3.old_/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln
+--- python3.old_/PCbuild/pcbuild.sln 2012-09-29 10:00:48.000000000 +0200
++++ python3/PCbuild/pcbuild.sln 2012-11-13 14:50:39.220142472 +0100
+@@ -58,8 +58,6 @@
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}"
+ EndProject
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssl", "ssl.vcxproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}"
+-EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcxproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}"
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}"
+diff -ru python3.old_/PCbuild/_ssl.vcxproj python3/PCbuild/_ssl.vcxproj
+--- python3.old_/PCbuild/_ssl.vcxproj 2012-09-29 10:00:48.000000000 +0200
++++ python3/PCbuild/_ssl.vcxproj 2012-11-13 14:55:50.298137715 +0100
+@@ -151,14 +151,14 @@
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+@@ -166,26 +166,26 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+@@ -193,26 +193,26 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
+@@ -220,27 +220,27 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out32\libeay32.lib;$(opensslDir)\out32\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
+@@ -248,14 +248,14 @@
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+- <AdditionalIncludeDirectories>$(opensslDir)\inc64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
++ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <PreLinkEvent>
+ <Command>
+ </Command>
+ </PreLinkEvent>
+ <Link>
+- <AdditionalDependencies>ws2_32.lib;$(opensslDir)\out64\libeay32.lib;$(opensslDir)\out64\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++ <AdditionalDependencies>ws2_32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -271,10 +271,6 @@
+ <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+- <ProjectReference Include="ssl.vcxproj">
+- <Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
+- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+- </ProjectReference>
+ <ProjectReference Include="_socket.vcxproj">
+ <Project>{86937f53-c189-40ef-8ce8-8759d8e7d480}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+diff -ru python3.old_/setup.py python3/setup.py
+--- python3.old_/setup.py 2012-09-29 10:00:50.000000000 +0200
++++ python3/setup.py 2012-11-13 14:18:23.484158149 +0100
+@@ -757,7 +757,10 @@
+ exts.append( Extension('_socket', ['socketmodule.c'],
+ depends = ['socketmodule.h']) )
+ # Detect SSL support for the socket module (via _ssl)
++ ooosslinc = os.environ.get('WORKDIR') + \
++ '/UnpackedTarball/openssl/include/'
+ search_for_ssl_incs_in = [
++ ooosslinc,
+ '/usr/local/ssl/include',
+ '/usr/contrib/ssl/include/'
+ ]
+@@ -769,8 +774,12 @@
+ ['/usr/kerberos/include'])
+ if krb5_h:
+ ssl_incs += krb5_h
++ ooossllib = os.environ.get('WORKDIR') + \
++ '/UnpackedTarball/openssl'
++ ooosslinc = ooosslinc + '/'
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
++ [ooossllib,
++ '/usr/local/ssl/lib',
+ '/usr/contrib/ssl/lib/'
+ ] )
+
--- /dev/null
+build with GCC on AIX
+
+--- Python-3.3.3/configure 2012-11-28 09:05:45.990529603 +0000
++++ Python-3.3.3/configure 2012-11-28 09:06:23.037963934 +0000
+@@ -3426,8 +3426,6 @@
+ else
+
+ case $ac_sys_system in
+- AIX*) CC=${CC:-xlc_r}
+- without_gcc=;;
+ *) without_gcc=no;;
+ esac
+ fi
+@@ -5541,10 +5539,18 @@
+ PY3LIBRARY=libpython3.so
+ fi
+ ;;
+- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|AIX*)
+ LDLIBRARY='libpython$(LDVERSION).so'
+- BLDLIBRARY='-L. -lpython$(LDVERSION)'
+- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
++ case $ac_sys_system in
++ AIX*)
++ BLDLIBRARY='-Wl,-brtl -L. -lpython$(LDVERSION)'
++ RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
++ ;;
++ *)
++ BLDLIBRARY='-L. -lpython$(LDVERSION)'
++ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
++ ;;
++ esac
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ if test "$with_pydebug" != yes
+ then
+@@ -8301,8 +8307,13 @@
+ then
+ case $ac_sys_system/$ac_sys_release in
+ AIX*)
+- BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
+- LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
++ if test "$GCC" = "yes"; then
++ LDSHARED='$(CC) -shared'
++ BLDSHARED='$(CC) -Wl,-brtl -shared'
++ else
++ BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
++ LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
++ fi
+ ;;
+ IRIX/5*) LDSHARED="ld -shared";;
+ IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
+--- Python-3.3.3/configure.ac 2012-11-28 09:05:45.990529603 +0000
++++ Python-3.3.3/configure.ac 2012-11-28 09:06:23.038963946 +0000
+@@ -545,8 +545,6 @@
+ without_gcc=$withval;;
+ esac], [
+ case $ac_sys_system in
+- AIX*) CC=${CC:-xlc_r}
+- without_gcc=;;
+ *) without_gcc=no;;
+ esac])
+ AC_MSG_RESULT($without_gcc)
+@@ -910,10 +908,18 @@
+ PY3LIBRARY=libpython3.so
+ fi
+ ;;
+- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|AIX*)
+ LDLIBRARY='libpython$(LDVERSION).so'
+- BLDLIBRARY='-L. -lpython$(LDVERSION)'
+- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
++ case $ac_sys_system in
++ AIX*)
++ BLDLIBRARY='-Wl,-brtl -L. -lpython$(LDVERSION)'
++ RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
++ ;;
++ *)
++ BLDLIBRARY='-L. -lpython$(LDVERSION)'
++ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
++ ;;
++ esac
+ case $ac_sys_system in
+ FreeBSD*)
+ SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
+@@ -1866,8 +1872,13 @@
+ then
+ case $ac_sys_system/$ac_sys_release in
+ AIX*)
+- BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
+- LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
++ if test "$GCC" = "yes"; then
++ LDSHARED='$(CC) -shared'
++ BLDSHARED='$(CC) -Wl,-brtl -shared'
++ else
++ BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
++ LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
++ fi
+ ;;
+ IRIX/5*) LDSHARED="ld -shared";;
+ IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
+--- Python-3.3.3/Makefile.pre.in 2012-11-28 09:05:45.861528086 +0000
++++ Python-3.3.3/Makefile.pre.in 2012-11-28 09:06:23.046964040 +0000
+@@ -493,14 +493,20 @@
+
+ libpython$(LDVERSION).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
++ if [ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" != "aix" ]; then \
++ SONAME="-Wl,-h$(INSTSONAME)"; \
++ fi; \
++ $(BLDSHARED) $(SONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(LN) -f $(INSTSONAME) $@; \
+ else \
+ $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ fi
+
+ libpython3.so: libpython$(LDVERSION).so
+- $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
++ if [ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" != "aix" ]; then \
++ SONAME="-Wl,-h$@"; \
++ fi; \
++ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ $(SONAME) $^
+
+ libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
+ $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1106,6 +1112,8 @@
+ export PATH; PATH="`pwd`:$$PATH"; \
+ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
+ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
++ export LD_LIBRARY_PATH; LD_LIBRARY_PATH="`pwd`${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"; \
++ export LIBPATH; LIBPATH="`pwd`${LIBPATH:+:$LIBPATH}"; \
+ export EXE; EXE="$(BUILDEXE)"; \
+ if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
+ export PYTHON_FOR_BUILD; \
+--- Python-3.3.3/Modules/Setup.dist 2012-11-28 09:05:45.935528957 +0000
++++ Python-3.3.3/Modules/Setup.dist 2012-11-28 09:06:23.052964111 +0000
+@@ -177,7 +177,7 @@
+ #_bisect _bisectmodule.c # Bisection algorithms
+ #_heapq _heapqmodule.c # Heap queue algorithm
+
+-#unicodedata unicodedata.c # static Unicode character database
++unicodedata unicodedata.c # static Unicode character database
+
+
+ # Modules with some UNIX dependencies -- on by default:
--- /dev/null
+--- Objects/obmalloc.c
++++ Objects/obmalloc.c
+@@ -9,8 +9,8 @@
+ #endif
+ #endif
+
++#define WITH_VALGRIND
+ #ifdef WITH_VALGRIND
+-#include <valgrind/valgrind.h>
+
+ /* If we're using GCC, use __builtin_expect() to reduce overhead of
+ the valgrind checks */
+@@ -771,7 +771,7 @@
+
+ #ifdef WITH_VALGRIND
+ if (UNLIKELY(running_on_valgrind == -1))
+- running_on_valgrind = RUNNING_ON_VALGRIND;
++ running_on_valgrind = 1;
+ if (UNLIKELY(running_on_valgrind))
+ goto redirect;
+ #endif
--- /dev/null
+set RPATH (only to be used on ELF platforms)
+
+--- python3/Makefile.pre.in 2013-04-19 15:08:43.637715422 +0200
++++ python3/Makefile.pre.in 2013-04-19 15:07:32.685711138 +0200
+@@ -464,7 +464,7 @@
+
+ # Build the interpreter
+ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
+- $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
++ $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -Wl,-rpath,\$$ORIGIN
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+ $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
--- /dev/null
+without explicit subsystem set, the linker tries to open a file
+with the name of the comptibility version
+(fatal error LNK1181: cannot open input file ",5.01")
+diff -ur python3.org/PCbuild/_ctypes.vcxproj python3/PCbuild/_ctypes.vcxproj
+--- python3.org/PCbuild/_ctypes.vcxproj 2014-05-19 19:06:01.274114800 +0200
++++ python3/PCbuild/_ctypes.vcxproj 2014-05-19 19:07:13.649079800 +0200
+@@ -174,7 +174,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -187,7 +187,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -197,7 +197,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -210,7 +210,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+@@ -221,7 +221,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -234,7 +234,7 @@
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+diff -ur python3.org/PCbuild/_decimal.vcxproj python3/PCbuild/_decimal.vcxproj
+--- python3.org/PCbuild/_decimal.vcxproj 2014-05-19 19:06:01.274114800 +0200
++++ python3/PCbuild/_decimal.vcxproj 2014-05-19 19:07:13.649079800 +0200
+@@ -176,7 +176,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -189,7 +189,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;..\Include;..\PC;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -199,7 +199,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -212,7 +212,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+@@ -223,7 +223,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+@@ -236,7 +236,7 @@
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+- <SubSystem>NotSet</SubSystem>
++ <SubSystem>Console</SubSystem>
+ <BaseAddress>0x1D1A0000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
--- /dev/null
+http://bugs.python.org/issue17797
+http://connect.microsoft.com/VisualStudio/feedback/details/785119/
+
+Visual Studio 2012 changed return value for fileno function that breaks
+when python tries to check/setup stdin/out/err
+GetStdHandle on Windows XP behaves contrary to the documentation...
+diff -ur python3.org/Python/pythonrun.c python3/Python/pythonrun.c
+--- python3.org/Python/pythonrun.c 2014-05-24 16:36:20.361672900 +0200
++++ python3/Python/pythonrun.c 2014-05-24 16:37:38.424159100 +0200
+@@ -1036,7 +1036,15 @@
+ int status = 0, fd;
+ PyObject * encoding_attr;
+ char *encoding = NULL, *errors;
+-
++#ifdef MS_WINDOWS
++ OSVERSIONINFOEX osvi;
++ BOOL bIsWindowsXP;
++
++ ZeroMemory(&osvi, sizeof(osvi));
++ osvi.dwOSVersionInfoSize = sizeof(osvi);
++ GetVersionEx(&osvi);
++ bIsWindowsXP = (osvi.dwMajorVersion < 6);
++#endif
+ /* Hack to avoid a nasty recursion issue when Python is invoked
+ in verbose mode: pre-import the Latin-1 and UTF-8 codecs */
+ if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) {
+@@ -1084,7 +1092,11 @@
+ * and fileno() may point to an invalid file descriptor. For example
+ * GUI apps don't have valid standard streams by default.
+ */
++#ifdef MS_WINDOWS
++ if (!is_valid_fd(fd) || GetStdHandle(STD_INPUT_HANDLE) == NULL || bIsWindowsXP) {
++#else
+ if (!is_valid_fd(fd)) {
++#endif
+ std = Py_None;
+ Py_INCREF(std);
+ }
+@@ -1099,7 +1111,11 @@
+
+ /* Set sys.stdout */
+ fd = fileno(stdout);
++#ifdef MS_WINDOWS
++ if (!is_valid_fd(fd) || GetStdHandle(STD_OUTPUT_HANDLE) == NULL || bIsWindowsXP) {
++#else
+ if (!is_valid_fd(fd)) {
++#endif
+ std = Py_None;
+ Py_INCREF(std);
+ }
+@@ -1115,7 +1131,11 @@
+ #if 1 /* Disable this if you have trouble debugging bootstrap stuff */
+ /* Set sys.stderr, replaces the preliminary stderr */
+ fd = fileno(stderr);
++#ifdef MS_WINDOWS
++ if (!is_valid_fd(fd) || GetStdHandle(STD_ERROR_HANDLE) == NULL || bIsWindowsXP) {
++#else
+ if (!is_valid_fd(fd)) {
++#endif
+ std = Py_None;
+ Py_INCREF(std);
+ }
--- /dev/null
+HACK: Fix build breakage on MacOS:
+
+*** WARNING: renaming "pyexpat" since importing it failed: dlopen(build/lib.macosx-10.6-i386-3.3/pyexpat.so, 2): Symbol not found: _XML_ErrorString
+
+This reverts c242a8f30806 from the python hg repo:
+
+restore namespacing of pyexpat symbols (closes #19186)
+
+
+See http://bugs.python.org/issue19186#msg214069
+
+The recommendation to include Modules/inc at first broke the Linux build...
+
+So do it this way, as it was before. Needs some realignment later.
+
+--- python3/Modules/expat/expat_external.h
++++ python3/Modules/expat/expat_external.h
+@@ -7,10 +7,6 @@
+
+ /* External API definitions */
+
+-/* Namespace external symbols to allow multiple libexpat version to
+- co-exist. */
+-#include "pyexpatns.h"
+-
+ #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
+ #define XML_USE_MSC_EXTENSIONS 1
+ #endif
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,raptor,raptor))
+
+$(eval $(call gb_ExternalPackage_use_external_project,raptor,raptor))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,raptor,$(LIBO_LIB_FOLDER)/libraptor2-lo.$(RAPTOR_MAJOR).dylib,src/.libs/libraptor2-lo.$(RAPTOR_MAJOR).dylib))
+else ifeq ($(OS)-$(COM),WNT-GCC)
+$(eval $(call gb_ExternalPackage_add_file,raptor,$(LIBO_LIB_FOLDER)/libraptor2-$(RAPTOR_MAJOR).dll,src/.libs/libraptor2-$(RAPTOR_MAJOR).dll))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,raptor,$(LIBO_LIB_FOLDER)/libraptor2.dll,src/.libs/libraptor2.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,raptor,$(LIBO_LIB_FOLDER)/libraptor2-lo.so.$(RAPTOR_MAJOR),src/.libs/libraptor2-lo.so.$(RAPTOR_MAJOR).0.0))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,rasqal,rasqal))
+
+$(eval $(call gb_ExternalPackage_use_external_project,rasqal,rasqal))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,rasqal,$(LIBO_LIB_FOLDER)/librasqal-lo.$(RASQAL_MAJOR).dylib,src/.libs/librasqal-lo.$(RASQAL_MAJOR).dylib))
+else ifeq ($(OS)-$(COM),WNT-GCC)
+$(eval $(call gb_ExternalPackage_add_file,rasqal,$(LIBO_LIB_FOLDER)/librasqal-$(RASQAL_MAJOR).dll,src/.libs/librasqal-$(RASQAL_MAJOR).dll))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,rasqal,$(LIBO_LIB_FOLDER)/librasqal.dll,src/.libs/librasqal.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,rasqal,$(LIBO_LIB_FOLDER)/librasqal-lo.so.$(RASQAL_MAJOR),src/.libs/librasqal-lo.so.$(RASQAL_MAJOR).0.0))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,redland,redland))
+
+$(eval $(call gb_ExternalPackage_use_external_project,redland,redland))
+
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,redland,$(LIBO_LIB_FOLDER)/librdf-lo.$(REDLAND_MAJOR).dylib,src/.libs/librdf-lo.$(REDLAND_MAJOR).dylib))
+else ifeq ($(OS)-$(COM),WNT-GCC)
+$(eval $(call gb_ExternalPackage_add_file,redland,$(LIBO_LIB_FOLDER)/librdf-$(REDLAND_MAJOR).dll,src/.libs/librdf-$(REDLAND_MAJOR).dll))
+else ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_file,redland,$(LIBO_LIB_FOLDER)/librdf.dll,src/.libs/librdf.dll))
+else ifeq ($(filter IOS ANDROID,$(OS)),)
+$(eval $(call gb_ExternalPackage_add_file,redland,$(LIBO_LIB_FOLDER)/librdf-lo.so.$(REDLAND_MAJOR),src/.libs/librdf-lo.so.$(REDLAND_MAJOR).0.0))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,raptor))
+
+$(eval $(call gb_ExternalProject_use_external,raptor,libxml2))
+
+$(eval $(call gb_ExternalProject_register_targets,raptor,\
+ build \
+))
+
+ifeq ($(OS),WNT)
+$(call gb_ExternalProject_get_state_target,raptor,build):
+ $(call gb_ExternalProject_run,build,\
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ LDFLAGS="-Wl$(COMMA)--no-undefined -Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 -Wl$(COMMA)--export-all-symbols $(subst ;, -L,$(ILIB))" \
+ OBJDUMP="$(HOST_PLATFORM)-objdump" \
+ $(if $(and $(SYSTEM_LIBXML),$(filter GCC,$(COM))),PATH="$(MINGW_SYSROOT)/bin:$$PATH") \
+ ./configure --disable-static --enable-shared --disable-gtk-doc \
+ --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \
+ --with-www=xml \
+ --without-xslt-config \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --target=$(HOST_PLATFORM) \
+ lt_cv_cc_dll_switch="-shared" \
+ $(if $(SYSTEM_LIBXML),,--with-xml2-config=$(call gb_UnpackedTarball_get_dir,xml2)/xml2-config) \
+ && $(MAKE) \
+ )
+else
+$(call gb_ExternalProject_get_state_target,raptor,build):
+ $(call gb_ExternalProject_run,build,\
+ $(if $(filter IOS,$(OS)),LIBS="-liconv") \
+ CFLAGS="$(if $(debug),-g,-O) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \
+ $(if $(filter GCCLINUXPOWERPC64,$(COM)$(OS)$(CPUNAME)),-mminimal-toc)" \
+ LDFLAGS=" \
+ $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib") \
+ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
+ CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include)" \
+ ./configure --disable-gtk-doc \
+ --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \
+ --with-www=xml \
+ --without-xslt-config \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ $(if $(filter IOS ANDROID,$(OS)),--disable-shared,--disable-static) \
+ $(if $(SYSTEM_LIBXML),,--with-xml2-config=$(call gb_UnpackedTarball_get_dir,xml2)/xml2-config) \
+ && $(MAKE) \
+ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,rasqal))
+
+$(eval $(call gb_ExternalProject_use_external,rasqal,libxml2))
+
+$(eval $(call gb_ExternalProject_use_package,rasqal,raptor))
+
+$(eval $(call gb_ExternalProject_register_targets,rasqal,\
+ build \
+))
+
+# note: this can intentionally only build against internal raptor (not system)
+
+ifeq ($(OS),WNT)
+$(call gb_ExternalProject_get_state_target,rasqal,build):
+ $(call gb_ExternalProject_run,build,\
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ LDFLAGS="-Wl$(COMMA)--no-undefined -Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 -Wl$(COMMA)--export-all-symbols $(subst ;, -L$,$(ILIB))" \
+ OBJDUMP="$(HOST_PLATFORM)-objdump" \
+ PKG_CONFIG="" \
+ RAPTOR2_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,raptor)/src" \
+ RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2" \
+ ./configure --disable-static --enable-shared --disable-gtk-doc \
+ --disable-pcre \
+ --with-decimal=none \
+ --with-uuid-library=internal \
+ --with-digest-library=internal \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ lt_cv_cc_dll_switch="-shared" \
+ $(if $(SYSTEM_LIBXML),,--with-xml2-config=$(call gb_UnpackedTarball_get_dir,xml2)/xml2-config) \
+ && $(MAKE) \
+ )
+else
+$(call gb_ExternalProject_get_state_target,rasqal,build):
+ $(call gb_ExternalProject_run,build,\
+ CFLAGS="$(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden)" \
+ LDFLAGS=" \
+ $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib") \
+ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
+ $(if $(SYSBASE),CPPFLAGS="-I$(SYSBASE)/usr/include") \
+ PKG_CONFIG="" \
+ RAPTOR2_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,raptor)/src" \
+ RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2" \
+ ./configure --disable-gtk-doc \
+ --with-regex-library=posix \
+ --with-decimal=none \
+ --with-uuid-library=internal \
+ --with-digest-library=internal \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ $(if $(filter IOS ANDROID,$(OS)),--disable-shared,--disable-static) \
+ $(if $(SYSTEM_LIBXML),,--with-xml2-config=$(call gb_UnpackedTarball_get_dir,xml2)/xml2-config) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),&& $(PERL) \
+ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(gb_Package_SOURCEDIR_rasqal)/src/.libs/librasqal-lo.$(RASQAL_MAJOR).dylib) \
+ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,redland))
+
+$(eval $(call gb_ExternalProject_use_packages,redland, \
+ raptor \
+ rasqal \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,redland,\
+ build \
+))
+
+# note: this can intentionally only build against internal raptor/rasqal
+
+ifeq ($(OS),WNT)
+$(call gb_ExternalProject_get_state_target,redland,build):
+ $(call gb_ExternalProject_run,build,\
+ CC="$(CC) -mthreads $(if $(MINGW_SHARED_GCCLIB),-shared-libgcc)" \
+ LDFLAGS="-Wl$(COMMA)--no-undefined -Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 -Wl$(COMMA)--export-all-symbols" \
+ OBJDUMP="$(HOST_PLATFORM)-objdump" \
+ PKG_CONFIG="" \
+ RAPTOR2_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,raptor)/src" \
+ RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 $(LIBXML_LIBS)" \
+ RASQAL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,rasqal)/src" \
+ RASQAL_LIBS="-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal" \
+ ./configure --disable-static --disable-gtk-doc \
+ --disable-modular \
+ --without-threads \
+ --without-bdb --without-sqlite --without-mysql \
+ --without-postgresql --without-threestore --without-virtuoso \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ lt_cv_cc_dll_switch="-shared" \
+ && $(MAKE) \
+ )
+else
+$(call gb_ExternalProject_get_state_target,redland,build):
+ $(call gb_ExternalProject_run,build,\
+ CFLAGS="$(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden)" \
+ LDFLAGS=" \
+ $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib") \
+ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
+ CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include)" \
+ PKG_CONFIG="" \
+ RAPTOR2_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,raptor)/src" \
+ RAPTOR2_LIBS="-L$(call gb_UnpackedTarball_get_dir,raptor)/src/.libs -lraptor2 $(LIBXML_LIBS)" \
+ RASQAL_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,rasqal)/src" \
+ RASQAL_LIBS="-L$(call gb_UnpackedTarball_get_dir,rasqal)/src/.libs -lrasqal" \
+ ./configure --disable-gtk-doc \
+ --disable-modular \
+ --without-threads \
+ --without-bdb --without-sqlite --without-mysql \
+ --without-postgresql --without-threestone --without-virtuoso \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+ $(if $(filter IOS ANDROID,$(OS)),--disable-shared,--disable-static) \
+ && $(MAKE) \
+ $(if $(filter MACOSX,$(OS)),&& $(PERL) \
+ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
+ $(gb_Package_SOURCEDIR_redland)/src/.libs/librdf-lo.$(REDLAND_MAJOR).dylib) \
+ )
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,raptor2))
+
+$(eval $(call gb_Library_use_unpacked,raptor2,raptor))
+
+$(eval $(call gb_Library_use_externals,raptor2,\
+ libxml2 \
+ libxslt \
+))
+
+$(eval $(call gb_Library_set_warnings_not_errors,raptor2))
+
+$(eval $(call gb_Library_add_defs,raptor2,\
+ -DHAVE_CONFIG_H \
+ -DRAPTOR_INTERNAL \
+ -DWIN32 \
+ -DNDEBUG \
+ -D_WINDOWS \
+ -D_USRDLL \
+ -DWIN32_EXPORTS \
+ -DYY_NO_UNISTD_H \
+))
+
+$(eval $(call gb_Library_add_generated_cobjects,raptor2,\
+ UnpackedTarball/raptor/src/ntriples_parse \
+ UnpackedTarball/raptor/src/parsedate \
+ UnpackedTarball/raptor/src/raptor_abbrev \
+ UnpackedTarball/raptor/src/raptor_avltree \
+ UnpackedTarball/raptor/src/raptor_concepts \
+ UnpackedTarball/raptor/src/raptor_general \
+ UnpackedTarball/raptor/src/raptor_guess \
+ UnpackedTarball/raptor/src/raptor_iostream \
+ UnpackedTarball/raptor/src/raptor_json_writer \
+ UnpackedTarball/raptor/src/raptor_libxml \
+ UnpackedTarball/raptor/src/raptor_locator \
+ UnpackedTarball/raptor/src/raptor_log \
+ UnpackedTarball/raptor/src/raptor_memstr \
+ UnpackedTarball/raptor/src/raptor_namespace \
+ UnpackedTarball/raptor/src/raptor_option \
+ UnpackedTarball/raptor/src/raptor_parse \
+ UnpackedTarball/raptor/src/raptor_qname \
+ UnpackedTarball/raptor/src/raptor_rdfxml \
+ UnpackedTarball/raptor/src/raptor_rfc2396 \
+ UnpackedTarball/raptor/src/raptor_sax2 \
+ UnpackedTarball/raptor/src/raptor_sequence \
+ UnpackedTarball/raptor/src/raptor_serialize \
+ UnpackedTarball/raptor/src/raptor_serialize_ntriples \
+ UnpackedTarball/raptor/src/raptor_serialize_rdfxml \
+ UnpackedTarball/raptor/src/raptor_serialize_rdfxmla \
+ UnpackedTarball/raptor/src/raptor_set \
+ UnpackedTarball/raptor/src/raptor_statement \
+ UnpackedTarball/raptor/src/raptor_stringbuffer \
+ UnpackedTarball/raptor/src/raptor_syntax_description \
+ UnpackedTarball/raptor/src/raptor_term \
+ UnpackedTarball/raptor/src/raptor_turtle_writer \
+ UnpackedTarball/raptor/src/raptor_unicode \
+ UnpackedTarball/raptor/src/raptor_uri \
+ UnpackedTarball/raptor/src/raptor_www \
+ UnpackedTarball/raptor/src/raptor_xml \
+ UnpackedTarball/raptor/src/raptor_xml_writer \
+ UnpackedTarball/raptor/src/snprintf \
+ UnpackedTarball/raptor/src/strcasecmp \
+ UnpackedTarball/raptor/src/turtle_common \
+ UnpackedTarball/raptor/src/turtle_lexer \
+ UnpackedTarball/raptor/src/turtle_parser \
+))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,rasqal))
+
+$(eval $(call gb_Library_use_unpacked,rasqal,rasqal))
+
+$(eval $(call gb_Library_set_warnings_not_errors,rasqal))
+
+$(eval $(call gb_Library_use_external,rasqal,raptor_headers))
+
+$(eval $(call gb_Library_use_libraries,rasqal,raptor2))
+
+$(eval $(call gb_Library_add_defs,rasqal,\
+ -DRASQAL_INTERNAL \
+ -DWIN32 \
+ -DNDEBUG \
+ -D_WINDOWS \
+ -D_USRDLL \
+ -DWIN32_EXPORTS \
+ -D_MT \
+))
+
+$(eval $(call gb_Library_set_include,rasqal,\
+ -I$(WORKDIR)/UnpackedTarball/rasqal/libmtwist \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_Library_add_generated_cobjects,rasqal,\
+ UnpackedTarball/rasqal/libmtwist/mt \
+ UnpackedTarball/rasqal/libmtwist/seed \
+ UnpackedTarball/rasqal/src/rasqal_algebra \
+ UnpackedTarball/rasqal/src/rasqal_bindings \
+ UnpackedTarball/rasqal/src/rasqal_data_graph \
+ UnpackedTarball/rasqal/src/rasqal_dataset \
+ UnpackedTarball/rasqal/src/rasqal_datetime \
+ UnpackedTarball/rasqal/src/rasqal_decimal \
+ UnpackedTarball/rasqal/src/rasqal_digest \
+ UnpackedTarball/rasqal/src/rasqal_digest_md5 \
+ UnpackedTarball/rasqal/src/rasqal_digest_sha1 \
+ UnpackedTarball/rasqal/src/rasqal_double \
+ UnpackedTarball/rasqal/src/rasqal_engine \
+ UnpackedTarball/rasqal/src/rasqal_engine_algebra \
+ UnpackedTarball/rasqal/src/rasqal_engine_sort \
+ UnpackedTarball/rasqal/src/rasqal_expr \
+ UnpackedTarball/rasqal/src/rasqal_expr_datetimes \
+ UnpackedTarball/rasqal/src/rasqal_expr_evaluate \
+ UnpackedTarball/rasqal/src/rasqal_expr_numerics \
+ UnpackedTarball/rasqal/src/rasqal_expr_strings \
+ UnpackedTarball/rasqal/src/rasqal_feature \
+ UnpackedTarball/rasqal/src/rasqal_format_html \
+ UnpackedTarball/rasqal/src/rasqal_format_json \
+ UnpackedTarball/rasqal/src/rasqal_format_rdf \
+ UnpackedTarball/rasqal/src/rasqal_format_sparql_xml \
+ UnpackedTarball/rasqal/src/rasqal_format_sv \
+ UnpackedTarball/rasqal/src/rasqal_format_table \
+ UnpackedTarball/rasqal/src/rasqal_formula \
+ UnpackedTarball/rasqal/src/rasqal_general \
+ UnpackedTarball/rasqal/src/rasqal_graph_pattern \
+ UnpackedTarball/rasqal/src/rasqal_iostream \
+ UnpackedTarball/rasqal/src/rasqal_literal \
+ UnpackedTarball/rasqal/src/rasqal_map \
+ UnpackedTarball/rasqal/src/rasqal_prefix \
+ UnpackedTarball/rasqal/src/rasqal_projection \
+ UnpackedTarball/rasqal/src/rasqal_query \
+ UnpackedTarball/rasqal/src/rasqal_query_results \
+ UnpackedTarball/rasqal/src/rasqal_query_transform \
+ UnpackedTarball/rasqal/src/rasqal_query_write \
+ UnpackedTarball/rasqal/src/rasqal_random \
+ UnpackedTarball/rasqal/src/rasqal_raptor \
+ UnpackedTarball/rasqal/src/rasqal_regex \
+ UnpackedTarball/rasqal/src/rasqal_result_formats \
+ UnpackedTarball/rasqal/src/rasqal_row \
+ UnpackedTarball/rasqal/src/rasqal_row_compatible \
+ UnpackedTarball/rasqal/src/rasqal_rowsource \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_aggregation \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_assignment \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_distinct \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_empty \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_filter \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_graph \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_groupby \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_having \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_join \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_project \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_rowsequence \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_slice \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_sort \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_triples \
+ UnpackedTarball/rasqal/src/rasqal_rowsource_union \
+ UnpackedTarball/rasqal/src/rasqal_service \
+ UnpackedTarball/rasqal/src/rasqal_solution_modifier \
+ UnpackedTarball/rasqal/src/rasqal_triple \
+ UnpackedTarball/rasqal/src/rasqal_triples_source \
+ UnpackedTarball/rasqal/src/rasqal_update \
+ UnpackedTarball/rasqal/src/rasqal_variable \
+ UnpackedTarball/rasqal/src/rasqal_xsd_datatypes \
+ UnpackedTarball/rasqal/src/snprintf \
+ UnpackedTarball/rasqal/src/sparql_lexer \
+ UnpackedTarball/rasqal/src/sparql_parser \
+ UnpackedTarball/rasqal/src/timegm \
+ UnpackedTarball/rasqal/src/gettimeofday \
+))
+
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,rdf))
+
+$(eval $(call gb_Library_use_unpacked,rdf,redland))
+
+$(eval $(call gb_Library_set_warnings_not_errors,rdf))
+
+$(eval $(call gb_Library_use_libraries,rdf,\
+ raptor2 \
+ rasqal \
+))
+
+$(eval $(call gb_Library_use_externals,rdf,\
+ raptor_headers \
+ rasqal_headers \
+))
+
+$(eval $(call gb_Library_add_defs,rdf,\
+ -DLIBRDF_INTERNAL \
+ -DWIN32 \
+ -DNDEBUG \
+ -D_WINDOWS \
+ -D_USRDLL \
+ -DWIN32_EXPORTS \
+))
+
+$(eval $(call gb_Library_add_generated_cobjects,rdf,\
+ UnpackedTarball/redland/src/rdf_concepts \
+ UnpackedTarball/redland/src/rdf_digest \
+ UnpackedTarball/redland/src/rdf_digest_md5 \
+ UnpackedTarball/redland/src/rdf_digest_sha1 \
+ UnpackedTarball/redland/src/rdf_files \
+ UnpackedTarball/redland/src/rdf_hash \
+ UnpackedTarball/redland/src/rdf_hash_cursor \
+ UnpackedTarball/redland/src/rdf_hash_memory \
+ UnpackedTarball/redland/src/rdf_heuristics \
+ UnpackedTarball/redland/src/rdf_init \
+ UnpackedTarball/redland/src/rdf_iterator \
+ UnpackedTarball/redland/src/rdf_list \
+ UnpackedTarball/redland/src/rdf_log \
+ UnpackedTarball/redland/src/rdf_model \
+ UnpackedTarball/redland/src/rdf_model_storage \
+ UnpackedTarball/redland/src/rdf_node \
+ UnpackedTarball/redland/src/rdf_node_common \
+ UnpackedTarball/redland/src/rdf_parser \
+ UnpackedTarball/redland/src/rdf_parser_raptor \
+ UnpackedTarball/redland/src/rdf_raptor \
+ UnpackedTarball/redland/src/rdf_query \
+ UnpackedTarball/redland/src/rdf_query_rasqal \
+ UnpackedTarball/redland/src/rdf_query_results \
+ UnpackedTarball/redland/src/rdf_serializer \
+ UnpackedTarball/redland/src/rdf_serializer_raptor \
+ UnpackedTarball/redland/src/rdf_statement \
+ UnpackedTarball/redland/src/rdf_statement_common \
+ UnpackedTarball/redland/src/rdf_storage \
+ UnpackedTarball/redland/src/rdf_storage_file \
+ UnpackedTarball/redland/src/rdf_storage_list \
+ UnpackedTarball/redland/src/rdf_storage_hashes \
+ UnpackedTarball/redland/src/rdf_storage_trees \
+ UnpackedTarball/redland/src/rdf_stream \
+ UnpackedTarball/redland/src/rdf_uri \
+ UnpackedTarball/redland/src/rdf_utf8 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,redland))
+
+ifeq ($(SYSTEM_REDLAND),)
+$(eval $(call gb_Module_add_targets,redland,\
+ UnpackedTarball_raptor \
+ UnpackedTarball_rasqal \
+ UnpackedTarball_redland \
+))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_targets,redland,\
+ Library_raptor \
+ Library_rasqal \
+ Library_rdf \
+))
+else
+$(eval $(call gb_Module_add_targets,redland,\
+ ExternalPackage_raptor \
+ ExternalPackage_rasqal \
+ ExternalPackage_redland \
+ ExternalProject_raptor \
+ ExternalProject_rasqal \
+ ExternalProject_redland \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Redland RDF library (librdf) from [http://librdf.org/]
+
+== License ==
+[git:redland/LICENSE.txt]
+Triple-licensed: LGPL v2+/GPL v2+/Apache v2
+
+== Description ==
+This module contains the third-party Redland RDF / librdf library, which
+is needed to support data in RDF (Resource Description Framework) format.
+It consists of 3 parts:
+- raptor: parsers and serializers for numerous RDF file formats
+- rasqal: query engine which supports SPARQL queries
+- redland: librdf integrates raptor and rasqal, and provides numerous storage
+ engines for storing RDF graphs (in memory, SQL, ...)
+
+Libraries: libraptor, librasqal, librdf
+
+== Patches ==
+There are several patches, most of which contain only hacks to get it to
+build with the LO build system.
+
+Upstream may merge patches that are attached to the bug tracker, but don't
+send patches to the mailing list, those will most likely be ignored.
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,raptor))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,raptor,$(RAPTOR_TARBALL),,redland))
+
+# configure generated files for MSVC
+$(eval $(call gb_UnpackedTarball_add_file,raptor,src/raptor2.h,external/redland/raptor/raptor2.h))
+$(eval $(call gb_UnpackedTarball_add_file,raptor,src/raptor_config.h,external/redland/raptor/raptor_config.h))
+
+$(eval $(call gb_UnpackedTarball_add_patches,raptor,\
+ external/redland/raptor/raptor-freebsd.patch.1 \
+ $(if $(filter WNTGCC,$(OS)$(COM)),external/redland/raptor/raptor-mingw.patch.1) \
+ $(if $(filter-out WNT,$(OS)),external/redland/raptor/raptor-bundled-soname.patch.1) \
+ $(if $(filter ANDROID,$(OS)),external/redland/raptor/raptor-android.patch.1) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,rasqal))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,rasqal,$(RASQAL_TARBALL),,redland))
+
+# configure generated files for MSVC
+$(eval $(call gb_UnpackedTarball_add_file,rasqal,src/rasqal.h,external/redland/rasqal/rasqal.h))
+
+$(eval $(call gb_UnpackedTarball_add_patches,rasqal,\
+ external/redland/rasqal/rasqal-pkgconfig.patch.1 \
+ external/redland/rasqal/rasqal-freebsd.patch.1 \
+ external/redland/rasqal/rasqal-msvc.patch.1 \
+ external/redland/rasqal/rasqal-aix.patch.1 \
+ $(if $(filter-out WNT,$(OS)),external/redland/rasqal/rasqal-bundled-soname.patch.1) \
+ $(if $(filter ANDROID,$(OS)),external/redland/rasqal/rasqal-android.patch.1) \
+ $(if $(filter WNTGCC,$(OS)$(COM)),external/redland/rasqal/rasqal-mingw.patch.1) \
+ $(if $(CROSS_COMPILING),external/redland/rasqal/rasqal-xcompile.patch.1) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,redland))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,redland,$(REDLAND_TARBALL),,redland))
+
+# configure generated files for MSVC
+$(eval $(call gb_UnpackedTarball_add_file,redland,src/librdf.h,external/redland/redland/librdf.h))
+
+# redland-format.patch.0 sent upstream as
+# <https://github.com/dajobe/librdf/pull/6>
+$(eval $(call gb_UnpackedTarball_add_patches,redland,\
+ external/redland/redland/redland-query-rasqal-avoid-assert.patch.1 \
+ external/redland/redland/redland-pkgconfig.patch.1 \
+ external/redland/redland/redland-freebsd.patch.1 \
+ external/redland/redland/redland-msvc.patch.1 \
+ $(if $(filter-out WNT,$(OS)),external/redland/redland/redland-bundled-soname.patch.1) \
+ $(if $(filter ANDROID,$(OS)),external/redland/redland/redland-android.patch.1) \
+ $(if $(filter WNTGCC,$(OS)$(COM)),external/redland/redland/redland-mingw.patch.1) \
+ $(if $(CROSS_COMPILING),external/redland/redland/redland-xcompile.patch.1) \
+ external/redland/redland/redland-format.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+No sonames on Android
+
+--- a/configure 2013-03-29 19:46:34.922901756 +0100
++++ b/configure 2013-03-29 19:46:56.051901574 +0100
+@@ -9866,7 +9866,7 @@
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
--- /dev/null
+rhbz#809466 change soname of bundled redland libs
+
+--- a/src/Makefile.in 2013-03-29 19:11:27.944919859 +0100
++++ b/src/Makefile.in 2013-03-29 19:17:42.173916644 +0100
+@@ -507,7 +507,7 @@
+ $(am__append_21) $(am__append_22) $(am__append_23) \
+ $(am__append_24) $(am__append_25) $(am__append_26) \
+ $(am__append_27) $(am__append_28)
+-libraptor2_la_LDFLAGS = -version-info @RAPTOR_LIBTOOL_VERSION@ \
++libraptor2_la_LDFLAGS = -version-info @RAPTOR_LIBTOOL_VERSION@ -release lo \
+ @RAPTOR_LDFLAGS@ $(MEM_LIBS)
+
+ libraptor2_la_LIBADD = @LTLIBOBJS@
--- /dev/null
+Usual patch to produce Linux-like .so files on FreeBSD
+
+--- a/build/ltmain.sh 2008-02-02 22:28:24.000000000 +0900
++++ b/build/ltmain.sh 2008-07-08 11:58:42.000000000 +0900
+@@ -7341,9 +7341,9 @@
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+- current="$number_major"
+- revision="$number_minor"
+- age="0"
++ current=`expr $number_major + $number_minor`
++ age="$number_minor"
++ revision="$number_revision"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+@@ -7420,8 +7420,8 @@
+ ;;
+
+ freebsd-elf)
+- major=".$current"
+- versuffix=".$current"
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
+ ;;
+
+ irix | nonstopux)
--- /dev/null
+MinGW: libtool falls back to static lib unless -no-undefined given
+
+--- a/src/Makefile.in 2013-03-29 19:11:27.944919859 +0100
++++ b/src/Makefile.in 2013-03-29 20:05:02.140892243 +0100
+@@ -507,7 +507,7 @@
+ $(am__append_21) $(am__append_22) $(am__append_23) \
+ $(am__append_24) $(am__append_25) $(am__append_26) \
+ $(am__append_27) $(am__append_28)
+-libraptor2_la_LDFLAGS = -version-info @RAPTOR_LIBTOOL_VERSION@ \
++libraptor2_la_LDFLAGS = -version-info @RAPTOR_LIBTOOL_VERSION@ -no-undefined \
+ @RAPTOR_LDFLAGS@ $(MEM_LIBS)
+
+ libraptor2_la_LIBADD = @LTLIBOBJS@
--- /dev/null
+/* -*- Mode: c; c-basic-offset: 2 -*-
+ *
+ * raptor.h - Redland Parser Toolkit for RDF (Raptor) - public API
+ *
+ * Copyright (C) 2000-2013, David Beckett http://www.dajobe.org/
+ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
+ *
+ * This package is Free Software and part of Redland http://librdf.org/
+ *
+ * It is licensed under the following three licenses as alternatives:
+ * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
+ * 2. GNU General Public License (GPL) V2 or any newer version
+ * 3. Apache License, V2.0 or any newer version
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above three licenses.
+ *
+ * See LICENSE.html or LICENSE.txt at the top of this package for the
+ * complete terms and further detail along with the license texts for
+ * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
+ *
+ *
+ */
+
+
+
+#ifndef RAPTOR_H
+#define RAPTOR_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+
+/* Required for va_list in raptor_vsnprintf */
+#include <stdarg.h>
+
+
+/**
+ * RAPTOR_V2_AVAILABLE
+ *
+ * Flag for marking raptor2 API availability.
+ */
+#define RAPTOR_V2_AVAILABLE 1
+
+
+/**
+ * RAPTOR_VERSION:
+ *
+ * Raptor library version number
+ *
+ * Format: major * 10000 + minor * 100 + release
+ */
+#define RAPTOR_VERSION 20009
+
+/**
+ * RAPTOR_VERSION_STRING:
+ *
+ * Raptor library version string
+ */
+#define RAPTOR_VERSION_STRING "2.0.9"
+
+/**
+ * RAPTOR_VERSION_MAJOR:
+ *
+ * Raptor library major version
+ */
+#define RAPTOR_VERSION_MAJOR 2
+
+/**
+ * RAPTOR_VERSION_MINOR:
+ *
+ * Raptor library minor version
+ */
+#define RAPTOR_VERSION_MINOR 0
+
+/**
+ * RAPTOR_VERSION_RELEASE:
+ *
+ * Raptor library release
+ */
+#define RAPTOR_VERSION_RELEASE 9
+
+/**
+ * RAPTOR_API:
+ *
+ * Macro for wrapping API function call declarations.
+ *
+ */
+#ifndef RAPTOR_API
+# ifdef WIN32
+# ifdef __GNUC__
+# undef _declspec
+# define _declspec(x) __declspec(x)
+# endif
+# ifdef RAPTOR_STATIC
+# define RAPTOR_API
+# else
+# ifdef RAPTOR_INTERNAL
+# define RAPTOR_API _declspec(dllexport)
+# else
+# define RAPTOR_API _declspec(dllimport)
+# endif
+# endif
+# else
+# define RAPTOR_API
+# endif
+#endif
+
+/* Use gcc 3.1+ feature to allow marking of deprecated API calls.
+ * This gives a warning during compiling.
+ */
+#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+#define RAPTOR_DEPRECATED __attribute__((deprecated))
+#define RAPTOR_NORETURN __attribute__((__noreturn__))
+#else
+#define RAPTOR_DEPRECATED
+#define RAPTOR_NORETURN
+#endif
+
+/**
+ * RAPTOR_PRINTF_FORMAT:
+ * @string_index: ignore me
+ * @first_to_check_index: ignore me
+ *
+ * Internal macro
+ */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define RAPTOR_PRINTF_FORMAT(string_index, first_to_check_index) \
+ __attribute__((__format__(__printf__, string_index, first_to_check_index)))
+#else
+#define RAPTOR_PRINTF_FORMAT(string_index, first_to_check_index)
+#endif
+
+/**
+ * raptor_uri:
+ *
+ * Raptor URI Class.
+ */
+typedef struct raptor_uri_s raptor_uri;
+
+
+/* Public statics */
+
+/**
+ * raptor_short_copyright_string:
+ *
+ * Short copyright string (one line).
+ */
+RAPTOR_API
+extern const char * const raptor_short_copyright_string;
+
+/**
+ * raptor_copyright_string:
+ *
+ * Copyright string (multiple lines).
+ */
+RAPTOR_API
+extern const char * const raptor_copyright_string;
+
+/**
+ * raptor_version_string:
+ *
+ * Raptor version as a string.
+ */
+RAPTOR_API
+extern const char * const raptor_version_string;
+
+/**
+ * raptor_version_major:
+ *
+ * Raptor major version number.
+ */
+RAPTOR_API
+extern const unsigned int raptor_version_major;
+
+/**
+ * raptor_version_minor:
+ *
+ * Raptor minor version number.
+ */
+RAPTOR_API
+extern const unsigned int raptor_version_minor;
+
+/**
+ * raptor_version_release:
+ *
+ * Raptor release version number.
+ */
+RAPTOR_API
+extern const unsigned int raptor_version_release;
+
+/**
+ * raptor_version_decimal:
+ *
+ * Raptor version as a decimal number.
+ *
+ * Format: major * 10000 + minor * 100 + release
+ */
+RAPTOR_API
+extern const unsigned int raptor_version_decimal;
+
+/**
+ * raptor_license_string:
+ *
+ * Raptor license string.
+ */
+RAPTOR_API
+extern const char * const raptor_license_string;
+
+/**
+ * raptor_home_url_string:
+ *
+ * Raptor home page URL.
+ */
+RAPTOR_API
+extern const char * const raptor_home_url_string;
+
+/**
+ * raptor_xml_namespace_uri:
+ *
+ * XML Namespace (xml:) URI string.
+ */
+RAPTOR_API
+extern const unsigned char * const raptor_xml_namespace_uri;
+
+
+/**
+ * raptor_rdf_namespace_uri:
+ *
+ * RDF Namespace (rdf:) URI string.
+ */
+RAPTOR_API
+extern const unsigned char * const raptor_rdf_namespace_uri;
+
+/**
+ * raptor_rdf_namespace_uri_len:
+ *
+ * Length of #raptor_rdf_namespace_uri string
+ */
+RAPTOR_API
+extern const unsigned int raptor_rdf_namespace_uri_len;
+
+/**
+ * raptor_rdf_schema_namespace_uri:
+ *
+ * RDF Schema (rdfs:) Namespace URI string.
+ */
+RAPTOR_API
+extern const unsigned char * const raptor_rdf_schema_namespace_uri;
+
+/**
+ * raptor_xmlschema_datatypes_namespace_uri:
+ *
+ * XML Schema datatypes (xsd:) namespace URI string.
+ */
+RAPTOR_API
+extern const unsigned char * const raptor_xmlschema_datatypes_namespace_uri;
+
+/**
+ * raptor_owl_namespace_uri:
+ *
+ * OWL (owl:) Namespace URI string.
+ */
+RAPTOR_API
+extern const unsigned char * const raptor_owl_namespace_uri;
+
+/**
+ * raptor_xml_literal_datatype_uri_string:
+ *
+ * XML Literal datatype (rdf:XMLLiteral) URI string.
+ */
+RAPTOR_API
+extern const unsigned char * const raptor_xml_literal_datatype_uri_string;
+
+/**
+ * raptor_xml_literal_datatype_uri_string_len:
+ *
+ * Length of #raptor_xml_literal_datatype_uri_string
+ */
+RAPTOR_API
+extern const unsigned int raptor_xml_literal_datatype_uri_string_len;
+
+
+/* Public structure */
+/**
+ * raptor_world:
+ *
+ * Raptor world class.
+ */
+typedef struct raptor_world_s raptor_world;
+/**
+ * raptor_parser:
+ *
+ * Raptor Parser class
+ */
+typedef struct raptor_parser_s raptor_parser;
+/**
+ * raptor_serializer:
+ *
+ * Raptor Serializer class
+ */
+typedef struct raptor_serializer_s raptor_serializer;
+
+/**
+ * raptor_www:
+ *
+ * Raptor WWW class
+ */
+typedef struct raptor_www_s raptor_www;
+/**
+ * raptor_iostream:
+ *
+ * Raptor I/O Stream class
+ */
+typedef struct raptor_iostream_s raptor_iostream;
+/**
+ * raptor_xml_element:
+ *
+ * Raptor XML Element class
+ */
+typedef struct raptor_xml_element_s raptor_xml_element;
+/**
+ * raptor_xml_writer:
+ *
+ * Raptor XML Writer class
+ */
+typedef struct raptor_xml_writer_s raptor_xml_writer;
+/**
+ * raptor_qname:
+ *
+ * Raptor XML qname class
+ */
+typedef struct raptor_qname_s raptor_qname;
+/**
+ * raptor_namespace:
+ *
+ * Raptor XML Namespace class
+ */
+typedef struct raptor_namespace_s raptor_namespace;
+/**
+ * raptor_namespace_stack:
+ *
+ * Raptor XML Namespace Stack class
+ */
+typedef struct raptor_namespace_stack_s raptor_namespace_stack;
+
+/**
+ * raptor_sax2:
+ *
+ * Raptor SAX2 class
+ */
+typedef struct raptor_sax2_s raptor_sax2;
+
+
+/**
+ * raptor_type_q:
+ * @mime_type: MIME type string
+ * @mime_type_len: length of @mime_type
+ * @q: Q value 0-10 standing for decimal 0.0-1.0
+ *
+ * (MIME Type, Q) pair
+ */
+typedef struct {
+ const char* mime_type;
+ size_t mime_type_len;
+ unsigned char q;
+} raptor_type_q;
+
+
+/**
+ * raptor_syntax_bitflags:
+ * @RAPTOR_SYNTAX_NEED_BASE_URI: the syntax requires a base URI
+ *
+ * Bit flags for #raptor_syntax_description flags field
+ */
+typedef enum {
+ RAPTOR_SYNTAX_NEED_BASE_URI = 1
+} raptor_syntax_bitflags;
+
+
+/**
+ * raptor_syntax_description:
+ * @names: array of syntax names - the first one (required) is the public name, the rest are aliases. The array is NULL terminated.
+ * @names_count: size of @names array
+ * @label: long descriptive label for syntax
+ * @mime_types: Array of (MIME type, Q) values associated with the syntax (or NULL). If present the array is NULL terminated.
+ * @mime_types_count: size of @mime_types array
+ * @uri_strings: array of URIs identifying the syntax (or NULL). The first one if present is the main URI, the rest are aliases. The array is NULL terminated.
+ * @uri_strings_count: size of @uri_strings array
+ * @flags: See #raptor_syntax_bitflags for the bits
+ *
+ * Description of a syntax or file format.
+ *
+ */
+typedef struct {
+ const char* const* names;
+ unsigned int names_count;
+
+ const char* label;
+
+ const raptor_type_q* mime_types;
+ unsigned int mime_types_count;
+
+ const char* const* uri_strings;
+ unsigned int uri_strings_count;
+
+ unsigned int flags;
+} raptor_syntax_description;
+
+
+/**
+ * raptor_term_type:
+ * @RAPTOR_TERM_TYPE_URI: RDF URI
+ * @RAPTOR_TERM_TYPE_LITERAL: RDF literal
+ * @RAPTOR_TERM_TYPE_BLANK: RDF blank node
+ * @RAPTOR_TERM_TYPE_UNKNOWN: Internal
+ *
+ * Type of term in a #raptor_statement
+ *
+ * Node type 3 is unused but exists to preserve numeric compatibility
+ * with librdf_node_type values.
+ */
+typedef enum {
+ RAPTOR_TERM_TYPE_UNKNOWN = 0,
+ RAPTOR_TERM_TYPE_URI = 1,
+ RAPTOR_TERM_TYPE_LITERAL = 2,
+ /* unused type 3 */
+ RAPTOR_TERM_TYPE_BLANK = 4
+} raptor_term_type;
+
+
+/**
+ * raptor_locator:
+ * @uri: URI of location (or NULL)
+ * @file: Filename of location (or NULL)
+ * @line: Line number of location (or <0 for no line)
+ * @column: Column number of location (or <0 for no column)
+ * @byte: Byte number of location (or <0 for no byte)
+ *
+ * Location information for an error, warning or information message.
+ */
+typedef struct {
+ raptor_uri *uri;
+ const char *file;
+ int line;
+ int column;
+ int byte;
+} raptor_locator;
+
+/**
+ * raptor_option:
+ * @RAPTOR_OPTION_SCANNING: If true (default false), the RDF/XML
+ * parser will look for embedded rdf:RDF elements inside the XML
+ * content, and not require that the XML start with an rdf:RDF root
+ * element.
+ * @RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES: If true (default true)
+ * then the RDF/XML parser will allow non-XML namespaced attributes
+ * to be accepted as well as rdf: namespaced ones. For example,
+ * 'about' and 'ID' will be interpreted as if they were rdf:about
+ * and rdf:ID respectively.
+ * @RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES: If true (default true)
+ * then the RDF/XML parser will allow unknown parsetypes to be
+ * present and will pass them on to the user. Unimplemented at
+ * present.
+ * @RAPTOR_OPTION_ALLOW_BAGID: If true (default true) then the
+ * RDF/XML parser will support the rdf:bagID attribute that was
+ * removed from the RDF/XML language when it was revised. This
+ * support may be removed in future.
+ * @RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST: If true (default false)
+ * then the RDF/XML parser will generate the idList rdf:type
+ * rdf:List triple in the handling of rdf:parseType="Collection".
+ * This triple was removed during the revising of RDF/XML after
+ * collections were initially added.
+ * @RAPTOR_OPTION_NORMALIZE_LANGUAGE: If true (default true) then
+ * XML language values such as from xml:lang will be normalized to
+ * lowercase.
+ * @RAPTOR_OPTION_NON_NFC_FATAL: If true (default false) then
+ * illegal Unicode Normal Form C in literals will give a fatal
+ * error, otherwise just a warning.
+ * @RAPTOR_OPTION_WARN_OTHER_PARSETYPES: If true (default true) then
+ * the RDF/XML parser will warn about unknown rdf:parseType values.
+ * @RAPTOR_OPTION_CHECK_RDF_ID: If true (default true) then the
+ * RDF/XML will check rdf:ID attribute values for duplicates and
+ * cause an error if any are found.
+ * @RAPTOR_OPTION_RELATIVE_URIS: If true (default true) then
+ * relative URIs will be used wherever possible when serializing.
+ * @RAPTOR_OPTION_WRITER_AUTO_INDENT: Automatically indent elements when
+ * seriailizing.
+ * @RAPTOR_OPTION_WRITER_AUTO_EMPTY: Automatically detect and
+ * abbreviate empty elements when serializing.
+ * @RAPTOR_OPTION_WRITER_INDENT_WIDTH: Integer number of spaces to use
+ * for each indent level when serializing with auto indent.
+ * @RAPTOR_OPTION_WRITER_XML_VERSION: Integer XML version XML 1.0 (10) or XML 1.1 (11)
+ * @RAPTOR_OPTION_WRITER_XML_DECLARATION: Write XML 1.0 or 1.1 declaration.
+ * @RAPTOR_OPTION_NO_NET: Deny network requests inside other requests.
+ * @RAPTOR_OPTION_RESOURCE_BORDER: Border color of resource
+ * nodes for GraphViz DOT serializer.
+ * @RAPTOR_OPTION_LITERAL_BORDER: Border color of literal nodes
+ * for GraphViz DOT serializer.
+ * @RAPTOR_OPTION_BNODE_BORDER: Border color of blank nodes for
+ * GraphViz DOT serializer.
+ * @RAPTOR_OPTION_RESOURCE_FILL: Fill color of resource nodes
+ * for GraphViz DOT serializer.
+ * @RAPTOR_OPTION_LITERAL_FILL: Fill color of literal nodes for
+ * GraphViz DOT serializer.
+ * @RAPTOR_OPTION_BNODE_FILL: Fill color of blank nodes for
+ * GraphViz DOT serializer.
+ * @RAPTOR_OPTION_HTML_TAG_SOUP: Use a lax HTML parser if an XML parser
+ * fails when read HTML for GRDDL parser.
+ * @RAPTOR_OPTION_MICROFORMATS: Look for microformats for GRDDL parser.
+ * @RAPTOR_OPTION_HTML_LINK: Look for head <link> to type rdf/xml
+ * for GRDDL parser.
+ * @RAPTOR_OPTION_WWW_TIMEOUT: Set timeout for internal WWW URI requests
+ * for GRDDL parser.
+ * @RAPTOR_OPTION_WRITE_BASE_URI: Write @base directive for Turtle/N3.
+ * @RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL: HTTP Cache-Control: header
+ * @RAPTOR_OPTION_WWW_HTTP_USER_AGENT: HTTP User-Agent: header
+ * @RAPTOR_OPTION_JSON_CALLBACK: JSON serializer callback function.
+ * @RAPTOR_OPTION_JSON_EXTRA_DATA: JSON serializer extra top-level data
+ * @RAPTOR_OPTION_RSS_TRIPLES: Atom/RSS serializer writes extra RDF triples it finds (none, rdf-xml, atom-triples)
+ * @RAPTOR_OPTION_ATOM_ENTRY_URI: Atom entry URI. If given, generate an Atom Entry Document with the item having the given URI, otherwise generate an Atom Feed Document with any items found.
+ * @RAPTOR_OPTION_PREFIX_ELEMENTS: Integer. If set, generate Atom/RSS1.0 documents with prefixed elements, otherwise unprefixed.
+ * @RAPTOR_OPTION_STRICT: Boolean. If set, operate in strict conformance mode.
+ * @RAPTOR_OPTION_WWW_CERT_FILENAME: String. SSL client certificate filename
+ * @RAPTOR_OPTION_WWW_CERT_TYPE: String. SSL client certificate type
+ * @RAPTOR_OPTION_WWW_CERT_PASSPHRASE: String. SSL client certificate passphrase
+ * @RAPTOR_OPTION_WWW_SSL_VERIFY_PEER: Integer. SSL verify peer - non-0 to verify peer SSL certificate (default)
+ * @RAPTOR_OPTION_WWW_SSL_VERIFY_HOST: Integer. SSL verify host - 0 none, 1 CN match, 2 host match (default). Other values are ignored.
+ * @RAPTOR_OPTION_NO_FILE: Deny file reading requests inside other requests.
+ * @RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES: When reading XML, load external entities.
+ * @RAPTOR_OPTION_LAST: Internal
+ *
+ * Raptor parser, serializer or XML writer options.
+ */
+typedef enum {
+ RAPTOR_OPTION_SCANNING,
+ RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES,
+ RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES,
+ RAPTOR_OPTION_ALLOW_BAGID,
+ RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST,
+ RAPTOR_OPTION_NORMALIZE_LANGUAGE,
+ RAPTOR_OPTION_NON_NFC_FATAL,
+ RAPTOR_OPTION_WARN_OTHER_PARSETYPES,
+ RAPTOR_OPTION_CHECK_RDF_ID,
+ RAPTOR_OPTION_RELATIVE_URIS,
+ RAPTOR_OPTION_WRITER_AUTO_INDENT,
+ RAPTOR_OPTION_WRITER_AUTO_EMPTY,
+ RAPTOR_OPTION_WRITER_INDENT_WIDTH,
+ RAPTOR_OPTION_WRITER_XML_VERSION,
+ RAPTOR_OPTION_WRITER_XML_DECLARATION,
+ RAPTOR_OPTION_NO_NET,
+ RAPTOR_OPTION_RESOURCE_BORDER,
+ RAPTOR_OPTION_LITERAL_BORDER,
+ RAPTOR_OPTION_BNODE_BORDER,
+ RAPTOR_OPTION_RESOURCE_FILL,
+ RAPTOR_OPTION_LITERAL_FILL,
+ RAPTOR_OPTION_BNODE_FILL,
+ RAPTOR_OPTION_HTML_TAG_SOUP,
+ RAPTOR_OPTION_MICROFORMATS,
+ RAPTOR_OPTION_HTML_LINK,
+ RAPTOR_OPTION_WWW_TIMEOUT,
+ RAPTOR_OPTION_WRITE_BASE_URI,
+ RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL,
+ RAPTOR_OPTION_WWW_HTTP_USER_AGENT,
+ RAPTOR_OPTION_JSON_CALLBACK,
+ RAPTOR_OPTION_JSON_EXTRA_DATA,
+ RAPTOR_OPTION_RSS_TRIPLES,
+ RAPTOR_OPTION_ATOM_ENTRY_URI,
+ RAPTOR_OPTION_PREFIX_ELEMENTS,
+ RAPTOR_OPTION_STRICT,
+ RAPTOR_OPTION_WWW_CERT_FILENAME,
+ RAPTOR_OPTION_WWW_CERT_TYPE,
+ RAPTOR_OPTION_WWW_CERT_PASSPHRASE,
+ RAPTOR_OPTION_NO_FILE,
+ RAPTOR_OPTION_WWW_SSL_VERIFY_PEER,
+ RAPTOR_OPTION_WWW_SSL_VERIFY_HOST,
+ RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES,
+ RAPTOR_OPTION_LAST = RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES
+} raptor_option;
+
+
+/**
+ * raptor_term_literal_value:
+ * @string: literal string
+ * @string_len: length of string
+ * @datatype: datatype URI (or NULL)
+ * @language: literal language (or NULL)
+ * @language_len: length of language
+ *
+ * Literal term value - this typedef exists solely for use in #raptor_term
+ *
+ * Either @datatype or @language may be non-NULL but not both.
+ */
+typedef struct {
+ unsigned char *string;
+ unsigned int string_len;
+
+ raptor_uri *datatype;
+
+ unsigned char *language;
+ unsigned char language_len;
+} raptor_term_literal_value;
+
+
+/**
+ * raptor_term_blank_value:
+ * @string: literal string
+ * @string_len: length of string
+ *
+ * Blank term value - this typedef exists solely for use in #raptor_term
+ *
+ */
+typedef struct {
+ unsigned char *string;
+ unsigned int string_len;
+} raptor_term_blank_value;
+
+
+/**
+ * raptor_term_value:
+ * @uri: uri value when term type is #RAPTOR_TERM_TYPE_URI
+ * @literal: literal value when term type is #RAPTOR_TERM_TYPE_LITERAL
+ * @blank: blank value when term type is #RAPTOR_TERM_TYPE_BLANK
+ *
+ * Term value - this typedef exists solely for use in #raptor_term
+ *
+ **/
+typedef union {
+ raptor_uri *uri;
+
+ raptor_term_literal_value literal;
+
+ raptor_term_blank_value blank;
+} raptor_term_value;
+
+
+/**
+ * raptor_term:
+ * @world: world
+ * @usage: usage reference count (if >0)
+ * @type: term type
+ * @value: term values per type
+ *
+ * An RDF statement term
+ *
+ */
+typedef struct {
+ raptor_world* world;
+
+ int usage;
+
+ raptor_term_type type;
+
+ raptor_term_value value;
+
+} raptor_term;
+
+
+/**
+ * raptor_statement:
+ * @world: world pointer
+ * @usage: usage count
+ * @subject: statement subject
+ * @predicate: statement predicate
+ * @object: statement object
+ * @graph: statement graph name (or NULL if not present)
+ *
+ * An RDF triple with optional graph name (quad)
+ *
+ * See #raptor_term for a description of how the fields may be used.
+ * As returned by a parser statement_handler.
+ */
+typedef struct {
+ raptor_world* world;
+ int usage;
+ raptor_term* subject;
+ raptor_term* predicate;
+ raptor_term* object;
+ raptor_term* graph;
+} raptor_statement;
+
+
+/**
+ * raptor_log_level:
+ * @RAPTOR_LOG_LEVEL_NONE: Internal
+ * @RAPTOR_LOG_LEVEL_TRACE: very fine-grained tracing messages information
+ * @RAPTOR_LOG_LEVEL_DEBUG: fine-grained tracing messages suitable for debugging
+ * @RAPTOR_LOG_LEVEL_INFO: coarse-grained information messages
+ * @RAPTOR_LOG_LEVEL_WARN: warning messages of potentially harmful problems
+ * @RAPTOR_LOG_LEVEL_ERROR: error messages where the application can continue
+ * @RAPTOR_LOG_LEVEL_FATAL: fatal error message where the application will likely abort
+ * @RAPTOR_LOG_LEVEL_LAST: Internal
+ *
+ * Log levels
+ */
+typedef enum {
+ RAPTOR_LOG_LEVEL_NONE,
+ RAPTOR_LOG_LEVEL_TRACE,
+ RAPTOR_LOG_LEVEL_DEBUG,
+ RAPTOR_LOG_LEVEL_INFO,
+ RAPTOR_LOG_LEVEL_WARN,
+ RAPTOR_LOG_LEVEL_ERROR,
+ RAPTOR_LOG_LEVEL_FATAL,
+ RAPTOR_LOG_LEVEL_LAST = RAPTOR_LOG_LEVEL_FATAL
+} raptor_log_level;
+
+
+/**
+ * raptor_domain:
+ * @RAPTOR_DOMAIN_IOSTREAM: I/O stream
+ * @RAPTOR_DOMAIN_NAMESPACE: XML Namespace / namespace stack
+ * @RAPTOR_DOMAIN_PARSER: RDF Parser
+ * @RAPTOR_DOMAIN_QNAME: XML QName
+ * @RAPTOR_DOMAIN_SAX2: XML SAX2
+ * @RAPTOR_DOMAIN_SERIALIZER: RDF Serializer
+ * @RAPTOR_DOMAIN_TERM: RDF Term
+ * @RAPTOR_DOMAIN_TURTLE_WRITER: Turtle Writer
+ * @RAPTOR_DOMAIN_URI: RDF Uri
+ * @RAPTOR_DOMAIN_WORLD: RDF world
+ * @RAPTOR_DOMAIN_WWW: WWW
+ * @RAPTOR_DOMAIN_XML_WRITER: XML Writer
+ * @RAPTOR_DOMAIN_NONE: Internal
+ * @RAPTOR_DOMAIN_LAST: Internal
+ *
+ * Log domain
+ */
+typedef enum {
+ RAPTOR_DOMAIN_NONE,
+ RAPTOR_DOMAIN_IOSTREAM,
+ RAPTOR_DOMAIN_NAMESPACE,
+ RAPTOR_DOMAIN_PARSER,
+ RAPTOR_DOMAIN_QNAME,
+ RAPTOR_DOMAIN_SAX2,
+ RAPTOR_DOMAIN_SERIALIZER,
+ RAPTOR_DOMAIN_TERM,
+ RAPTOR_DOMAIN_TURTLE_WRITER,
+ RAPTOR_DOMAIN_URI,
+ RAPTOR_DOMAIN_WORLD,
+ RAPTOR_DOMAIN_WWW,
+ RAPTOR_DOMAIN_XML_WRITER,
+ RAPTOR_DOMAIN_LAST = RAPTOR_DOMAIN_XML_WRITER
+} raptor_domain;
+
+
+/**
+ * raptor_log_message:
+ * @code: error code or < 0 if not used or known
+ * @domain: message domain or #RAPTOR_DOMAIN_NONE if not used or known
+ * @level: log message level
+ * @locator: location associated with message or NULL if not known
+ * @text: message string
+ *
+ * Log message.
+ */
+typedef struct {
+ int code;
+ raptor_domain domain;
+ raptor_log_level level;
+ raptor_locator *locator;
+ const char *text;
+} raptor_log_message;
+
+
+/**
+ * raptor_log_handler:
+ * @user_data: user data
+ * @message: log message
+ *
+ * Handler function for log messages with location
+ *
+ * Used during parsing and serializing for errors and warnings that
+ * may include location information. Handlers may be set
+ * by raptor_world_set_log_handler().
+ *
+ */
+typedef void (*raptor_log_handler)(void *user_data, raptor_log_message *message);
+
+
+/**
+ * raptor_statement_handler:
+ * @user_data: user data
+ * @statement: statement to report
+ *
+ * Statement (triple) reporting handler function.
+ *
+ * This handler function set with
+ * raptor_parser_set_statement_handler() on a parser receives
+ * statements as the parsing proceeds. The @statement argument to the
+ * handler is shared and must be copied by the caller with
+ * raptor_statement_copy().
+ */
+typedef void (*raptor_statement_handler)(void *user_data, raptor_statement *statement);
+
+/**
+ * raptor_graph_mark_flags:
+ * @RAPTOR_GRAPH_MARK_START: mark is start of graph (otherwise is end)
+ * @RAPTOR_GRAPH_MARK_DECLARED: mark was declared in syntax rather than implict
+ *
+ * Graph mark handler bitmask flags
+ */
+typedef enum {
+ RAPTOR_GRAPH_MARK_START = 1,
+ RAPTOR_GRAPH_MARK_DECLARED = 2
+} raptor_graph_mark_flags;
+
+
+/**
+ * raptor_graph_mark_handler:
+ * @user_data: user data
+ * @graph: graph to report, NULL for the default graph
+ * @flags: bitmask of #raptor_graph_mark_flags flags
+ *
+ * Graph start/end mark handler function.
+ *
+ * Records start and end of graphs happening in a stream of generated
+ * #raptor_statement via the statement handler. The callback starts a
+ * graph when @flags has #RAPTOR_GRAPH_MARK_START bit set.
+ *
+ * The start and ends may be either declared in the syntax via some
+ * keyword or mechanism such as TRiG {} syntax when @flags has bit
+ * #RAPTOR_GRAPH_MARK_DECLARED set, or be implied by the start/end of
+ * the data in other syntaxes, and the bit will be unset.
+ */
+typedef void (*raptor_graph_mark_handler)(void *user_data, raptor_uri *graph, int flags);
+
+/**
+ * raptor_generate_bnodeid_handler:
+ * @user_data: user data
+ * @user_bnodeid: a user-specified ID or NULL if none available.
+ *
+ * Generate a blank node identifier handler function.
+ *
+ * Return value: new blank node ID to use
+ */
+typedef unsigned char* (*raptor_generate_bnodeid_handler)(void *user_data, unsigned char* user_bnodeid);
+
+/**
+ * raptor_namespace_handler:
+ * @user_data: user data
+ * @nspace: #raptor_namespace declared
+ *
+ * XML Namespace declaration reporting handler set by
+ * raptor_parser_set_namespace_handler().
+ */
+typedef void (*raptor_namespace_handler)(void* user_data, raptor_namespace *nspace);
+
+
+/**
+ * raptor_www_write_bytes_handler:
+ * @www: WWW object
+ * @userdata: user data
+ * @ptr: data pointer
+ * @size: size of individual item
+ * @nmemb: number of items
+ *
+ * Receiving bytes of data from WWW retrieval handler.
+ *
+ * Set by raptor_www_set_write_bytes_handler().
+ */
+typedef void (*raptor_www_write_bytes_handler)(raptor_www* www, void *userdata, const void *ptr, size_t size, size_t nmemb);
+
+/**
+ * raptor_www_content_type_handler:
+ * @www: WWW object
+ * @userdata: user data
+ * @content_type: content type seen
+ *
+ * Receiving Content-Type: header from WWW retrieval handler.
+ *
+ * Set by raptor_www_set_content_type_handler().
+ */
+typedef void (*raptor_www_content_type_handler)(raptor_www* www, void *userdata, const char *content_type);
+
+/**
+ * raptor_www_final_uri_handler:
+ * @www: WWW object
+ * @userdata: user data
+ * @final_uri: final URI seen
+ *
+ * Receiving the final resolved URI from a WWW retrieval
+ *
+ * Set by raptor_www_set_final_uri_handler().
+ */
+typedef void (*raptor_www_final_uri_handler)(raptor_www* www, void *userdata, raptor_uri *final_uri);
+
+/**
+ * raptor_uri_filter_func:
+ * @user_data: user data
+ * @uri: #raptor_uri URI to check
+ *
+ * Callback function for #raptor_www_set_uri_filter
+ *
+ * Return value: non-0 to filter the URI
+ */
+typedef int (*raptor_uri_filter_func)(void *user_data, raptor_uri* uri);
+
+
+/**
+ * raptor_world_flag:
+ * @RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE: if set (non-0 value) - save/restore the libxml generic error handler when raptor library initializes (default set)
+ * @RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE: if set (non-0 value) - save/restore the libxml structured error handler when raptor library terminates (default set)
+ * @RAPTOR_WORLD_FLAG_URI_INTERNING: if set (non-0 value) - each URI is saved interned in-memory and reused (default set)
+ * @RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH: if set (non-0 value) the raptor will neither initialise or terminate the lower level WWW library. Usually in raptor initialising either curl_global_init (for libcurl) are called and in raptor cleanup, curl_global_cleanup is called. This flag allows the application finer control over these libraries such as setting other global options or potentially calling and terminating raptor several times. It does mean that applications which use this call must do their own extra work in order to allocate and free all resources to the system.
+ *
+ * Raptor world flags
+ *
+ * These are used by raptor_world_set_flags() to control raptor-wide
+ * options across classes. These must be set before
+ * raptor_world_open() is called explicitly or implicitly (by
+ * creating a raptor object). There is no enumeration function for
+ * these flags because they are not user options and must be set
+ * before the library is initialised. For similar reasons, there is
+ * no get function.
+ *
+ * If any libxml handler saving/restoring is enabled, any existing
+ * handler and context is saved before parsing and restored
+ * afterwards. Otherwise, no saving/restoring is performed.
+ *
+ */
+typedef enum {
+ RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE = 1,
+ RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE = 2,
+ RAPTOR_WORLD_FLAG_URI_INTERNING = 3,
+ RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH = 4
+} raptor_world_flag;
+
+
+/**
+ * raptor_data_compare_handler:
+ * @data1: first data object
+ * @data2: second data object
+ *
+ * Function to compare two data objects - signature like strcmp() and function pssed to qsort()
+ *
+ * Designed to be passed into generic data structure constructors
+ * like raptor_new_avltree().
+ *
+ * Return value: compare value <0 if @data1 is before @data2, =0 if equal, >0 if @data1 is after @data2
+ */
+typedef int (*raptor_data_compare_handler)(const void* data1, const void* data2);
+
+
+/**
+ * raptor_data_malloc_handler:
+ * @size: data size
+ *
+ * Typedef for a function to allocate memory - signature like malloc()
+ *
+ * Designed to be passed into constructors
+ * like raptor_www_fetch_to_string
+ *
+ * Return value: pointer to newly allocated memory or NULL on failure
+ */
+typedef void* (*raptor_data_malloc_handler)(size_t size);
+
+
+/**
+ * raptor_data_free_handler:
+ * @data: data object or NULL
+ *
+ * Typedef for function to free a data object - signature like free()
+ *
+ * Designed to be passed into generic data structure constructors
+ * like raptor_new_avltree(). If @data is NULL, nothing should be done.
+ */
+typedef void (*raptor_data_free_handler)(void* data);
+
+
+/**
+ * raptor_data_context_free_handler:
+ * @context: context data for the free function
+ * @object: object to free
+ *
+ * Handler function for freeing a sequence item with a contextual pointer.
+ *
+ * Set by raptor_new_sequence_with_context().
+*/
+typedef void (*raptor_data_context_free_handler)(void* context, void* object);
+
+/**
+ * raptor_data_print_handler:
+ * @object: object to print
+ * @fh: FILE* to print to
+ *
+ * Handler function for printing an object to a stream.
+ *
+ * Set by raptor_new_sequence()
+ *
+ * Return value: non-0 on failure
+ */
+typedef int (*raptor_data_print_handler)(void *object, FILE *fh);
+
+/**
+ * raptor_data_context_print_handler:
+ * @context: context data for the print function
+ * @object: object to print
+ * @fh: FILE* to print to
+ *
+ * Function function for printing an object with data context to a stream.
+ *
+ * Set by raptor_new_sequence_with_context()
+ *
+ * Return value: non-0 on failure
+ */
+typedef int (*raptor_data_context_print_handler)(void *context, void *object, FILE *fh);
+
+/**
+ * raptor_stringbuffer:
+ *
+ * Raptor string buffer class
+ */
+typedef struct raptor_stringbuffer_s raptor_stringbuffer;
+
+
+/* Public functions */
+
+#define raptor_new_world() raptor_new_world_internal(RAPTOR_VERSION)
+/* The real target of the raptor_new_world() macro */
+RAPTOR_API
+raptor_world *raptor_new_world_internal(unsigned int version_decimal);
+RAPTOR_API
+int raptor_world_open(raptor_world* world);
+RAPTOR_API
+void raptor_free_world(raptor_world* world);
+RAPTOR_API
+int raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences);
+RAPTOR_API
+int raptor_world_set_flag(raptor_world *world, raptor_world_flag flag, int value);
+RAPTOR_API
+int raptor_world_set_log_handler(raptor_world *world, void *user_data, raptor_log_handler handler);
+RAPTOR_API
+void raptor_world_set_generate_bnodeid_handler(raptor_world* world, void *user_data, raptor_generate_bnodeid_handler handler);
+RAPTOR_API
+unsigned char* raptor_world_generate_bnodeid(raptor_world *world);
+RAPTOR_API
+void raptor_world_set_generate_bnodeid_parameters(raptor_world* world, char *prefix, int base);
+RAPTOR_API
+const char* raptor_log_level_get_label(raptor_log_level level);
+RAPTOR_API
+const char* raptor_domain_get_label(raptor_domain domain);
+
+/* Names */
+RAPTOR_API
+int raptor_world_is_parser_name(raptor_world* world, const char *name);
+RAPTOR_API
+const char* raptor_world_guess_parser_name(raptor_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier);
+RAPTOR_API
+int raptor_world_is_serializer_name(raptor_world* world, const char *name);
+
+/* Syntax descriptions */
+RAPTOR_API
+const raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, unsigned int counter);
+RAPTOR_API
+const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, unsigned int counter);
+RAPTOR_API
+int raptor_syntax_description_validate(raptor_syntax_description* desc);
+
+RAPTOR_API
+raptor_option raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri);
+
+
+/* Term Class */
+RAPTOR_API
+raptor_term* raptor_new_term_from_uri(raptor_world* world, raptor_uri* uri);
+RAPTOR_API
+raptor_term* raptor_new_term_from_counted_uri_string(raptor_world* world, const unsigned char *uri_string, size_t length);
+RAPTOR_API
+raptor_term* raptor_new_term_from_uri_string(raptor_world* world, const unsigned char *uri_string);
+RAPTOR_API
+raptor_term* raptor_new_term_from_literal(raptor_world* world, const unsigned char* literal, raptor_uri* datatype, const unsigned char* language);
+RAPTOR_API
+raptor_term* raptor_new_term_from_counted_literal(raptor_world* world, const unsigned char* literal, size_t literal_len, raptor_uri* datatype, const unsigned char* language, unsigned char language_len);
+RAPTOR_API
+raptor_term* raptor_new_term_from_blank(raptor_world* world, const unsigned char* blank);
+RAPTOR_API
+raptor_term* raptor_new_term_from_counted_blank(raptor_world* world, const unsigned char* blank, size_t length);
+RAPTOR_API
+raptor_term* raptor_term_copy(raptor_term* term);
+RAPTOR_API
+int raptor_term_compare(const raptor_term *t1, const raptor_term *t2);
+RAPTOR_API
+int raptor_term_equals(raptor_term* t1, raptor_term* t2);
+RAPTOR_API
+void raptor_free_term(raptor_term *term);
+
+RAPTOR_API
+unsigned char* raptor_term_to_counted_string(raptor_term *term, size_t* len_p);
+RAPTOR_API
+unsigned char* raptor_term_to_string(raptor_term *term);
+RAPTOR_API
+int raptor_term_ntriples_write(const raptor_term *term, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_uri_turtle_write(raptor_world *world, raptor_iostream* iostr, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri);
+RAPTOR_API
+int raptor_term_turtle_write(raptor_iostream* iostr, raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri);
+RAPTOR_API
+unsigned char* raptor_uri_to_turtle_counted_string(raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p);
+RAPTOR_API
+unsigned char* raptor_uri_to_turtle_string(raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri);
+RAPTOR_API
+unsigned char* raptor_term_to_turtle_counted_string(raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p);
+RAPTOR_API
+unsigned char* raptor_term_to_turtle_string(raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri);
+
+
+/* Statement Class */
+RAPTOR_API
+void raptor_statement_init(raptor_statement *statement, raptor_world *world);
+RAPTOR_API
+void raptor_statement_clear(raptor_statement *statement);
+RAPTOR_API
+raptor_statement* raptor_new_statement(raptor_world *world);
+RAPTOR_API
+raptor_statement* raptor_new_statement_from_nodes(raptor_world* world, raptor_term *subject, raptor_term *predicate, raptor_term *object, raptor_term *graph);
+RAPTOR_API
+raptor_statement* raptor_statement_copy(raptor_statement *statement);
+RAPTOR_API
+void raptor_free_statement(raptor_statement *statement);
+
+RAPTOR_API
+int raptor_statement_print(const raptor_statement * statement, FILE *stream);
+RAPTOR_API
+int raptor_statement_print_as_ntriples(const raptor_statement * statement, FILE *stream);
+RAPTOR_API
+int raptor_statement_compare(const raptor_statement *s1, const raptor_statement *s2);
+RAPTOR_API
+int raptor_statement_equals(const raptor_statement* s1, const raptor_statement* s2);
+
+
+/* Parser Class */
+RAPTOR_API
+raptor_parser* raptor_new_parser(raptor_world* world, const char *name);
+RAPTOR_API
+raptor_parser* raptor_new_parser_for_content(raptor_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier);
+RAPTOR_API
+void raptor_free_parser(raptor_parser* parser);
+
+/* methods */
+
+/* Handlers */
+RAPTOR_API
+void raptor_parser_set_statement_handler(raptor_parser* parser, void *user_data, raptor_statement_handler handler);
+RAPTOR_API
+void raptor_parser_set_graph_mark_handler(raptor_parser* parser, void *user_data, raptor_graph_mark_handler handler);
+RAPTOR_API
+void raptor_parser_set_namespace_handler(raptor_parser* parser, void *user_data, raptor_namespace_handler handler);
+RAPTOR_API
+void raptor_parser_set_uri_filter(raptor_parser* parser, raptor_uri_filter_func filter, void* user_data);
+RAPTOR_API
+raptor_locator* raptor_parser_get_locator(raptor_parser* rdf_parser);
+
+
+/* Parsing functions */
+RAPTOR_API
+int raptor_parser_parse_start(raptor_parser *rdf_parser, raptor_uri *uri);
+RAPTOR_API
+int raptor_parser_parse_chunk(raptor_parser* rdf_parser, const unsigned char *buffer, size_t len, int is_end);
+RAPTOR_API
+int raptor_parser_parse_file_stream(raptor_parser* rdf_parser, FILE *stream, const char *filename, raptor_uri *base_uri);
+RAPTOR_API
+int raptor_parser_parse_file(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri);
+RAPTOR_API
+int raptor_parser_parse_uri(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri);
+RAPTOR_API
+int raptor_parser_parse_uri_with_connection(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri, void *connection);
+RAPTOR_API
+int raptor_parser_parse_iostream(raptor_parser* rdf_parser, raptor_iostream *iostr, raptor_uri *base_uri);
+RAPTOR_API
+void raptor_parser_parse_abort(raptor_parser* rdf_parser);
+RAPTOR_API
+const char* raptor_parser_get_name(raptor_parser *rdf_parser);
+RAPTOR_API
+const raptor_syntax_description* raptor_parser_get_description(raptor_parser *rdf_parser);
+
+/* parser option methods */
+RAPTOR_API
+int raptor_parser_set_option(raptor_parser *parser, raptor_option option, const char* string, int integer);
+RAPTOR_API
+int raptor_parser_get_option(raptor_parser *parser, raptor_option option, char** string_p, int* integer_p);
+
+/* parser utility methods */
+RAPTOR_API
+const char* raptor_parser_get_accept_header(raptor_parser* rdf_parser);
+RAPTOR_API
+raptor_world* raptor_parser_get_world(raptor_parser* rdf_parser);
+RAPTOR_API
+raptor_uri* raptor_parser_get_graph(raptor_parser* rdf_parser);
+
+
+/* Locator Class */
+/* methods */
+RAPTOR_API
+int raptor_locator_print(raptor_locator* locator, FILE *stream);
+RAPTOR_API
+int raptor_locator_format(char *buffer, size_t length, raptor_locator* locator);
+RAPTOR_API
+int raptor_locator_line(raptor_locator *locator);
+RAPTOR_API
+int raptor_locator_column(raptor_locator *locator);
+RAPTOR_API
+int raptor_locator_byte(raptor_locator *locator);
+RAPTOR_API
+const char* raptor_locator_file(raptor_locator *locator);
+RAPTOR_API
+const char* raptor_locator_uri(raptor_locator *locator);
+
+
+/* Serializer Class */
+RAPTOR_API
+raptor_serializer* raptor_new_serializer(raptor_world* world, const char *name);
+RAPTOR_API
+void raptor_free_serializer(raptor_serializer* rdf_serializer);
+
+/* methods */
+RAPTOR_API
+int raptor_serializer_start_to_iostream(raptor_serializer *rdf_serializer, raptor_uri *uri, raptor_iostream *iostream);
+RAPTOR_API
+int raptor_serializer_start_to_filename(raptor_serializer *rdf_serializer, const char *filename);
+RAPTOR_API
+int raptor_serializer_start_to_string(raptor_serializer *rdf_serializer, raptor_uri *uri, void **string_p, size_t *length_p);
+RAPTOR_API
+int raptor_serializer_start_to_file_handle(raptor_serializer *rdf_serializer, raptor_uri *uri, FILE *fh);
+RAPTOR_API
+int raptor_serializer_set_namespace(raptor_serializer* rdf_serializer, raptor_uri *uri, const unsigned char *prefix);
+RAPTOR_API
+int raptor_serializer_set_namespace_from_namespace(raptor_serializer* rdf_serializer, raptor_namespace *nspace);
+RAPTOR_API
+int raptor_serializer_serialize_statement(raptor_serializer* rdf_serializer, raptor_statement *statement);
+RAPTOR_API
+int raptor_serializer_serialize_end(raptor_serializer *rdf_serializer);
+RAPTOR_API
+raptor_iostream* raptor_serializer_get_iostream(raptor_serializer *serializer);
+RAPTOR_API
+raptor_locator* raptor_serializer_get_locator(raptor_serializer *rdf_serializer);
+RAPTOR_API
+int raptor_serializer_flush(raptor_serializer *rdf_serializer);
+RAPTOR_API
+const raptor_syntax_description* raptor_serializer_get_description(raptor_serializer *rdf_serializer);
+
+/* serializer option methods */
+RAPTOR_API
+int raptor_serializer_set_option(raptor_serializer *serializer, raptor_option option, const char* string, int integer);
+RAPTOR_API
+int raptor_serializer_get_option(raptor_serializer *serializer, raptor_option option, char** string_p, int* integer_p);
+
+/* utility methods */
+RAPTOR_API
+raptor_world* raptor_serializer_get_world(raptor_serializer* rdf_serializer);
+
+
+/* memory functions */
+RAPTOR_API
+void raptor_free_memory(void *ptr);
+RAPTOR_API
+void* raptor_alloc_memory(size_t size);
+RAPTOR_API
+void* raptor_calloc_memory(size_t nmemb, size_t size);
+
+
+/* URI Class */
+RAPTOR_API
+raptor_uri* raptor_new_uri_from_counted_string(raptor_world* world, const unsigned char *uri_string, size_t length);
+RAPTOR_API
+raptor_uri* raptor_new_uri(raptor_world* world, const unsigned char *uri_string);
+RAPTOR_API
+raptor_uri* raptor_new_uri_from_uri_local_name(raptor_world* world, raptor_uri *uri, const unsigned char *local_name);
+RAPTOR_API
+raptor_uri* raptor_new_uri_relative_to_base(raptor_world* world, raptor_uri *base_uri, const unsigned char *uri_string);
+RAPTOR_API
+raptor_uri* raptor_new_uri_relative_to_base_counted(raptor_world* world, raptor_uri *base_uri, const unsigned char *uri_string, size_t uri_len);
+RAPTOR_API
+raptor_uri* raptor_new_uri_from_id(raptor_world* world, raptor_uri *base_uri, const unsigned char *id);
+RAPTOR_API
+raptor_uri* raptor_new_uri_from_uri_or_file_string(raptor_world* world, raptor_uri* base_uri, const unsigned char* uri_or_file_string);
+RAPTOR_API
+raptor_uri* raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char *name);
+RAPTOR_API
+raptor_uri* raptor_new_uri_for_xmlbase(raptor_uri* old_uri);
+RAPTOR_API
+raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri);
+RAPTOR_API
+void raptor_free_uri(raptor_uri *uri);
+
+/* methods */
+RAPTOR_API
+int raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2);
+RAPTOR_API
+int raptor_uri_compare(raptor_uri* uri1, raptor_uri* uri2);
+RAPTOR_API
+raptor_uri* raptor_uri_copy(raptor_uri *uri);
+RAPTOR_API
+unsigned char* raptor_uri_as_string(raptor_uri *uri);
+RAPTOR_API
+unsigned char* raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_p);
+RAPTOR_API
+unsigned char* raptor_uri_to_relative_counted_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p);
+RAPTOR_API
+unsigned char* raptor_uri_to_relative_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri);
+RAPTOR_API
+int raptor_uri_print(const raptor_uri* uri, FILE *stream);
+RAPTOR_API
+unsigned char* raptor_uri_to_counted_string(raptor_uri *uri, size_t *len_p);
+RAPTOR_API
+unsigned char* raptor_uri_to_string(raptor_uri *uri);
+RAPTOR_API
+raptor_world* raptor_uri_get_world(raptor_uri *uri);
+RAPTOR_API
+int raptor_uri_file_exists(raptor_uri* uri);
+
+/* XML utility functions */
+RAPTOR_API
+int raptor_xml_escape_string_any(raptor_world* world, const unsigned char *string, size_t len, unsigned char *buffer, size_t length, char quote, int xml_version);
+RAPTOR_API
+int raptor_xml_escape_string_any_write(const unsigned char *string, size_t len, char quote, int xml_version, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_xml_escape_string(raptor_world *world, const unsigned char *string, size_t len, unsigned char *buffer, size_t length, char quote);
+RAPTOR_API
+int raptor_xml_escape_string_write(const unsigned char *string, size_t len, char quote, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_xml_name_check(const unsigned char *string, size_t length, int xml_version);
+
+
+/* portable vsnprintf utility function */
+RAPTOR_API RAPTOR_DEPRECATED
+char* raptor_vsnprintf(const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(1, 0);
+RAPTOR_API
+int raptor_vsnprintf2(char *buffer, size_t size, const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(3, 0);
+RAPTOR_API
+int raptor_snprintf(char *buffer, size_t size, const char *format, ...) RAPTOR_PRINTF_FORMAT(3, 4);
+RAPTOR_API
+int raptor_vasprintf(char **ret, const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(2, 0);
+
+/* RFC2396 URI resolving functions */
+RAPTOR_API
+size_t raptor_uri_resolve_uri_reference(const unsigned char *base_uri, const unsigned char *reference_uri, unsigned char* buffer, size_t length);
+
+/* URI String utility functions */
+RAPTOR_API
+unsigned char* raptor_uri_filename_to_uri_string(const char *filename);
+RAPTOR_API
+int raptor_uri_filename_exists(const unsigned char* path);
+RAPTOR_API
+char* raptor_uri_uri_string_to_filename(const unsigned char *uri_string);
+RAPTOR_API
+char* raptor_uri_uri_string_to_filename_fragment(const unsigned char *uri_string, unsigned char **fragment_p);
+RAPTOR_API
+int raptor_uri_uri_string_is_file_uri(const unsigned char* uri_string);
+RAPTOR_API
+int raptor_stringbuffer_append_uri_escaped_counted_string(raptor_stringbuffer* sb, const char* string, size_t length, int space_is_plus);
+RAPTOR_API
+char* raptor_uri_uri_string_to_counted_filename_fragment(const unsigned char *uri_string, size_t* len_p, unsigned char **fragment_p, size_t* fragment_len_p);
+
+
+/**
+ * RAPTOR_RDF_MS_URI:
+ *
+ * RDF Namespace URI (rdf:).
+ *
+ * Copy with raptor_uri_copy() to use.
+ */
+#define RAPTOR_RDF_MS_URI raptor_rdf_namespace_uri
+
+/**
+ * RAPTOR_RDF_SCHEMA_URI:
+ *
+ * RDF Schema Namespace URI (rdfs:).
+ *
+ * Copy with raptor_uri_copy() to use.
+ */
+#define RAPTOR_RDF_SCHEMA_URI raptor_rdf_schema_namespace_uri
+
+/**
+ * RAPTOR_XMLSCHEMA_DATATYPES_URI:
+ *
+ * XML Schema Datatypes URI (xsd:).
+ *
+ * Copy with raptor_uri_copy() to use.
+ */
+#define RAPTOR_XMLSCHEMA_DATATYPES_URI raptor_xmlschema_datatypes_namespace_uri
+
+/**
+ * RAPTOR_OWL_URI:
+ *
+ * OWL Namespace URI (owl:).
+ *
+ * Copy with raptor_uri_copy() to use.
+ */
+#define RAPTOR_OWL_URI raptor_owl_namespace_uri
+
+
+/* raptor_www */
+RAPTOR_API
+raptor_www* raptor_new_www(raptor_world* world);
+RAPTOR_API
+raptor_www* raptor_new_www_with_connection(raptor_world* world, void* connection);
+RAPTOR_API
+void raptor_free_www(raptor_www *www);
+RAPTOR_API
+int raptor_www_set_ssl_cert_options(raptor_www* www, const char* cert_filename, const char* cert_type, const char* cert_passphrase);
+RAPTOR_API
+int raptor_www_set_ssl_verify_options(raptor_www* www, int verify_peer, int verify_host);
+RAPTOR_API
+void raptor_www_set_user_agent(raptor_www *www, const char *user_agent);
+RAPTOR_API
+void raptor_www_set_proxy(raptor_www *www, const char *proxy);
+RAPTOR_API
+void raptor_www_set_http_accept(raptor_www *www, const char *value);
+RAPTOR_API
+void raptor_www_set_write_bytes_handler(raptor_www *www, raptor_www_write_bytes_handler handler, void *user_data);
+RAPTOR_API
+void raptor_www_set_content_type_handler(raptor_www *www, raptor_www_content_type_handler handler, void *user_data);
+RAPTOR_API
+void raptor_www_set_final_uri_handler(raptor_www* www, raptor_www_final_uri_handler handler, void *user_data);
+RAPTOR_API
+void raptor_www_set_uri_filter(raptor_www* www, raptor_uri_filter_func filter, void* user_data);
+RAPTOR_API
+void raptor_www_set_connection_timeout(raptor_www* www, int timeout);
+RAPTOR_API
+int raptor_www_set_http_cache_control(raptor_www* www, const char* cache_control);
+RAPTOR_API
+int raptor_www_fetch(raptor_www *www, raptor_uri *uri);
+RAPTOR_API
+int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler);
+RAPTOR_API
+void* raptor_www_get_connection(raptor_www *www);
+RAPTOR_API
+void raptor_www_abort(raptor_www *www, const char *reason);
+RAPTOR_API
+raptor_uri* raptor_www_get_final_uri(raptor_www* www);
+
+
+/* XML QNames Class */
+RAPTOR_API
+raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, const unsigned char *name, const unsigned char *value);
+RAPTOR_API
+raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_world* world, raptor_namespace *ns, const unsigned char *local_name, const unsigned char *value);
+
+/* methods */
+RAPTOR_API
+raptor_qname* raptor_qname_copy(raptor_qname *qname);
+RAPTOR_API
+void raptor_free_qname(raptor_qname* name);
+RAPTOR_API
+int raptor_qname_equal(raptor_qname *name1, raptor_qname *name2);
+RAPTOR_API
+unsigned char* raptor_qname_to_counted_name(raptor_qname *qname, size_t* length_p);
+RAPTOR_API
+const raptor_namespace* raptor_qname_get_namespace(raptor_qname* name);
+RAPTOR_API
+const unsigned char* raptor_qname_get_local_name(raptor_qname* name);
+RAPTOR_API
+const unsigned char* raptor_qname_get_value(raptor_qname* name);
+RAPTOR_API
+const unsigned char* raptor_qname_get_counted_value(raptor_qname* name, size_t* length_p);
+RAPTOR_API
+int raptor_qname_write(raptor_qname *qname, raptor_iostream* iostr);
+
+/* QName String utility functions */
+RAPTOR_API
+raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *nstack, const unsigned char *name, size_t name_len);
+
+/* XML Namespaces Stack class */
+RAPTOR_API
+raptor_namespace* raptor_new_namespace_from_uri(raptor_namespace_stack *nstack, const unsigned char *prefix, raptor_uri* ns_uri, int depth);
+RAPTOR_API
+raptor_namespace_stack* raptor_new_namespaces(raptor_world* world, int defaults);
+RAPTOR_API
+int raptor_namespaces_init(raptor_world* world, raptor_namespace_stack *nstack, int defaults);
+RAPTOR_API
+void raptor_namespaces_clear(raptor_namespace_stack *nstack);
+RAPTOR_API
+void raptor_free_namespaces(raptor_namespace_stack *nstack);
+
+/* methods */
+RAPTOR_API
+void raptor_namespaces_start_namespace(raptor_namespace_stack *nstack, raptor_namespace *nspace);
+RAPTOR_API
+int raptor_namespaces_start_namespace_full(raptor_namespace_stack *nstack, const unsigned char *prefix, const unsigned char *ns_uri_string, int depth);
+RAPTOR_API
+void raptor_namespaces_end_for_depth(raptor_namespace_stack *nstack, int depth);
+RAPTOR_API
+raptor_namespace* raptor_namespaces_get_default_namespace(raptor_namespace_stack *nstack);
+RAPTOR_API
+raptor_namespace* raptor_namespaces_find_namespace(raptor_namespace_stack *nstack, const unsigned char *prefix, int prefix_length);
+RAPTOR_API
+raptor_namespace* raptor_namespaces_find_namespace_by_uri(raptor_namespace_stack *nstack, raptor_uri *ns_uri);
+RAPTOR_API
+int raptor_namespaces_namespace_in_scope(raptor_namespace_stack *nstack, const raptor_namespace *nspace);
+RAPTOR_API
+raptor_qname* raptor_new_qname_from_namespace_uri(raptor_namespace_stack *nstack, raptor_uri *uri, int xml_version);
+
+
+/* XML Namespace Class */
+RAPTOR_API
+raptor_namespace* raptor_new_namespace(raptor_namespace_stack *nstack, const unsigned char *prefix, const unsigned char *ns_uri_string, int depth);
+RAPTOR_API
+void raptor_free_namespace(raptor_namespace *ns);
+RAPTOR_API
+int raptor_namespace_stack_start_namespace(raptor_namespace_stack *nstack, raptor_namespace *ns, int new_depth);
+RAPTOR_API
+raptor_uri* raptor_namespace_get_uri(const raptor_namespace *ns);
+RAPTOR_API
+const unsigned char* raptor_namespace_get_prefix(const raptor_namespace *ns);
+RAPTOR_API
+const unsigned char* raptor_namespace_get_counted_prefix(const raptor_namespace *ns, size_t *length_p);
+RAPTOR_API
+unsigned char* raptor_namespace_format_as_xml(const raptor_namespace *ns, size_t *length_p);
+RAPTOR_API
+int raptor_namespace_write(raptor_namespace *ns, raptor_iostream* iostr);
+
+/* namespace string utility function */
+RAPTOR_API
+int raptor_xml_namespace_string_parse(const unsigned char *string, unsigned char **prefix, unsigned char **uri_string);
+
+/* Sequence class */
+/**
+ * raptor_sequence:
+ *
+ * Raptor sequence class
+ */
+typedef struct raptor_sequence_s raptor_sequence;
+
+/* Sequence Class */
+RAPTOR_API
+raptor_sequence* raptor_new_sequence(raptor_data_free_handler free_handler, raptor_data_print_handler print_handler);
+RAPTOR_API
+raptor_sequence* raptor_new_sequence_with_context(raptor_data_context_free_handler free_handler, raptor_data_context_print_handler print_handler, void* handler_context);
+RAPTOR_API
+void raptor_free_sequence(raptor_sequence* seq);
+
+/* methods */
+RAPTOR_API
+int raptor_sequence_size(raptor_sequence* seq);
+RAPTOR_API
+int raptor_sequence_set_at(raptor_sequence* seq, int idx, void *data);
+RAPTOR_API
+int raptor_sequence_push(raptor_sequence* seq, void *data);
+RAPTOR_API
+int raptor_sequence_shift(raptor_sequence* seq, void *data);
+RAPTOR_API
+void* raptor_sequence_get_at(raptor_sequence* seq, int idx);
+RAPTOR_API
+void* raptor_sequence_pop(raptor_sequence* seq);
+RAPTOR_API
+void* raptor_sequence_unshift(raptor_sequence* seq);
+RAPTOR_API
+void* raptor_sequence_delete_at(raptor_sequence* seq, int idx);
+
+RAPTOR_API
+void raptor_sequence_sort(raptor_sequence* seq, raptor_data_compare_handler compare);
+RAPTOR_API
+int raptor_sequence_swap(raptor_sequence* seq, int i, int j);
+RAPTOR_API
+int raptor_sequence_reverse(raptor_sequence* seq, int start_index, int length);
+RAPTOR_API
+int raptor_sequence_next_permutation(raptor_sequence *seq, raptor_data_compare_handler compare);
+
+/* helper for printing sequences of strings */
+RAPTOR_API
+int raptor_sequence_print(raptor_sequence* seq, FILE* fh);
+RAPTOR_API
+int raptor_sequence_join(raptor_sequence* dest, raptor_sequence *src);
+
+
+/* Unicode and UTF8 */
+
+/**
+ * raptor_unichar:
+ *
+ * raptor Unicode codepoint
+ */
+typedef unsigned long raptor_unichar;
+RAPTOR_API
+int raptor_unicode_utf8_string_put_char(raptor_unichar c, unsigned char *output, size_t length);
+RAPTOR_API
+int raptor_unicode_utf8_string_get_char(const unsigned char *input, size_t length, raptor_unichar *output);
+RAPTOR_API
+int raptor_unicode_is_xml11_namestartchar(raptor_unichar c);
+RAPTOR_API
+int raptor_unicode_is_xml10_namestartchar(raptor_unichar c);
+RAPTOR_API
+int raptor_unicode_is_xml11_namechar(raptor_unichar c);
+RAPTOR_API
+int raptor_unicode_is_xml10_namechar(raptor_unichar c);
+RAPTOR_API
+int raptor_unicode_check_utf8_string(const unsigned char *string, size_t length);
+RAPTOR_API
+int raptor_unicode_utf8_strlen(const unsigned char *string, size_t length);
+RAPTOR_API
+size_t raptor_unicode_utf8_substr(unsigned char* dest, size_t* dest_length_p, const unsigned char* src, size_t src_length, int startingLoc, int length);
+
+/* Stringbuffer Class */
+RAPTOR_API
+raptor_stringbuffer* raptor_new_stringbuffer(void);
+RAPTOR_API
+void raptor_free_stringbuffer(raptor_stringbuffer *stringbuffer);
+
+/* methods */
+RAPTOR_API
+int raptor_stringbuffer_append_counted_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, size_t length, int do_copy);
+RAPTOR_API
+int raptor_stringbuffer_append_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, int do_copy);
+RAPTOR_API
+int raptor_stringbuffer_append_decimal(raptor_stringbuffer* stringbuffer, int integer);
+RAPTOR_API
+int raptor_stringbuffer_append_hexadecimal(raptor_stringbuffer* stringbuffer, int hex);
+RAPTOR_API
+int raptor_stringbuffer_append_stringbuffer(raptor_stringbuffer* stringbuffer, raptor_stringbuffer* append);
+RAPTOR_API
+int raptor_stringbuffer_prepend_counted_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, size_t length, int do_copy);
+RAPTOR_API
+int raptor_stringbuffer_prepend_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, int do_copy);
+RAPTOR_API
+unsigned char* raptor_stringbuffer_as_string(raptor_stringbuffer* stringbuffer);
+RAPTOR_API
+size_t raptor_stringbuffer_length(raptor_stringbuffer* stringbuffer);
+RAPTOR_API
+int raptor_stringbuffer_copy_to_string(raptor_stringbuffer* stringbuffer, unsigned char *string, size_t length);
+
+/**
+ * raptor_iostream_init_func:
+ * @context: stream context data
+ *
+ * Handler function for #raptor_iostream initialising.
+ *
+ * Return value: non-0 on failure.
+ */
+typedef int (*raptor_iostream_init_func) (void *context);
+
+/**
+ * raptor_iostream_finish_func:
+ * @context: stream context data
+ *
+ * Handler function for #raptor_iostream terminating.
+ *
+ */
+typedef void (*raptor_iostream_finish_func) (void *context);
+
+/**
+ * raptor_iostream_write_byte_func
+ * @context: stream context data
+ * @byte: byte to write
+ *
+ * Handler function for implementing raptor_iostream_write_byte().
+ *
+ * Return value: non-0 on failure.
+ */
+typedef int (*raptor_iostream_write_byte_func) (void *context, const int byte);
+
+/**
+ * raptor_iostream_write_bytes_func:
+ * @context: stream context data
+ * @ptr: pointer to bytes to write
+ * @size: size of item
+ * @nmemb: number of items
+ *
+ * Handler function for implementing raptor_iostream_write_bytes().
+ *
+ * Return value: non-0 on failure.
+ */
+typedef int (*raptor_iostream_write_bytes_func) (void *context, const void *ptr, size_t size, size_t nmemb);
+
+/**
+ * raptor_iostream_write_end_func:
+ * @context: stream context data
+ *
+ * Handler function for implementing raptor_iostream_write_end().
+ *
+ * Return value: non-0 on failure.
+ */
+typedef int (*raptor_iostream_write_end_func) (void *context);
+
+/**
+ * raptor_iostream_read_bytes_func:
+ * @context: stream context data
+ * @ptr: pointer to buffer to read into
+ * @size: size of buffer
+ * @nmemb: number of items
+ *
+ * Handler function for implementing raptor_iostream_read_bytes().
+ *
+ * Return value: number of items read, 0 or < @size on EOF, <0 on failure
+ */
+typedef int (*raptor_iostream_read_bytes_func) (void *context, void *ptr, size_t size, size_t nmemb);
+
+/**
+ * raptor_iostream_read_eof_func:
+ * @context: stream context data
+ *
+ * Handler function for implementing raptor_iostream_read_eof().
+ *
+ * Return value: non-0 if EOF
+ */
+typedef int (*raptor_iostream_read_eof_func) (void *context);
+
+/**
+ * raptor_iostream_handler:
+ * @version: interface version. Presently 1 or 2.
+ * @init: initialisation handler - optional, called at most once (V1)
+ * @finish: finishing handler - optional, called at most once (V1)
+ * @write_byte: write byte handler - required (for writing) (V1)
+ * @write_bytes: write bytes handler - required (for writing) (V1)
+ * @write_end: write end handler - optional (for writing), called at most once (V1)
+ * @read_bytes: read bytes handler - required (for reading) (V2)
+ * @read_eof: read EOF handler - required (for reading) (V2)
+ *
+ * I/O stream implementation handler structure.
+ *
+ */
+typedef struct {
+ int version;
+
+ /* V1 functions */
+ raptor_iostream_init_func init;
+ raptor_iostream_finish_func finish;
+ raptor_iostream_write_byte_func write_byte;
+ raptor_iostream_write_bytes_func write_bytes;
+ raptor_iostream_write_end_func write_end;
+
+ /* V2 functions */
+ raptor_iostream_read_bytes_func read_bytes;
+ raptor_iostream_read_eof_func read_eof;
+} raptor_iostream_handler;
+
+
+/* I/O Stream Class */
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_from_handler(raptor_world* world, void *user_data, const raptor_iostream_handler* const handler);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_to_sink(raptor_world* world);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_to_filename(raptor_world* world, const char *filename);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_to_file_handle(raptor_world* world, FILE *handle);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_to_string(raptor_world* world, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_from_sink(raptor_world* world);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_from_filename(raptor_world* world, const char *filename);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_from_file_handle(raptor_world* world, FILE *handle);
+RAPTOR_API
+raptor_iostream* raptor_new_iostream_from_string(raptor_world* world, void *string, size_t length);
+RAPTOR_API
+void raptor_free_iostream(raptor_iostream *iostr);
+
+RAPTOR_API
+int raptor_iostream_write_bytes(const void *ptr, size_t size, size_t nmemb, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_iostream_write_byte(const int byte, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_iostream_write_end(raptor_iostream *iostr);
+RAPTOR_API
+int raptor_iostream_string_write(const void *string, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_iostream_counted_string_write(const void *string, size_t len, raptor_iostream *iostr);
+RAPTOR_API
+unsigned long raptor_iostream_tell(raptor_iostream *iostr);
+RAPTOR_API
+int raptor_iostream_decimal_write(int integer, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_iostream_hexadecimal_write(unsigned int integer, int width, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_stringbuffer_write(raptor_stringbuffer *sb, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_uri_write(raptor_uri *uri, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_iostream_read_bytes(void *ptr, size_t size, size_t nmemb, raptor_iostream* iostr);
+RAPTOR_API
+int raptor_iostream_read_eof(raptor_iostream *iostr);
+
+/* I/O Stream utility functions */
+RAPTOR_API
+int raptor_string_ntriples_write(const unsigned char *string, size_t len, const char delim, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_bnodeid_ntriples_write(const unsigned char *bnodeid, size_t len, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_string_python_write(const unsigned char *string, size_t len, const char delim, int flags, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_statement_ntriples_write(const raptor_statement *statement, raptor_iostream* iostr, int write_graph_term);
+
+
+
+/* Parser and Serializer options */
+
+/**
+ * raptor_option_value_type:
+ * @RAPTOR_OPTION_VALUE_TYPE_BOOL: Boolean integer value. Non-0 is true
+ * @RAPTOR_OPTION_VALUE_TYPE_INT: Decimal integer value
+ * @RAPTOR_OPTION_VALUE_TYPE_STRING: String value
+ * @RAPTOR_OPTION_VALUE_TYPE_URI: URI String value.
+ * @RAPTOR_OPTION_VALUE_TYPE_LAST: internal
+ *
+ * Option value types.
+ */
+typedef enum {
+ RAPTOR_OPTION_VALUE_TYPE_BOOL,
+ RAPTOR_OPTION_VALUE_TYPE_INT,
+ RAPTOR_OPTION_VALUE_TYPE_STRING,
+ RAPTOR_OPTION_VALUE_TYPE_URI,
+ RAPTOR_OPTION_VALUE_TYPE_LAST = RAPTOR_OPTION_VALUE_TYPE_URI
+} raptor_option_value_type;
+
+
+/**
+ * raptor_option_description:
+ * @domain: domain ID
+ * @option: option ID
+ * @value_type: data type of option value
+ * @name: short name for option
+ * @name_len: length of @name
+ * @label: description of option
+ * @uri: URI identifying option
+ *
+ * Description of an option for a domain.
+ */
+typedef struct {
+ raptor_domain domain;
+ raptor_option option;
+ raptor_option_value_type value_type;
+ const char* name;
+ size_t name_len;
+ const char* label;
+ raptor_uri* uri;
+} raptor_option_description;
+
+
+RAPTOR_API
+unsigned int raptor_option_get_count(void);
+RAPTOR_API
+const char* raptor_option_get_value_type_label(const raptor_option_value_type type);
+RAPTOR_API
+void raptor_free_option_description(raptor_option_description* option_description);
+RAPTOR_API
+raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option);
+
+
+/* SAX2 element Class (raptor_xml_element) */
+RAPTOR_API
+raptor_xml_element* raptor_new_xml_element(raptor_qname* name, const unsigned char* xml_language, raptor_uri* xml_base);
+RAPTOR_API
+raptor_xml_element* raptor_new_xml_element_from_namespace_local_name(raptor_namespace *ns, const unsigned char *name, const unsigned char *xml_language, raptor_uri *xml_base);
+RAPTOR_API
+void raptor_free_xml_element(raptor_xml_element *element);
+
+/* methods */
+RAPTOR_API
+raptor_qname* raptor_xml_element_get_name(raptor_xml_element *xml_element);
+RAPTOR_API
+void raptor_xml_element_set_attributes(raptor_xml_element* xml_element, raptor_qname **attributes, int count);
+RAPTOR_API
+raptor_qname** raptor_xml_element_get_attributes(raptor_xml_element* xml_element);
+RAPTOR_API
+int raptor_xml_element_get_attributes_count(raptor_xml_element* xml_element);
+RAPTOR_API
+int raptor_xml_element_declare_namespace(raptor_xml_element* xml_element, raptor_namespace *nspace);
+RAPTOR_API
+int raptor_xml_element_write(raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, int depth, raptor_iostream *iostr);
+RAPTOR_API
+int raptor_xml_element_is_empty(raptor_xml_element* xml_element);
+RAPTOR_API
+const unsigned char* raptor_xml_element_get_language(raptor_xml_element* xml_element);
+
+
+/* XML Writer Class (raptor_xml_writer) */
+RAPTOR_API
+raptor_xml_writer* raptor_new_xml_writer(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr);
+RAPTOR_API
+void raptor_free_xml_writer(raptor_xml_writer* xml_writer);
+
+/* methods */
+RAPTOR_API
+void raptor_xml_writer_empty_element(raptor_xml_writer* xml_writer, raptor_xml_element *element);
+RAPTOR_API
+void raptor_xml_writer_start_element(raptor_xml_writer* xml_writer, raptor_xml_element *element);
+RAPTOR_API
+void raptor_xml_writer_end_element(raptor_xml_writer* xml_writer, raptor_xml_element *element);
+RAPTOR_API
+void raptor_xml_writer_newline(raptor_xml_writer* xml_writer);
+RAPTOR_API
+void raptor_xml_writer_cdata(raptor_xml_writer* xml_writer, const unsigned char *s);
+RAPTOR_API
+void raptor_xml_writer_cdata_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len);
+RAPTOR_API
+void raptor_xml_writer_raw(raptor_xml_writer* xml_writer, const unsigned char *s);
+RAPTOR_API
+void raptor_xml_writer_raw_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len);
+RAPTOR_API
+void raptor_xml_writer_comment(raptor_xml_writer* xml_writer, const unsigned char *s);
+RAPTOR_API
+void raptor_xml_writer_comment_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len);
+RAPTOR_API
+void raptor_xml_writer_flush(raptor_xml_writer* xml_writer);
+RAPTOR_API
+int raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer);
+RAPTOR_API
+int raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p);
+RAPTOR_API
+int raptor_xml_writer_get_depth(raptor_xml_writer *xml_writer);
+
+/**
+ * raptor_sax2_start_element_handler:
+ * @user_data: user data
+ * @xml_element: XML element
+ *
+ * SAX2 start element handler
+ */
+typedef void (*raptor_sax2_start_element_handler)(void *user_data, raptor_xml_element *xml_element);
+
+/**
+ * raptor_sax2_end_element_handler:
+ * @user_data: user data
+ * @xml_element: XML element
+ *
+ * SAX2 end element handler
+ */
+typedef void (*raptor_sax2_end_element_handler)(void *user_data, raptor_xml_element* xml_element);
+
+/**
+ * raptor_sax2_characters_handler:
+ * @user_data: user data
+ * @xml_element: XML element
+ * @s: string
+ * @len: string len
+ *
+ * SAX2 characters handler
+ */
+typedef void (*raptor_sax2_characters_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len);
+
+/**
+ * raptor_sax2_cdata_handler:
+ * @user_data: user data
+ * @xml_element: XML element
+ * @s: string
+ * @len: string len
+
+ * SAX2 CDATA section handler
+ */
+typedef void (*raptor_sax2_cdata_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len);
+
+/**
+ * raptor_sax2_comment_handler:
+ * @user_data: user data
+ * @xml_element: XML element
+ * @s: string
+ *
+ * SAX2 XML comment handler
+ */
+typedef void (*raptor_sax2_comment_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s);
+
+/**
+ * raptor_sax2_unparsed_entity_decl_handler:
+ * @user_data: user data
+ * @entityName: entity name
+ * @base: base URI
+ * @systemId: system ID
+ * @publicId: public ID
+ * @notationName: notation name
+ *
+ * SAX2 unparsed entity (NDATA) handler
+ */
+typedef void (*raptor_sax2_unparsed_entity_decl_handler)(void *user_data, const unsigned char* entityName, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId, const unsigned char* notationName);
+
+/**
+ * raptor_sax2_external_entity_ref_handler:
+ * @user_data: user data
+ * @context: context
+ * @base: base URI
+ * @systemId: system ID
+ * @publicId: public ID
+ *
+ * SAX2 external entity reference handler
+ *
+ * Return value: 0 if processing should not continue because of a
+ * fatal error in the handling of the external entity.
+ */
+typedef int (*raptor_sax2_external_entity_ref_handler)(void *user_data, const unsigned char* context, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId);
+
+
+/* SAX2 API */
+RAPTOR_API
+raptor_sax2* raptor_new_sax2(raptor_world *world, raptor_locator *locator, void* user_data);
+RAPTOR_API
+void raptor_free_sax2(raptor_sax2 *sax2);
+
+/* methods */
+RAPTOR_API
+void raptor_sax2_set_start_element_handler(raptor_sax2* sax2, raptor_sax2_start_element_handler handler);
+RAPTOR_API
+void raptor_sax2_set_end_element_handler(raptor_sax2* sax2, raptor_sax2_end_element_handler handler);
+RAPTOR_API
+void raptor_sax2_set_characters_handler(raptor_sax2* sax2, raptor_sax2_characters_handler handler);
+RAPTOR_API
+void raptor_sax2_set_cdata_handler(raptor_sax2* sax2, raptor_sax2_cdata_handler handler);
+RAPTOR_API
+void raptor_sax2_set_comment_handler(raptor_sax2* sax2, raptor_sax2_comment_handler handler);
+RAPTOR_API
+void raptor_sax2_set_unparsed_entity_decl_handler(raptor_sax2* sax2, raptor_sax2_unparsed_entity_decl_handler handler);
+RAPTOR_API
+void raptor_sax2_set_external_entity_ref_handler(raptor_sax2* sax2, raptor_sax2_external_entity_ref_handler handler);
+RAPTOR_API
+void raptor_sax2_set_namespace_handler(raptor_sax2* sax2, raptor_namespace_handler handler);
+RAPTOR_API
+void raptor_sax2_set_uri_filter(raptor_sax2* sax2, raptor_uri_filter_func filter, void *user_data);
+RAPTOR_API
+void raptor_sax2_parse_start(raptor_sax2 *sax2, raptor_uri *base_uri);
+RAPTOR_API
+int raptor_sax2_parse_chunk(raptor_sax2* sax2, const unsigned char *buffer, size_t len, int is_end);
+RAPTOR_API
+const unsigned char* raptor_sax2_inscope_xml_language(raptor_sax2* sax2);
+RAPTOR_API
+raptor_uri* raptor_sax2_inscope_base_uri(raptor_sax2* sax2);
+
+
+
+/* AVL Trees */
+
+/**
+ * raptor_avltree:
+ *
+ * AVL Tree
+ */
+typedef struct raptor_avltree_s raptor_avltree;
+
+/**
+ * raptor_avltree_iterator:
+ *
+ * AVL Tree Iterator as created by raptor_new_avltree_iterator()
+ */
+typedef struct raptor_avltree_iterator_s raptor_avltree_iterator;
+
+/**
+ * raptor_avltree_visit_handler:
+ * @depth: depth of object in tree
+ * @data: data object being visited
+ * @user_data: user data arg to raptor_avltree_visit()
+ *
+ * AVL Tree visitor function as given to raptor_avltree_visit()
+ *
+ * Return value: non-0 to terminate visit early.
+ */
+typedef int (*raptor_avltree_visit_handler)(int depth, void* data, void *user_data);
+
+
+/**
+ * raptor_avltree_bitflags:
+ * @RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES: If set raptor_avltree_add() will replace any duplicate items. If not set, raptor_avltree_add() will not replace them and will return status >0 when adding a duplicate. (Default is not set)
+ *
+ * Bit flags for AVL Tree class constructor raptor_new_avltree()
+ **/
+typedef enum {
+ RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES = 1
+} raptor_avltree_bitflags;
+
+
+RAPTOR_API
+raptor_avltree* raptor_new_avltree(raptor_data_compare_handler compare_handler, raptor_data_free_handler free_handler, unsigned int flags);
+RAPTOR_API
+void raptor_free_avltree(raptor_avltree* tree);
+
+/* methods */
+RAPTOR_API
+int raptor_avltree_add(raptor_avltree* tree, void* p_data);
+RAPTOR_API
+void* raptor_avltree_remove(raptor_avltree* tree, void* p_data);
+RAPTOR_API
+int raptor_avltree_delete(raptor_avltree* tree, void* p_data);
+RAPTOR_API
+void* raptor_avltree_search(raptor_avltree* tree, const void* p_data);
+RAPTOR_API
+int raptor_avltree_visit(raptor_avltree* tree, raptor_avltree_visit_handler visit_handler, void* user_data);
+RAPTOR_API
+int raptor_avltree_size(raptor_avltree* tree);
+RAPTOR_API
+void raptor_avltree_set_print_handler(raptor_avltree* tree, raptor_data_print_handler print_handler);
+RAPTOR_API
+int raptor_avltree_print(raptor_avltree* tree, FILE* stream);
+
+RAPTOR_API
+raptor_avltree_iterator* raptor_new_avltree_iterator(raptor_avltree* tree, void* range, raptor_data_free_handler range_free_handler, int direction);
+RAPTOR_API
+void raptor_free_avltree_iterator(raptor_avltree_iterator* iterator);
+
+RAPTOR_API
+int raptor_avltree_iterator_is_end(raptor_avltree_iterator* iterator);
+RAPTOR_API
+int raptor_avltree_iterator_next(raptor_avltree_iterator* iterator);
+RAPTOR_API
+void* raptor_avltree_iterator_get(raptor_avltree_iterator* iterator);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/* src/raptor_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* have to check C99 vsnprintf at runtime because cross compiling */
+#undef CHECK_VSNPRINTF_RUNTIME
+
+/* vsnprintf has C99 compatible return value */
+#undef HAVE_C99_VSNPRINTF
+
+/* Have curl/curl.h */
+#undef HAVE_CURL_CURL_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <fetch.h> header file. */
+#undef HAVE_FETCH_H
+
+/* Define to 1 if you have the `getopt' function. */
+#undef HAVE_GETOPT
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getopt_long' function. */
+#undef HAVE_GETOPT_LONG
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* INN parsedate function present */
+#undef HAVE_INN_PARSEDATE
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isascii' function. */
+#undef HAVE_ISASCII
+
+/* Define to 1 if you have the <libxml/hash.h> header file. */
+#define HAVE_LIBXML_HASH_H 1
+
+/* Define to 1 if you have the <libxml/HTMLparser.h> header file. */
+#define HAVE_LIBXML_HTMLPARSER_H 1
+
+/* Define to 1 if you have the <libxml/nanohttp.h> header file. */
+#define HAVE_LIBXML_NANOHTTP_H 1
+
+/* Define to 1 if you have the <libxml/parser.h> header file. */
+#define HAVE_LIBXML_PARSER_H 1
+
+/* Define to 1 if you have the <libxml/SAX2.h> header file. */
+#define HAVE_LIBXML_SAX2_H 1
+
+/* Define to 1 if you have the <libxslt/xslt.h> header file. */
+#define HAVE_LIBXSLT_XSLT_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <math.h> header file. */
+#define HAVE_MATH_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Raptor raptor_parse_date available */
+#undef HAVE_RAPTOR_PARSE_DATE
+
+/* Define to 1 if you have the `setjmp' function. */
+#undef HAVE_SETJMP
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#undef HAVE_SETJMP_H
+
+/* Define to 1 if you have the `stat' function. */
+#undef HAVE_STAT
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `stricmp' function. */
+#define HAVE_STRICMP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtok_r' function. */
+#undef HAVE_STRTOK_R
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `xmlCtxtUseOptions' function. */
+#define HAVE_XMLCTXTUSEOPTIONS 1
+
+/* Define to 1 if you have the `xmlSAX2InternalSubset' function. */
+#define HAVE_XMLSAX2INTERNALSUBSET 1
+
+/* YAJL has API version 2 */
+#undef HAVE_YAJL2
+
+/* Define to 1 if you have the <yajl/yajl_parse.h> header file. */
+#undef HAVE_YAJL_YAJL_PARSE_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Define to 1 if maintainer mode is enabled. */
+#undef MAINTAINER_MODE
+
+/* need 'extern int optind' declaration? */
+#undef NEED_OPTIND_DECLARATION
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if debug messages are enabled. */
+#undef RAPTOR_DEBUG
+
+/* Use ICU for Unicode NFC check */
+#undef RAPTOR_ICU_NFC
+
+/* does libxml struct xmlEntity have a field etype */
+#define RAPTOR_LIBXML_ENTITY_ETYPE 1
+
+/* does libxml struct xmlEntity have a field name_length */
+#undef RAPTOR_LIBXML_ENTITY_NAME_LENGTH
+
+/* does libxml have HTML_PARSE_NONET */
+#define RAPTOR_LIBXML_HTML_PARSE_NONET 1
+
+/* does libxml xmlSAXHandler have externalSubset field */
+#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET 1
+
+/* does libxml xmlSAXHandler have initialized field */
+#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED 1
+
+/* does libxml have XML_PARSE_NONET */
+#define RAPTOR_LIBXML_XML_PARSE_NONET 1
+
+/* Minimum supported package version */
+#define RAPTOR_MIN_VERSION_DECIMAL 20000
+
+/* Building GRDDL parser */
+#undef RAPTOR_PARSER_GRDDL
+
+/* Building guess parser */
+#undef RAPTOR_PARSER_GUESS
+
+/* Building JSON parser */
+#undef RAPTOR_PARSER_JSON
+
+/* Building N-Quads parser */
+#undef RAPTOR_PARSER_NQUADS
+
+/* Building N-Triples parser */
+#define RAPTOR_PARSER_NTRIPLES 1
+
+/* Building RDFA parser */
+#undef RAPTOR_PARSER_RDFA
+
+/* Building RDF/XML parser */
+#define RAPTOR_PARSER_RDFXML 1
+
+/* Building RSS Tag Soup parser */
+#undef RAPTOR_PARSER_RSS
+
+/* Building TRiG parser */
+#undef RAPTOR_PARSER_TRIG
+
+/* Building Turtle parser */
+#undef RAPTOR_PARSER_TURTLE
+
+/* Building Atom 1.0 serializer */
+#undef RAPTOR_SERIALIZER_ATOM
+
+/* Building GraphViz DOT serializer */
+#undef RAPTOR_SERIALIZER_DOT
+
+/* Building HTML Table serializer */
+#undef RAPTOR_SERIALIZER_HTML
+
+/* Building JSON serializer */
+#undef RAPTOR_SERIALIZER_JSON
+
+/* Building N-Quads serializer */
+#undef RAPTOR_SERIALIZER_NQUADS
+
+/* Building N-Triples serializer */
+#define RAPTOR_SERIALIZER_NTRIPLES 1
+
+/* Building RDF/XML serializer */
+#define RAPTOR_SERIALIZER_RDFXML 1
+
+/* Building RDF/XML-abbreviated serializer */
+#define RAPTOR_SERIALIZER_RDFXML_ABBREV 1
+
+/* Building RSS 1.0 serializer */
+#undef RAPTOR_SERIALIZER_RSS_1_0
+
+/* Building Turtle serializer */
+#undef RAPTOR_SERIALIZER_TURTLE
+
+/* Release version as a decimal */
+#define RAPTOR_VERSION_DECIMAL 20009
+
+/* Major version number */
+#define RAPTOR_VERSION_MAJOR 2
+
+/* Minor version number */
+#define RAPTOR_VERSION_MINOR 0
+
+/* Release version number */
+#define RAPTOR_VERSION_RELEASE 9
+
+/* Have libcurl WWW library */
+#undef RAPTOR_WWW_LIBCURL
+
+/* Have libfetch WWW library */
+#undef RAPTOR_WWW_LIBFETCH
+
+/* Have libxml available as a WWW library */
+#undef RAPTOR_WWW_LIBXML
+
+/* No WWW library */
+#define RAPTOR_WWW_NONE
+
+/* Check XML 1.1 Names */
+#undef RAPTOR_XML_1_1
+
+/* Use libxml XML parser */
+#define RAPTOR_XML_LIBXML 1
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#define VERSION "2.0.9"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+// from raptor_config_cmake.h.in ////////////////////////////////////////////
+
+#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
+# ifndef _CRT_NONSTDC_NO_DEPRECATE
+# define _CRT_NONSTDC_NO_DEPRECATE
+# endif
+# ifndef _CRT_SECURE_NO_DEPRECATE
+# define _CRT_SECURE_NO_DEPRECATE
+# endif
+
+# ifdef _MSC_VER
+# if _MSC_VER >= 1300
+# define __func__ __FUNCTION__
+# else
+ /* better than nothing */
+# define raptor_str(s) #s
+# define __func__ "func@" __FILE__ ":" raptor_str(__LINE__)
+# endif
+# endif
+
+# define RAPTOR_INLINE __inline
+
+# define S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
+# define S_ISDIR(mode) S_ISTYPE((mode), _S_IFDIR)
+# define S_ISREG(mode) S_ISTYPE((mode), _S_IFREG)
+
+ /* Mode bits for access() */
+# define R_OK 04
+# define W_OK 02
+
+# if !defined(HAVE_ACCESS) && defined(HAVE__ACCESS)
+# define access(p,m) _access(p,m)
+# endif
+# ifndef HAVE_STRCASECMP
+# if defined(HAVE__STRICMP)
+# define strcasecmp(a,b) _stricmp(a,b)
+# elif defined(HAVE_STRICMP)
+# define strcasecmp(a,b) stricmp(a,b)
+# endif
+# endif
+# if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
+# define snprintf _snprintf
+# endif
+# if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
+# define vsnprintf _vsnprintf
+# endif
+
+ /* These prevent parsedate.c from declaring malloc() and free() */
+# define YYMALLOC malloc
+# define YYFREE free
+#endif
+
+
--- /dev/null
+--- a/src/rasqal_literal.c 2013-03-29 21:22:57.413852072 +0100
++++ b/src/rasqal_literal.c 2013-03-29 21:23:34.092851757 +0100
+@@ -46,10 +46,22 @@
+ #include <stddef.h>
+ #endif
+ #include <stdarg.h>
++#ifdef _AIX
++# ifndef isnan
++# define isnan(x) \
++ (sizeof (x) == sizeof (long double) ? isnan_ld (x) \
++ : sizeof (x) == sizeof (double) ? isnan_d (x) \
++ : isnan_f (x))
++ static inline int isnan_f (float x) { return x != x; }
++ static inline int isnan_d (double x) { return x != x; }
++ static inline int isnan_ld (long double x) { return x != x; }
++# endif
++#else
+ /* for isnan() */
+ #ifdef HAVE_MATH_H
+ #include <math.h>
+ #endif
++#endif
+ /* for INT_MIN and INT_MAX */
+ #ifdef HAVE_LIMITS_H
+ #include <limits.h>
--- /dev/null
+No sonames on Android
+
+--- a/configure 2013-03-29 19:46:34.922901756 +0100
++++ b/configure 2013-03-29 19:46:56.051901574 +0100
+@@ -9809,7 +9809,7 @@
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+
--- /dev/null
+rhbz#809466 change soname of bundled redland libs
+
+--- a/src/Makefile.in 2013-03-29 21:44:58.115840724 +0100
++++ b/src/Makefile.in 2013-03-29 21:45:01.252840697 +0100
+@@ -621,7 +621,7 @@
+ $(am__append_2) $(am__append_3) $(am__append_4) \
+ $(am__append_5) $(am__append_6) $(am__append_8)
+ nodist_librasqal_la_SOURCES = $(am__append_7)
+-librasqal_la_LDFLAGS = -version-info @RASQAL_LIBTOOL_VERSION@
++librasqal_la_LDFLAGS = -version-info @RASQAL_LIBTOOL_VERSION@ -release lo
+ librasqal_la_LIBADD = @LTLIBOBJS@ @RASQAL_INTERNAL_LIBS@ @RASQAL_EXTERNAL_LIBS@ $(MEM_LIBS)
+ librasqal_la_DEPENDENCIES = @LTLIBOBJS@ @RASQAL_INTERNAL_LIBS@
+ EXTRA_DIST = \
--- /dev/null
+Usual patch to produce Linux-like .so files on FreeBSD
+
+--- a/build/ltmain.sh 2008-02-02 22:28:24.000000000 +0900
++++ b/build/ltmain.sh 2008-07-08 11:58:42.000000000 +0900
+@@ -7341,9 +7341,9 @@
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+- current="$number_major"
+- revision="$number_minor"
+- age="0"
++ current=`expr $number_major + $number_minor`
++ age="$number_minor"
++ revision="$number_revision"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+@@ -7420,8 +7420,8 @@
+ ;;
+
+ freebsd-elf)
+- major=".$current"
+- versuffix=".$current"
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
+ ;;
+
+ irix | nonstopux)
--- /dev/null
+MinGW: libtool falls back to static lib unless -no-undefined given
+
+--- a/src/Makefile.in 2013-03-29 21:44:58.115840724 +0100
++++ b/src/Makefile.in 2013-03-29 21:46:43.024839823 +0100
+@@ -621,7 +621,7 @@
+ $(am__append_2) $(am__append_3) $(am__append_4) \
+ $(am__append_5) $(am__append_6) $(am__append_8)
+ nodist_librasqal_la_SOURCES = $(am__append_7)
+-librasqal_la_LDFLAGS = -version-info @RASQAL_LIBTOOL_VERSION@
++librasqal_la_LDFLAGS = -version-info @RASQAL_LIBTOOL_VERSION@ -no-undefined
+ librasqal_la_LIBADD = @LTLIBOBJS@ @RASQAL_INTERNAL_LIBS@ @RASQAL_EXTERNAL_LIBS@ $(MEM_LIBS)
+ librasqal_la_DEPENDENCIES = @LTLIBOBJS@ @RASQAL_INTERNAL_LIBS@
+ EXTRA_DIST = \
--- /dev/null
+--- a/src/win32_rasqal_config.h Fri Jun 27 04:02:09 2008
++++ b/src/win32_rasqal_config.h Thu Nov 6 12:07:06 2008
+@@ -31,6 +31,7 @@
+ #endif
+
+ #define WIN32_LEAN_AND_MEAN 1
++#include <windows.h>
+
+ /* getopt is not in standard win32 C library - define if we have it */
+ /* #define HAVE_GETOPT_H 1 */
+@@ -37,10 +37,13 @@
+
+ #define HAVE_STDLIB_H 1
+
++#define HAVE_ERRNO_H 1
++
+ #define HAVE_STRICMP 1
+
+ /* MS names for these functions */
+-#define vsnprintf _vsnprintf
++// next line breaks build on wntmsci12
++//#define vsnprintf _vsnprintf
+ #define snprintf _snprintf
+ #define access _access
+ #define stricmp _stricmp
+@@ -101,7 +102,6 @@
+ * Defines that come from config.h
+ */
+
+-#include <windows.h>
+ #include <io.h>
+ #include <memory.h>
+
+@@ -116,8 +122,16 @@
+ /* #define RAPTOR_TRIPLES_SOURCE_REDLAND 1 */
+
+ /* Use PCRE regex library */
+-#define RASQAL_REGEX_PCRE 1
++//#define RASQAL_REGEX_PCRE 1
+
++#define HAVE_LIBXML_SCHEMASINTERNALS_H 1
++#define HAVE_LIBXML_XMLSCHEMASTYPES_H 1
++#define HAVE_LIBXML_XMLSCHEMAS_H 1
++
++#define RASQAL_DECIMAL_NONE 1
++#define RASQAL_UUID_INTERNAL 1
++#define RASQAL_DIGEST_INTERNAL 1
++
+ #ifdef _DEBUG
+ #define RASQAL_DEBUG 1
+ #endif
+--- a/src/rasqal_digest_md5.c 2013-04-01 00:18:47.913835564 +0200
++++ b/src/rasqal_digest_md5.c 2013-04-01 00:18:52.657835523 +0200
+@@ -50,7 +50,6 @@
+
+ #include <stdio.h>
+ #include <string.h>
+-#include <stdint.h>
+ #include <stdarg.h>
+
+ #include "rasqal.h"
+--- a/src/rasqal_digest_sha1.c 2013-04-01 00:19:04.655835420 +0200
++++ b/src/rasqal_digest_sha1.c 2013-04-01 00:19:10.448835370 +0200
+@@ -93,7 +93,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdarg.h>
+-#include <stdint.h>
+
+ #include "rasqal.h"
+ #include "rasqal_internal.h"
+--- a/src/rasqal_internal.h 2013-04-01 00:18:11.090835880 +0200
++++ b/src/rasqal_internal.h 2013-04-01 00:18:13.610835859 +0200
+@@ -26,6 +26,13 @@
+ #ifndef RASQAL_INTERNAL_H
+ #define RASQAL_INTERNAL_H
+
++#if defined(_MSC_VER) && _MSC_VER < 1600
++typedef unsigned __int32 uint32_t;
++typedef __int16 int16_t;
++#else
++#include <stdint.h>
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #define RASQAL_EXTERN_C extern "C"
--- /dev/null
+Let the pkg-config stuff be overridden by variables
+
+--- a/configure.ac 2013-03-29 23:57:59.782772145 +0100
++++ b/configure.ac 2013-03-30 00:09:41.823766113 +0100
+@@ -394,25 +394,15 @@
+ RAPTOR_MIN_VERSION=2.0.7
+
+
+-AC_CHECK_PROGS(PKG_CONFIG, pkg-config)
+-if test "X$PKG_CONFIG" = X; then
+- AC_MSG_ERROR(pkg-config not found. configuring raptor V2 requires it. Get it from http://pkg-config.freedesktop.org/)
+-fi
++PKG_PROG_PKG_CONFIG
+
+-AC_MSG_CHECKING(for raptor)
+-if $PKG_CONFIG raptor2 --exists; then
++PKG_CHECK_MODULES([RAPTOR2],[raptor2 >= $RAPTOR_MIN_VERSION],[
+ RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
+- AC_MSG_RESULT(system $RAPTOR_VERSION)
+-
+- if $PKG_CONFIG raptor2 --atleast-version=$RAPTOR_MIN_VERSION; then
+- :
+- else
+- AC_MSG_ERROR(Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION)
+- fi
+-else
+- AC_MSG_RESULT(not found)
++],[
+ AC_MSG_ERROR(Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION)
+-fi
++])
++AC_SUBST(RAPTOR2_CFLAGS)
++AC_SUBST(RAPTOR2_LIBS)
+
+ RAPTOR_VERSION_DEC=`echo $RAPTOR_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
+ AC_SUBST(RAPTOR_VERSION_DEC)
+@@ -879,8 +867,8 @@
+
+
+
+-RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS `$PKG_CONFIG raptor2 --cflags`"
+-RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS `$PKG_CONFIG raptor2 --libs`"
++RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS $RAPTOR2_CFLAGS"
++RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS $RAPTOR2_LIBS"
+ RAPPER_PATH=""
+
+ if test $need_regex_pcre = 1; then
+--- a/configure 2013-03-31 00:36:31.396795267 +0100
++++ b/configure 2013-03-31 00:36:42.820795169 +0100
+@@ -652,8 +652,6 @@
+ GTKDOC_MKPDF
+ GTKDOC_REBASE
+ GTKDOC_CHECK
+-PKG_CONFIG_LIBDIR
+-PKG_CONFIG_PATH
+ AM_BACKSLASH
+ AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V
+@@ -687,6 +685,10 @@
+ PCRE_CONFIG
+ RAPTOR_MIN_VERSION
+ RAPTOR_VERSION_DEC
++RAPTOR2_LIBS
++RAPTOR2_CFLAGS
++PKG_CONFIG_LIBDIR
++PKG_CONFIG_PATH
+ PKG_CONFIG
+ GETTIMEOFDAY_FALSE
+ GETTIMEOFDAY_TRUE
+@@ -872,6 +874,8 @@
+ PKG_CONFIG
+ PKG_CONFIG_PATH
+ PKG_CONFIG_LIBDIR
++RAPTOR2_CFLAGS
++RAPTOR2_LIBS
+ GTKDOC_DEPS_CFLAGS
+ GTKDOC_DEPS_LIBS'
+
+@@ -1554,6 +1558,10 @@
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
++ RAPTOR2_CFLAGS
++ C compiler flags for RAPTOR2, overriding pkg-config
++ RAPTOR2_LIBS
++ linker flags for RAPTOR2, overriding pkg-config
+ GTKDOC_DEPS_CFLAGS
+ C compiler flags for GTKDOC_DEPS, overriding pkg-config
+ GTKDOC_DEPS_LIBS
+@@ -13818,26 +13826,35 @@
+ RAPTOR_MIN_VERSION=2.0.7
+
+
+-for ac_prog in pkg-config
+-do
+- # Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
++
++
++
++
++
++
++
++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++ if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
++set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_PKG_CONFIG+:} false; then :
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+- if test -n "$PKG_CONFIG"; then
+- ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ case $PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in $PATH
+ do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_prog_PKG_CONFIG="$ac_prog"
++ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -13845,9 +13862,10 @@
+ done
+ IFS=$as_save_IFS
+
++ ;;
++esac
+ fi
+-fi
+-PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+ if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+ $as_echo "$PKG_CONFIG" >&6; }
+@@ -13857,31 +13875,158 @@
+ fi
+
+
+- test -n "$PKG_CONFIG" && break
++fi
++if test -z "$ac_cv_path_PKG_CONFIG"; then
++ ac_pt_PKG_CONFIG=$PKG_CONFIG
++ # Extract the first word of "pkg-config", so it can be a program name with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $ac_pt_PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
+ done
++ done
++IFS=$as_save_IFS
+
+-if test "X$PKG_CONFIG" = X; then
+- as_fn_error $? "pkg-config not found. configuring raptor V2 requires it. Get it from http://pkg-config.freedesktop.org/" "$LINENO" 5
++ ;;
++esac
++fi
++ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
++if test -n "$ac_pt_PKG_CONFIG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
++$as_echo "$ac_pt_PKG_CONFIG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for raptor" >&5
+-$as_echo_n "checking for raptor... " >&6; }
+-if $PKG_CONFIG raptor2 --exists; then
+- RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: system $RAPTOR_VERSION" >&5
+-$as_echo "system $RAPTOR_VERSION" >&6; }
+-
+- if $PKG_CONFIG raptor2 --atleast-version=$RAPTOR_MIN_VERSION; then
+- :
++ if test "x$ac_pt_PKG_CONFIG" = x; then
++ PKG_CONFIG=""
+ else
+- as_fn_error $? "Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION" "$LINENO" 5
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+ else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+-$as_echo "not found" >&6; }
++ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
++fi
++
++fi
++if test -n "$PKG_CONFIG"; then
++ _pkg_min_version=0.9.0
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ PKG_CONFIG=""
++ fi
++fi
++
++
++pkg_failed=no
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAPTOR2" >&5
++$as_echo_n "checking for RAPTOR2... " >&6; }
++
++if test -n "$RAPTOR2_CFLAGS"; then
++ pkg_cv_RAPTOR2_CFLAGS="$RAPTOR2_CFLAGS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RAPTOR2_CFLAGS=`$PKG_CONFIG --cflags "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++if test -n "$RAPTOR2_LIBS"; then
++ pkg_cv_RAPTOR2_LIBS="$RAPTOR2_LIBS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RAPTOR2_LIBS=`$PKG_CONFIG --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++
++
++
++if test $pkg_failed = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
++else
++ _pkg_short_errors_supported=no
++fi
++ if test $_pkg_short_errors_supported = yes; then
++ RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1`
++ else
++ RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$RAPTOR2_PKG_ERRORS" >&5
++
++
++ as_fn_error $? "Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
++
++elif test $pkg_failed = untried; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
+ as_fn_error $? "Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
++
++else
++ RAPTOR2_CFLAGS=$pkg_cv_RAPTOR2_CFLAGS
++ RAPTOR2_LIBS=$pkg_cv_RAPTOR2_LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++ RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
++
+ fi
+
++
++
+ RAPTOR_VERSION_DEC=`echo $RAPTOR_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
+
+
+@@ -14883,8 +15028,8 @@
+
+
+
+-RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS `$PKG_CONFIG raptor2 --cflags`"
+-RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS `$PKG_CONFIG raptor2 --libs`"
++RASQAL_INTERNAL_CPPFLAGS="$RASQAL_INTERNAL_CPPFLAGS $RAPTOR2_CFLAGS"
++RASQAL_EXTERNAL_LIBS="$RASQAL_EXTERNAL_LIBS $RAPTOR2_LIBS"
+ RAPPER_PATH=""
+
+ if test $need_regex_pcre = 1; then
+@@ -15579,126 +15724,6 @@
+
+
+
+-
+-
+-
+-
+-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+- if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- case $PKG_CONFIG in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+- done
+-IFS=$as_save_IFS
+-
+- ;;
+-esac
+-fi
+-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+-if test -n "$PKG_CONFIG"; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+-$as_echo "$PKG_CONFIG" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-fi
+-if test -z "$ac_cv_path_PKG_CONFIG"; then
+- ac_pt_PKG_CONFIG=$PKG_CONFIG
+- # Extract the first word of "pkg-config", so it can be a program name with args.
+-set dummy pkg-config; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- case $ac_pt_PKG_CONFIG in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+- done
+-IFS=$as_save_IFS
+-
+- ;;
+-esac
+-fi
+-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+-if test -n "$ac_pt_PKG_CONFIG"; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+- if test "x$ac_pt_PKG_CONFIG" = x; then
+- PKG_CONFIG=""
+- else
+- case $cross_compiling:$ac_tool_warned in
+-yes:)
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+-ac_tool_warned=yes ;;
+-esac
+- PKG_CONFIG=$ac_pt_PKG_CONFIG
+- fi
+-else
+- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+-fi
+-
+-fi
+-if test -n "$PKG_CONFIG"; then
+- _pkg_min_version=0.9.0
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+- else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- PKG_CONFIG=""
+- fi
+-fi
+-
+-
+-
+ # Extract the first word of "gtkdoc-check", so it can be a program name with args.
+ set dummy gtkdoc-check; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+--- a/utils/Makefile.am 2013-03-31 00:39:54.396793523 +0100
++++ b/utils/Makefile.am 2013-03-31 00:34:47.293796162 +0100
+@@ -37,22 +37,22 @@
+ roqet_SOURCES += getopt.c rasqal_getopt.h
+ endif
+ roqet_LDADD = $(top_builddir)/src/librasqal.la
+-roqet_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++roqet_LDFLAGS = @RAPTOR2_LIBS@
+
+ check_query_SOURCES = check_query.c
+ if GETOPT
+ check_query_SOURCES += getopt.c rasqal_getopt.h
+ endif
+ check_query_LDADD = $(top_builddir)/src/librasqal.la
+-check_query_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++check_query_LDFLAGS = @RAPTOR2_LIBS@
+
+ srxread_SOURCES = srxread.c
+ srxread_LDADD = $(top_builddir)/src/librasqal.la
+-srxread_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++srxread_LDFLAGS = @RAPTOR2_LIBS@
+
+ srxwrite_SOURCES = srxwrite.c
+ srxwrite_LDADD = $(top_builddir)/src/librasqal.la
+-srxwrite_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++srxwrite_LDFLAGS = @RAPTOR2_LIBS@
+
+ EXTRA_DIST= \
+ $(man_MANS) \
+--- a/utils/Makefile.in 2013-03-31 00:40:02.603793453 +0100
++++ b/utils/Makefile.in 2013-03-31 00:35:44.498795670 +0100
+@@ -359,16 +359,16 @@
+ AM_CFLAGS = $(MEM)
+ roqet_SOURCES = roqet.c $(am__append_1)
+ roqet_LDADD = $(top_builddir)/src/librasqal.la
+-roqet_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++roqet_LDFLAGS = @RAPTOR2_LIBS@
+ check_query_SOURCES = check_query.c $(am__append_2)
+ check_query_LDADD = $(top_builddir)/src/librasqal.la
+-check_query_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++check_query_LDFLAGS = @RAPTOR2_LIBS@
+ srxread_SOURCES = srxread.c
+ srxread_LDADD = $(top_builddir)/src/librasqal.la
+-srxread_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++srxread_LDFLAGS = @RAPTOR2_LIBS@
+ srxwrite_SOURCES = srxwrite.c
+ srxwrite_LDADD = $(top_builddir)/src/librasqal.la
+-srxwrite_LDFLAGS = `$(PKG_CONFIG) raptor2 --libs`
++srxwrite_LDFLAGS = @RAPTOR2_LIBS@
+ EXTRA_DIST = \
+ $(man_MANS) \
+ roqet.html
--- /dev/null
+No point in creating util or test executables when cross-compiling.
+(Especially as doing it anyway wouldn't work without tweaks to have it find
+libxml2 and libm, at least for Android.)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -358,7 +358,7 @@
+ top_srcdir = @top_srcdir@
+ noinst_SCRIPTS = rasqal-src-config
+ ACLOCAL_AMFLAGS = -I build
+-SUBDIRS = src utils tests docs data win32 scripts
++SUBDIRS = src docs data win32 scripts
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = rasqal.pc
+ EXTRA_DIST = \
--- /dev/null
+/* -*- Mode: c; c-basic-offset: 2 -*-
+ *
+ * rasqal.h - Rasqal RDF Query library interfaces and definition
+ *
+ * Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/
+ * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/
+ *
+ * This package is Free Software and part of Redland http://librdf.org/
+ *
+ * It is licensed under the following three licenses as alternatives:
+ * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
+ * 2. GNU General Public License (GPL) V2 or any newer version
+ * 3. Apache License, V2.0 or any newer version
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above three licenses.
+ *
+ * See LICENSE.html or LICENSE.txt at the top of this package for the
+ * complete terms and further detail along with the license texts for
+ * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
+ *
+ */
+
+
+
+#ifndef RASQAL_H
+#define RASQAL_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * RASQAL_VERSION:
+ *
+ * Rasqal library version number
+ *
+ * Format: major * 10000 + minor * 100 + release
+ */
+#define RASQAL_VERSION 930
+
+/**
+ * RASQAL_VERSION_STRING:
+ *
+ * Rasqal library version string
+ */
+#define RASQAL_VERSION_STRING "0.9.30"
+
+/**
+ * RASQAL_VERSION_MAJOR:
+ *
+ * Rasqal library major version
+ */
+#define RASQAL_VERSION_MAJOR 0
+
+/**
+ * RASQAL_VERSION_MINOR:
+ *
+ * Rasqal library minor version
+ */
+#define RASQAL_VERSION_MINOR 9
+
+/**
+ * RASQAL_VERSION_RELEASE:
+ *
+ * Rasqal library release
+ */
+#define RASQAL_VERSION_RELEASE 30
+
+
+/**
+ * RASQAL_API:
+ *
+ * Macro for wrapping API function call declarations.
+ *
+ */
+#ifndef RASQAL_API
+# ifdef WIN32
+# ifdef __GNUC__
+# undef _declspec
+# define _declspec(x) __declspec(x)
+# endif
+# ifdef RASQAL_STATIC
+# define RASQAL_API
+# else
+# ifdef RASQAL_INTERNAL
+# define RASQAL_API _declspec(dllexport)
+# else
+# define RASQAL_API _declspec(dllimport)
+# endif
+# endif
+# else
+# define RASQAL_API
+# endif
+#endif
+
+/* Use gcc 3.1+ feature to allow marking of deprecated API calls.
+ * This gives a warning during compiling.
+ */
+#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
+#define RASQAL_DEPRECATED __attribute__((deprecated))
+#else
+#define RASQAL_DEPRECATED
+#endif
+
+
+#ifndef LIBRDF_OBJC_FRAMEWORK
+#include <raptor.h>
+#else
+#include <Redland/raptor.h>
+#endif
+
+#if 0
+#include <sys/time.h>
+#endif
+#if 1
+#include <time.h>
+#endif
+
+/* Public statics */
+
+/**
+ * rasqal_short_copyright_string:
+ *
+ * Short copyright string (one line).
+ */
+RASQAL_API
+extern const char * const rasqal_short_copyright_string;
+
+/**
+ * rasqal_copyright_string:
+ *
+ * Copyright string (multiple lines).
+ */
+RASQAL_API
+extern const char * const rasqal_copyright_string;
+
+/**
+ * rasqal_version_string:
+ *
+ * Rasqal version as a string.
+ */
+RASQAL_API
+extern const char * const rasqal_version_string;
+
+/**
+ * rasqal_version_major:
+ *
+ * Rasqal major version number.
+ */
+RASQAL_API
+extern const unsigned int rasqal_version_major;
+
+/**
+ * rasqal_version_minor:
+ *
+ * Rasqal minor version number.
+ */
+RASQAL_API
+extern const unsigned int rasqal_version_minor;
+
+/**
+ * rasqal_version_release:
+ *
+ * Rasqal release version number.
+ */
+RASQAL_API
+extern const unsigned int rasqal_version_release;
+
+/**
+ * rasqal_version_decimal:
+ *
+ * Rasqal version as a decimal number.
+ *
+ * Format: major * 10000 + minor * 100 + release
+ */
+RASQAL_API
+extern const unsigned int rasqal_version_decimal;
+
+/**
+ * rasqal_license_string:
+ *
+ * Rasqal license string.
+ */
+RASQAL_API
+extern const char * const rasqal_license_string;
+
+/**
+ * rasqal_home_url_string:
+ *
+ * Rasqal home page URL.
+ */
+RASQAL_API
+extern const char * const rasqal_home_url_string;
+
+
+
+/**
+ * RASQAL_RAPTOR_VERSION:
+ *
+ * Version of Raptor that Rasqal was configured against.
+ */
+#define RASQAL_RAPTOR_VERSION 0
+
+
+/* Public structures */
+
+#ifndef RASQAL_WORLD_DECLARED
+#define RASQAL_WORLD_DECLARED 1
+/**
+ * rasqal_world:
+ *
+ * Rasqal world class.
+ */
+typedef struct rasqal_world_s rasqal_world;
+#endif
+
+/**
+ * rasqal_query:
+ *
+ * Rasqal query class.
+ */
+typedef struct rasqal_query_s rasqal_query;
+
+/**
+ * rasqal_query_results:
+ *
+ * Rasqal query results class.
+ */
+typedef struct rasqal_query_results_s rasqal_query_results;
+
+
+#ifndef RASQAL_QUERY_RESULTS_FORMATTER_DECLARED
+#define RASQAL_QUERY_RESULTS_FORMATTER_DECLARED 1
+/**
+ * rasqal_query_results_formatter:
+ *
+ * Rasqal query results formatter class.
+ */
+typedef struct rasqal_query_results_formatter_s rasqal_query_results_formatter;
+#endif
+
+
+typedef struct rasqal_literal_s rasqal_literal;
+
+/**
+ * rasqal_graph_pattern:
+ *
+ * Rasqal graph pattern class.
+ */
+typedef struct rasqal_graph_pattern_s rasqal_graph_pattern;
+
+
+/**
+ * rasqal_variables_table:
+ *
+ * Rasqal variables table class.
+ */
+typedef struct rasqal_variables_table_s rasqal_variables_table;
+
+
+/**
+ * rasqal_feature:
+ * @RASQAL_FEATURE_NO_NET: Deny network requests.
+ * @RASQAL_FEATURE_RAND_SEED: Set rand() / rand_r() seed
+ * @RASQAL_FEATURE_LAST: Internal.
+ *
+ * Query features.
+ *
+ * None currently defined.
+ */
+typedef enum {
+ RASQAL_FEATURE_NO_NET,
+ RASQAL_FEATURE_RAND_SEED,
+ RASQAL_FEATURE_LAST = RASQAL_FEATURE_RAND_SEED
+} rasqal_feature;
+
+
+/**
+ * rasqal_prefix:
+ * @world: rasqal_world object
+ * @prefix: short prefix string
+ * @uri: URI associated with the prefix.
+ * @declared: Internal flag.
+ * @depth: Internal flag.
+ *
+ * Namespace (prefix, uri) pair.
+ *
+ * Includes internal flags used for marking when prefixes are
+ * declared and at what XML element depth when used in XML formats.
+ */
+typedef struct {
+ rasqal_world* world;
+ const unsigned char *prefix;
+ raptor_uri* uri;
+ int declared;
+ int depth;
+} rasqal_prefix;
+
+
+/**
+ * rasqal_variable_type:
+ * @RASQAL_VARIABLE_TYPE_NORMAL: The regular variable type.
+ * @RASQAL_VARIABLE_TYPE_ANONYMOUS: Anonymous variable type.
+ * @RASQAL_VARIABLE_TYPE_UNKNOWN: Internal.
+ *
+ * Rasqal variable types.
+ *
+ * ANONYMOUS can be used in queries but cannot be returned in a
+ * result.
+ */
+typedef enum {
+ RASQAL_VARIABLE_TYPE_UNKNOWN = 0,
+ RASQAL_VARIABLE_TYPE_NORMAL = 1,
+ RASQAL_VARIABLE_TYPE_ANONYMOUS = 2
+} rasqal_variable_type;
+
+
+/* forward reference */
+struct rasqal_expression_s;
+
+/**
+ * rasqal_variable:
+ * @vars_table: variables table that owns this variable
+ * @name: Variable name.
+ * @value: Variable value or NULL if unbound.
+ * @offset: Internal.
+ * @type: Variable type.
+ * @expression: Expression when the variable is a computed SELECT expression
+ * @user_data: Pointer to user data associated with a variable. This is not used by rasqal.
+ * @usage: reference count
+ *
+ * Binding between a variable name and a value.
+ *
+ * Includes internal field @offset for recording the offset into the
+ * (internal) rasqal_query variables array.
+ */
+typedef struct {
+ rasqal_variables_table* vars_table;
+ const unsigned char *name;
+ rasqal_literal* value;
+ int offset;
+ rasqal_variable_type type;
+ struct rasqal_expression_s* expression;
+ void *user_data;
+ int usage;
+} rasqal_variable;
+
+
+/**
+ * rasqal_data_graph_flags:
+ * @RASQAL_DATA_GRAPH_NONE: Internal.
+ * @RASQAL_DATA_GRAPH_NAMED: Graphs with a source and name.
+ * @RASQAL_DATA_GRAPH_BACKGROUND: Graphs with a source only.
+ *
+ * Flags for the type of #rasqal_data_graph.
+ *
+ * These are used by rasqal_new_data_graph_from_uri() and
+ * rasqal_new_data_graph_from_iostream(). See #rasqal_data_graph.
+ */
+typedef enum {
+ RASQAL_DATA_GRAPH_NONE = 0,
+ RASQAL_DATA_GRAPH_NAMED = 1,
+ RASQAL_DATA_GRAPH_BACKGROUND = 2,
+} rasqal_data_graph_flags;
+
+
+/**
+ * rasqal_data_graph:
+ * @world: rasqal_world object
+ * @uri: source URI
+ * @name_uri: name of graph for %RASQAL_DATA_GRAPH_NAMED
+ * @flags: %RASQAL_DATA_GRAPH_NAMED or %RASQAL_DATA_GRAPH_BACKGROUND
+ * @format_type: MIME Type of data format at @uri (or NULL)
+ * @format_name: Raptor parser Name of data format at @uri (or NULL)
+ * @format_uri: URI of data format at @uri (or NULL)
+ * @iostr: Raptor iostream for content, overriding @uri if present (or NULL)
+ * @base_uri: base URI for reading from iostream
+ * @usage: usage count of this object
+ *
+ * A source of RDF data for querying.
+ *
+ * If @iostr is present, the graph can be constructed by parsing the
+ * iostream and using @base_uri as a base uri. Otherwise the graph
+ * can be constructed from the graph at URI @uri.
+ *
+ * In either case the @name_uri is the graph name as long as @flags
+ * is %RASQAL_DATA_GRAPH_NAMED
+ */
+typedef struct {
+ rasqal_world* world;
+ raptor_uri* uri;
+ raptor_uri* name_uri;
+ int flags;
+ char* format_type;
+ char* format_name;
+ raptor_uri* format_uri;
+ raptor_iostream* iostr;
+ raptor_uri* base_uri;
+ int usage;
+} rasqal_data_graph;
+
+
+/**
+ * rasqal_literal_type:
+ * @RASQAL_LITERAL_BLANK: RDF blank node literal (SPARQL r:bNode)
+ * @RASQAL_LITERAL_URI: RDF URI Literal (SPARQL r:URI)
+ * @RASQAL_LITERAL_STRING: RDF Plain Literal - no datatype (SPARQL r:Literal)
+ * @RASQAL_LITERAL_XSD_STRING: String xsd:string
+ * @RASQAL_LITERAL_BOOLEAN: Boolean literal xsd:boolean.
+ * @RASQAL_LITERAL_INTEGER: Integer literal xsd:integer.
+ * @RASQAL_LITERAL_DOUBLE: Double floating point literal xsd:double.
+ * @RASQAL_LITERAL_FLOAT: Floating point literal xsd:float.
+ * @RASQAL_LITERAL_DECIMAL: Decimal integer xsd:decimal.
+ * @RASQAL_LITERAL_DATETIME: Date/Time literal xsd:dateTime.
+ * @RASQAL_LITERAL_UDT: User defined typed literal with unknown datatype URI
+ * @RASQAL_LITERAL_PATTERN: Pattern literal for a regex.
+ * @RASQAL_LITERAL_QNAME: XML Qname literal.
+ * @RASQAL_LITERAL_VARIABLE: Variable literal.
+ * @RASQAL_LITERAL_DATE: Date literal xsd:date.
+ * @RASQAL_LITERAL_INTEGER_SUBTYPE: Internal.
+ * @RASQAL_LITERAL_UNKNOWN: Internal.
+ * @RASQAL_LITERAL_FIRST_XSD: Internal.
+ * @RASQAL_LITERAL_LAST_XSD: Internal.
+ * @RASQAL_LITERAL_LAST: Internal.
+ *
+ * Types of literal.
+ *
+ * The order in the enumeration is significant as it encodes
+ * the SPARQL term ordering conditions:
+ *
+ * Blank Nodes << IRIs << RDF literals << typed literals
+ *
+ * which coresponds to in enum values
+ *
+ * BLANK << URI << STRING <<
+ * (BOOLEAN | INTEGER | DOUBLE | FLOAT | DECIMAL | DATETIME | XSD_STRING)
+ *
+ * (RASQAL_LITERAL_FIRST_XSD ... RASQAL_LITERAL_LAST_XSD)
+ *
+ * Not used (internal): PATTERN, QNAME, VARIABLE
+ *
+ * See rasqal_literal_compare() when used with flags
+ * %RASQAL_COMPARE_XQUERY
+ */
+typedef enum {
+ /* internal */
+ RASQAL_LITERAL_UNKNOWN,
+ RASQAL_LITERAL_BLANK,
+ RASQAL_LITERAL_URI,
+ RASQAL_LITERAL_STRING,
+ RASQAL_LITERAL_XSD_STRING,
+ RASQAL_LITERAL_BOOLEAN,
+ RASQAL_LITERAL_INTEGER,
+ RASQAL_LITERAL_FLOAT,
+ RASQAL_LITERAL_DOUBLE,
+ RASQAL_LITERAL_DECIMAL,
+ RASQAL_LITERAL_DATETIME,
+ /* internal */
+ RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_XSD_STRING,
+ /* internal */
+ RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME,
+ RASQAL_LITERAL_UDT,
+ RASQAL_LITERAL_PATTERN,
+ RASQAL_LITERAL_QNAME,
+ RASQAL_LITERAL_VARIABLE,
+ /* internal */
+ RASQAL_LITERAL_INTEGER_SUBTYPE,
+ RASQAL_LITERAL_DATE,
+ /* internal */
+ RASQAL_LITERAL_LAST = RASQAL_LITERAL_DATE
+} rasqal_literal_type;
+
+#define RASQAL_LITERAL_UDT_DEFINED 1
+
+
+/**
+ * rasqal_row:
+ *
+ * Rasqal Result Row class.
+ */
+typedef struct rasqal_row_s rasqal_row;
+
+
+/**
+ * rasqal_xsd_decimal:
+ *
+ * Rasqal XSD Decimal class.
+ */
+typedef struct rasqal_xsd_decimal_s rasqal_xsd_decimal;
+
+
+/**
+ * RASQAL_XSD_DATETIME_NO_TZ:
+ *
+ * Sentinel XSD Decimal timezone value indicating no timezone is present.
+ */
+#define RASQAL_XSD_DATETIME_NO_TZ (9999)
+
+/**
+ * rasqal_xsd_date:
+ * @year: year
+ * @month: month 1-12
+ * @day: 1-31
+ * @timezone_minutes: minutes +/- against UTC or RASQAL_XSD_DATETIME_NO_TZ if there is no timezone in the dateTime.
+ * @time_on_timeline: time on timeline of first instant of date in timezone
+ * @have_tz: timezone flag: 'Z' if Zulu, 'Y' if has other timezone offset in @timezone_minutes, 'N' if there is no timezone
+ *
+ * XML schema date datatype (xsd:date)
+ *
+ * Examples of timezone fields:
+ * "2010-01-02" : timezone_minutes RASQAL_XSD_DATETIME_NO_TZ, have_tz 'N'
+ * "2010-01-02Z" : timezone_minutes 0, have_tz 'Z'
+ * "2010-01-02+00:00" : timezone_minutes 0, have_tz 'Y'
+ * "2010-01-02-01:00" : timezone_minutes -60, have_tz 'Y'
+ */
+typedef struct {
+ signed int year;
+ /* the following fields are integer values not characters */
+ unsigned char month;
+ unsigned char day;
+ signed short timezone_minutes;
+ time_t time_on_timeline;
+ char have_tz;
+} rasqal_xsd_date;
+
+
+/**
+ * rasqal_xsd_datetime:
+ * @year: year
+ * @month: month 1-12
+ * @day: 1-31
+ * @hour: hour 0-23
+ * @minute: minute 0-59
+ * @second: second 0-60 (yes 60 is allowed for leap seconds)
+ * @microseconds: microseconds
+ * @timezone_minutes: minutes +/- against UTC or RASQAL_XSD_DATETIME_NO_TZ if there is no timezone in the dateTime.
+ * @time_on_timeline: time on timeline
+ * @have_tz: timezone flag: 'Z' if Zulu, 'Y' if has other timezone offset in @timezone_minutes, 'N' if there is no timezone
+ *
+ * XML Schema dateTime datatype (xsd:dateTime)
+ *
+ * Signed types are required for normalization process where a value
+ * can be negative temporarily.
+ *
+ * Examples of timezone fields:
+ * "2010-01-02T01:02:03" : timezone_minutes RASQAL_XSD_DATETIME_NO_TZ, have_tz 'N'
+ * "2010-01-02T01:02:03Z" : timezone_minutes 0, have_tz 'Z'
+ * "2010-01-02T01:02:03+00:00" : timezone_minutes 0, have_tz 'Y'
+ * "2010-01-02T01:02:03-01:00" : timezone_minutes -60, have_tz 'Y'
+ */
+typedef struct {
+ signed int year;
+ unsigned char month;
+ unsigned char day;
+ /* the following fields are integer values not characters */
+ signed char hour;
+ signed char minute;
+ signed char second;
+ signed int microseconds;
+ signed short timezone_minutes;
+ time_t time_on_timeline;
+ char have_tz;
+} rasqal_xsd_datetime;
+
+
+/**
+ * rasqal_literal:
+ * @world: world object pointer
+ * @usage: Usage count.
+ * @type: Type of literal.
+ * @string: String form of literal for literal types UTF-8 string, pattern, qname, blank, double, float, decimal, datetime.
+ * @string_len: Length of @string.
+ * @value: Alternate value content.
+ * @language: Language for string literal type.
+ * @datatype: Datatype for string literal type.
+ * @flags: Flags for literal types
+ * @parent_type: parent XSD type if any or RASQAL_LITERAL_UNKNOWN
+ * @valid: >0 if literal format is a valid lexical form for this datatype. 0 if not valid. <0 if this has not been checked yet
+ *
+ * Rasqal literal class.
+ *
+ */
+struct rasqal_literal_s {
+ rasqal_world *world;
+
+ int usage;
+
+ rasqal_literal_type type;
+
+ /* UTF-8 string, pattern, qname, blank, double, float, decimal, datetime */
+ const unsigned char *string;
+ unsigned int string_len;
+
+ union {
+ /* integer and boolean types */
+ int integer;
+ /* double and float */
+ double floating;
+ /* uri (can be temporarily NULL if a qname, see flags below) */
+ raptor_uri* uri;
+ /* variable */
+ rasqal_variable* variable;
+ /* decimal */
+ rasqal_xsd_decimal* decimal;
+ /* datetime */
+ rasqal_xsd_datetime* datetime;
+ /* date */
+ rasqal_xsd_date* date;
+ } value;
+
+ /* for string */
+ const char *language;
+ raptor_uri *datatype;
+
+ /* various flags for literal types:
+ * pattern regex flags
+ * string datatype of qname
+ * uri qname of URI not yet expanded (temporary)
+ */
+ const unsigned char *flags;
+
+ rasqal_literal_type parent_type;
+
+ int valid;
+};
+
+
+/**
+ * rasqal_op:
+ * @RASQAL_EXPR_AND: Expression for AND(A, B)
+ * @RASQAL_EXPR_OR: Expression for OR(A, B)
+ * @RASQAL_EXPR_EQ: Expression for A equals B
+ * @RASQAL_EXPR_NEQ: Expression for A not equals B.
+ * @RASQAL_EXPR_LT: Expression for A less than B.
+ * @RASQAL_EXPR_GT: Expression for A greather than B.
+ * @RASQAL_EXPR_LE: Expression for A less than or equal to B.
+ * @RASQAL_EXPR_GE: Expression for A greater than or equal to B.
+ * @RASQAL_EXPR_UMINUS: Expression for -A.
+ * @RASQAL_EXPR_PLUS: Expression for +A.
+ * @RASQAL_EXPR_MINUS: Expression for A-B.
+ * @RASQAL_EXPR_STAR: Expression for A*B.
+ * @RASQAL_EXPR_SLASH: Expression for A/B.
+ * @RASQAL_EXPR_REM: Expression for A/B remainder.
+ * @RASQAL_EXPR_STR_EQ: Expression for A string equals B.
+ * @RASQAL_EXPR_STR_NEQ: Expression for A string not-equals B.
+ * @RASQAL_EXPR_STR_MATCH: Expression for string A matches literal regex B with flags.
+ * @RASQAL_EXPR_STR_NMATCH: Expression for string A not-matches literal regex B with flags.
+ * @RASQAL_EXPR_REGEX: Expression for string A matches expression regex B with flags.
+ * @RASQAL_EXPR_TILDE: Expression for binary not A.
+ * @RASQAL_EXPR_BANG: Expression for logical not A.
+ * @RASQAL_EXPR_LITERAL: Expression for a #rasqal_literal.
+ * @RASQAL_EXPR_FUNCTION: Expression for a function A with arguments (B...).
+ * @RASQAL_EXPR_BOUND: Expression for SPARQL ISBOUND(A).
+ * @RASQAL_EXPR_STR: Expression for SPARQL STR(A).
+ * @RASQAL_EXPR_LANG: Expression for SPARQL LANG(A).
+ * @RASQAL_EXPR_LANGMATCHES: Expression for SPARQL LANGMATCHES(A, B).
+ * @RASQAL_EXPR_DATATYPE: Expression for SPARQL DATATYPE(A).
+ * @RASQAL_EXPR_ISURI: Expression for SPARQL ISURI(A).
+ * @RASQAL_EXPR_ISBLANK: Expression for SPARQL ISBLANK(A).
+ * @RASQAL_EXPR_ISLITERAL: Expression for SPARQL ISLITERAL(A).
+ * @RASQAL_EXPR_CAST: Expression for cast literal A to type B.
+ * @RASQAL_EXPR_ORDER_COND_ASC: Expression for SPARQL order condition ascending.
+ * @RASQAL_EXPR_ORDER_COND_DESC: Expression for SPARQL order condition descending.
+ * @RASQAL_EXPR_GROUP_COND_ASC: Obsolete - not used
+ * @RASQAL_EXPR_GROUP_COND_DESC: Obsolete - not used
+ * @RASQAL_EXPR_COUNT: Expression for LAQRS select COUNT() aggregate function
+ * @RASQAL_EXPR_VARSTAR: Expression for LAQRS select Variable *
+ * @RASQAL_EXPR_SAMETERM: Expression for SPARQL sameTerm
+ * @RASQAL_EXPR_SUM: Expression for LAQRS select SUM() aggregate function
+ * @RASQAL_EXPR_AVG: Expression for LAQRS select AVG() aggregate function
+ * @RASQAL_EXPR_MIN: Expression for LAQRS select MIN() aggregate function
+ * @RASQAL_EXPR_MAX: Expression for LAQRS select MAX() aggregate function
+ * @RASQAL_EXPR_COALESCE: Expression for LAQRS COALESCE(Expr+)
+ * @RASQAL_EXPR_IF: Expression for LAQRS IF(expr, expr, expr)
+ * @RASQAL_EXPR_URI: Expression for LAQRS URI(expr)
+ * @RASQAL_EXPR_IRI: Expression for LAQRS IRI(expr)
+ * @RASQAL_EXPR_STRLANG: Expression for LAQRS STRLANG(expr, expr)
+ * @RASQAL_EXPR_STRDT: Expression for LAQRS STRDT(expr, expr)
+ * @RASQAL_EXPR_BNODE: Expression for LAQRS BNODE() and BNODE(expr)
+ * @RASQAL_EXPR_GROUP_CONCAT: Expression for LAQRS GROUP_CONCAT(arglist) aggregate function
+ * @RASQAL_EXPR_SAMPLE: Expression for LAQRS SAMPLE(expr) aggregate function
+ * @RASQAL_EXPR_IN: Expression for LAQRS expr IN ( list of expr )
+ * @RASQAL_EXPR_NOT_IN: Expression for LAQRS expr NOT IN ( list of expr )
+ * @RASQAL_EXPR_ISNUMERIC: Expression for SPARQL 1.1 isNUMERIC(expr)
+ * @RASQAL_EXPR_YEAR: Expression for SPARQL 1.1 YEAR(datetime)
+ * @RASQAL_EXPR_MONTH: Expression for SPARQL 1.1 MONTH(datetime)
+ * @RASQAL_EXPR_DAY: Expression for SPARQL 1.1 DAY(datetime)
+ * @RASQAL_EXPR_HOURS: Expression for SPARQL 1.1 HOURS(datetime)
+ * @RASQAL_EXPR_MINUTES: Expression for SPARQL 1.1 MINUTES(datetime)
+ * @RASQAL_EXPR_SECONDS: Expression for SPARQL 1.1 SECONDS(datetime)
+ * @RASQAL_EXPR_TIMEZONE: Expression for SPARQL 1.1 TIMEZONE(datetime)
+ * @RASQAL_EXPR_CURRENT_DATETIME: Expression for LAQRS CURRENT_DATETIME( void )
+ * @RASQAL_EXPR_NOW: Expression for LAQRS NOW( void )
+ * @RASQAL_EXPR_FROM_UNIXTIME: Expression for LAQRS FROM_UNIXTIME(int)
+ * @RASQAL_EXPR_TO_UNIXTIME: Expression for LAQRS TO_UNIXTIME(datetime)
+ * @RASQAL_EXPR_CONCAT: Expression for SPARQL 1.1 CONCAT(strings)
+ * @RASQAL_EXPR_STRLEN: Expression for SPARQL 1.1 STRLEN(str)
+ * @RASQAL_EXPR_SUBSTR: Expression for SPARQL 1.1 SUBSTR(str, start[,offset])
+ * @RASQAL_EXPR_UCASE: Expression for SPARQL 1.1 UCASE(str)
+ * @RASQAL_EXPR_LCASE: Expression for SPARQL 1.1 LCASE(str)
+ * @RASQAL_EXPR_STRSTARTS: Expression for SPARQL 1.1 STRSTARTS(str, str)
+ * @RASQAL_EXPR_STRENDS: Expression for SPARQL 1.1 STRENDS(str, str)
+ * @RASQAL_EXPR_CONTAINS: Expression for SPARQL 1.1 CONTAINS(str, str)
+ * @RASQAL_EXPR_ENCODE_FOR_URI: Expression for SPARQL 1.1 ENCODE_FOR_URI(str)
+ * @RASQAL_EXPR_TZ: Expression for SPARQL 1.1 TZ()
+ * @RASQAL_EXPR_RAND: Expression for SPARQL 1.1 RAND()
+ * @RASQAL_EXPR_ABS: Expression for SPARQL 1.1 ABS()
+ * @RASQAL_EXPR_ROUND: Expression for SPARQL 1.1 ROUND()
+ * @RASQAL_EXPR_CEIL: Expression for SPARQL 1.1 CEIL()
+ * @RASQAL_EXPR_FLOOR: Expression for SPARQL 1.1 FLOOR()
+ * @RASQAL_EXPR_MD5: Expression for SPARQL 1.1 MD5()
+ * @RASQAL_EXPR_SHA1: Expression for SPARQL 1.1 SHA1()
+ * @RASQAL_EXPR_SHA224: Expression for SPARQL 1.1 SHA224()
+ * @RASQAL_EXPR_SHA256: Expression for SPARQL 1.1 SHA256()
+ * @RASQAL_EXPR_SHA384: Expression for SPARQL 1.1 SHA384()
+ * @RASQAL_EXPR_SHA512: Expression for SPARQL 1.1 SHA512()
+ * @RASQAL_EXPR_STRBEFORE: Expression for SPARQL 1.1 STRBEFORE()
+ * @RASQAL_EXPR_STRAFTER: Expression for SPARQL 1.1 STRAFTER()
+ * @RASQAL_EXPR_REPLACE: Expression for SPARQL 1.1 REPLACE()
+ * @RASQAL_EXPR_UUID: Expression for SPARQL 1.1 UUID()
+ * @RASQAL_EXPR_STRUUID: Expression for SPARQL 1.1 STRUUID()
+ * @RASQAL_EXPR_UNKNOWN: Internal
+ * @RASQAL_EXPR_LAST: Internal
+ *
+ * Rasqal expression operators. A mixture of unary, binary and
+ * tertiary operators (string matches). Also includes casting and
+ * two ordering operators from ORDER BY in SPARQL.
+ */
+typedef enum {
+ /* internal */
+ RASQAL_EXPR_UNKNOWN,
+ RASQAL_EXPR_AND,
+ RASQAL_EXPR_OR,
+ RASQAL_EXPR_EQ,
+ RASQAL_EXPR_NEQ,
+ RASQAL_EXPR_LT,
+ RASQAL_EXPR_GT,
+ RASQAL_EXPR_LE,
+ RASQAL_EXPR_GE,
+ RASQAL_EXPR_UMINUS,
+ RASQAL_EXPR_PLUS,
+ RASQAL_EXPR_MINUS,
+ RASQAL_EXPR_STAR,
+ RASQAL_EXPR_SLASH,
+ RASQAL_EXPR_REM,
+ RASQAL_EXPR_STR_EQ,
+ RASQAL_EXPR_STR_NEQ,
+ RASQAL_EXPR_STR_MATCH,
+ RASQAL_EXPR_STR_NMATCH,
+ RASQAL_EXPR_TILDE,
+ RASQAL_EXPR_BANG,
+ RASQAL_EXPR_LITERAL,
+ RASQAL_EXPR_FUNCTION,
+ RASQAL_EXPR_BOUND,
+ RASQAL_EXPR_STR,
+ RASQAL_EXPR_LANG,
+ RASQAL_EXPR_DATATYPE,
+ RASQAL_EXPR_ISURI,
+ RASQAL_EXPR_ISBLANK,
+ RASQAL_EXPR_ISLITERAL,
+ RASQAL_EXPR_CAST,
+ RASQAL_EXPR_ORDER_COND_ASC,
+ RASQAL_EXPR_ORDER_COND_DESC,
+ RASQAL_EXPR_LANGMATCHES,
+ RASQAL_EXPR_REGEX,
+ RASQAL_EXPR_GROUP_COND_ASC,
+ RASQAL_EXPR_GROUP_COND_DESC,
+ RASQAL_EXPR_COUNT,
+ RASQAL_EXPR_VARSTAR,
+ RASQAL_EXPR_SAMETERM,
+ RASQAL_EXPR_SUM,
+ RASQAL_EXPR_AVG,
+ RASQAL_EXPR_MIN,
+ RASQAL_EXPR_MAX,
+ RASQAL_EXPR_COALESCE,
+ RASQAL_EXPR_IF,
+ RASQAL_EXPR_URI,
+ RASQAL_EXPR_IRI,
+ RASQAL_EXPR_STRLANG,
+ RASQAL_EXPR_STRDT,
+ RASQAL_EXPR_BNODE,
+ RASQAL_EXPR_GROUP_CONCAT,
+ RASQAL_EXPR_SAMPLE,
+ RASQAL_EXPR_IN,
+ RASQAL_EXPR_NOT_IN,
+ RASQAL_EXPR_ISNUMERIC,
+ RASQAL_EXPR_YEAR,
+ RASQAL_EXPR_MONTH,
+ RASQAL_EXPR_DAY,
+ RASQAL_EXPR_HOURS,
+ RASQAL_EXPR_MINUTES,
+ RASQAL_EXPR_SECONDS,
+ RASQAL_EXPR_TIMEZONE,
+ RASQAL_EXPR_CURRENT_DATETIME,
+ RASQAL_EXPR_NOW,
+ RASQAL_EXPR_FROM_UNIXTIME,
+ RASQAL_EXPR_TO_UNIXTIME,
+ RASQAL_EXPR_CONCAT,
+ RASQAL_EXPR_STRLEN,
+ RASQAL_EXPR_SUBSTR,
+ RASQAL_EXPR_UCASE,
+ RASQAL_EXPR_LCASE,
+ RASQAL_EXPR_STRSTARTS,
+ RASQAL_EXPR_STRENDS,
+ RASQAL_EXPR_CONTAINS,
+ RASQAL_EXPR_ENCODE_FOR_URI,
+ RASQAL_EXPR_TZ,
+ RASQAL_EXPR_RAND,
+ RASQAL_EXPR_ABS,
+ RASQAL_EXPR_ROUND,
+ RASQAL_EXPR_CEIL,
+ RASQAL_EXPR_FLOOR,
+ RASQAL_EXPR_MD5,
+ RASQAL_EXPR_SHA1,
+ RASQAL_EXPR_SHA224,
+ RASQAL_EXPR_SHA256,
+ RASQAL_EXPR_SHA384,
+ RASQAL_EXPR_SHA512,
+ RASQAL_EXPR_STRBEFORE,
+ RASQAL_EXPR_STRAFTER,
+ RASQAL_EXPR_REPLACE,
+ RASQAL_EXPR_UUID,
+ RASQAL_EXPR_STRUUID,
+ /* internal */
+ RASQAL_EXPR_LAST = RASQAL_EXPR_STRUUID
+} rasqal_op;
+
+
+/**
+ * rasqal_expression_flags:
+ * @RASQAL_EXPR_FLAG_DISTINCT: Distinct
+ * @RASQAL_EXPR_FLAG_AGGREGATE: Aggregate function expression
+ *
+ * Flags for expressions.
+ */
+typedef enum {
+ RASQAL_EXPR_FLAG_DISTINCT = 1,
+ RASQAL_EXPR_FLAG_AGGREGATE = 2
+} rasqal_expression_flags;
+
+
+/**
+ * rasqal_expression:
+ * @world: rasqal_world object
+ * @usage: reference count - 1 for itself
+ * @op: expression operation
+ * @arg1: first argument
+ * @arg2: second argument
+ * @arg3: third argument (for #RASQAL_EXPR_REGEX )
+ * @literal: literal argument
+ * @value: UTF-8 value
+ * @name: name for extension function qname(args...) and cast-to-uri
+ * @args: args for extension function qname(args...), cast-to-uri and COALESCE
+ * @params: args for extension function parameters (SPARQL 1.1) (Rasqal 0.9.20+)
+ * @flags: bitflags from #rasqal_expression_flags for expressions (Rasqal 0.9.20+)
+ *
+ * Expression with arguments
+ *
+ */
+struct rasqal_expression_s {
+ rasqal_world* world;
+
+ int usage;
+
+ rasqal_op op;
+
+ struct rasqal_expression_s* arg1;
+ struct rasqal_expression_s* arg2;
+ struct rasqal_expression_s* arg3;
+ rasqal_literal* literal;
+ unsigned char *value;
+
+ raptor_uri* name;
+ raptor_sequence* args;
+
+ raptor_sequence* params;
+ unsigned int flags;
+ struct rasqal_expression_s* arg4;
+};
+typedef struct rasqal_expression_s rasqal_expression;
+
+
+/**
+ * rasqal_triple:
+ * @subject: Triple subject.
+ * @predicate: Triple predicate.
+ * @object: Triple object.
+ * @origin: Triple origin.
+ * @flags: Or of enum #rasqal_triple_flags bits.
+ *
+ * A triple pattern or RDF triple.
+ *
+ * This is used as a triple pattern in queries and
+ * an RDF triple when generating RDF triples such as with SPARQL CONSTRUCT.
+ */
+typedef struct {
+ rasqal_literal* subject;
+ rasqal_literal* predicate;
+ rasqal_literal* object;
+ rasqal_literal* origin;
+ unsigned int flags;
+} rasqal_triple;
+
+
+/**
+ * rasqal_pattern_flags:
+ * @RASQAL_PATTERN_FLAGS_OPTIONAL: True when the graph pattern is an optional match.
+ * @RASQAL_PATTERN_FLAGS_LAST: Internal
+ *
+ * Flags for #rasqal_graph_pattern.
+ */
+typedef enum {
+ RASQAL_PATTERN_FLAGS_OPTIONAL = 1,
+
+ RASQAL_PATTERN_FLAGS_LAST = RASQAL_PATTERN_FLAGS_OPTIONAL
+} rasqal_pattern_flags;
+
+
+/**
+ * rasqal_generate_bnodeid_handler:
+ * @world: world arg
+ * @user_data: user data given to
+ * @user_bnodeid: user blank node ID string passed in
+ *
+ * User handler used with rasqal_world_set_generate_bnodeid_handler() to set method for generating a blank node ID.
+ *
+ * Return value: blank node ID string or NULL on failure.
+ */
+typedef unsigned char* (*rasqal_generate_bnodeid_handler)(rasqal_world* world, void *user_data, unsigned char *user_bnodeid);
+
+
+/**
+ * rasqal_query_verb:
+ * @RASQAL_QUERY_VERB_SELECT: SPARQL query select verb.
+ * @RASQAL_QUERY_VERB_CONSTRUCT: SPARQL query construct verb.
+ * @RASQAL_QUERY_VERB_DESCRIBE: SPARQL query describe verb.
+ * @RASQAL_QUERY_VERB_ASK: SPARQL query ask verb.
+ * @RASQAL_QUERY_VERB_DELETE: LAQRS query delete verb.
+ * @RASQAL_QUERY_VERB_INSERT: LAQRS query insert verb.
+ * @RASQAL_QUERY_VERB_UPDATE: SPARQL 1.1 (draft) update operation
+ * @RASQAL_QUERY_VERB_UNKNOWN: Internal
+ * @RASQAL_QUERY_VERB_LAST: Internal
+ *
+ * Query main operation verbs describing the major type of query
+ * being performed.
+ */
+typedef enum {
+ /* internal */
+ RASQAL_QUERY_VERB_UNKNOWN = 0,
+ RASQAL_QUERY_VERB_SELECT = 1,
+ RASQAL_QUERY_VERB_CONSTRUCT = 2,
+ RASQAL_QUERY_VERB_DESCRIBE = 3,
+ RASQAL_QUERY_VERB_ASK = 4,
+ RASQAL_QUERY_VERB_DELETE = 5,
+ RASQAL_QUERY_VERB_INSERT = 6,
+ RASQAL_QUERY_VERB_UPDATE = 7,
+
+ /* internal */
+ RASQAL_QUERY_VERB_LAST = RASQAL_QUERY_VERB_UPDATE
+} rasqal_query_verb;
+
+
+/**
+ * rasqal_query_results_type:
+ * @RASQAL_QUERY_RESULTS_BINDINGS: variable binding
+ * @RASQAL_QUERY_RESULTS_BOOLEAN: a single boolean
+ * @RASQAL_QUERY_RESULTS_GRAPH: an RDF graph
+ * @RASQAL_QUERY_RESULTS_SYNTAX: a syntax
+ * @RASQAL_QUERY_RESULTS_UNKNOWN: unknown type
+ *
+ * Query result type.
+ */
+
+typedef enum {
+ RASQAL_QUERY_RESULTS_BINDINGS,
+ RASQAL_QUERY_RESULTS_BOOLEAN,
+ RASQAL_QUERY_RESULTS_GRAPH,
+ RASQAL_QUERY_RESULTS_SYNTAX,
+ RASQAL_QUERY_RESULTS_UNKNOWN
+} rasqal_query_results_type;
+
+
+/**
+ * rasqal_update_type:
+ * @RASQAL_UPDATE_TYPE_CLEAR: Clear graph.
+ * @RASQAL_UPDATE_TYPE_CREATE: Create graph.
+ * @RASQAL_UPDATE_TYPE_DROP: Drop graph.
+ * @RASQAL_UPDATE_TYPE_LOAD: Load graph.
+ * @RASQAL_UPDATE_TYPE_UPDATE: Insert or Delete graph or triples.
+ * @RASQAL_UPDATE_TYPE_ADD: Add graph to another graph.
+ * @RASQAL_UPDATE_TYPE_MOVE: Move graph to another grpah.
+ * @RASQAL_UPDATE_TYPE_COPY: Copy graph to another graph.
+ * @RASQAL_UPDATE_TYPE_UNKNOWN: Internal
+ * @RASQAL_UPDATE_TYPE_LAST: Internal
+ *
+ * Update type being performed.
+ *
+ */
+typedef enum {
+ /* internal */
+ RASQAL_UPDATE_TYPE_UNKNOWN = 0,
+ RASQAL_UPDATE_TYPE_CLEAR = 1,
+ RASQAL_UPDATE_TYPE_CREATE = 2,
+ RASQAL_UPDATE_TYPE_DROP = 3,
+ RASQAL_UPDATE_TYPE_LOAD = 4,
+ RASQAL_UPDATE_TYPE_UPDATE = 5,
+ RASQAL_UPDATE_TYPE_ADD = 6,
+ RASQAL_UPDATE_TYPE_MOVE = 7,
+ RASQAL_UPDATE_TYPE_COPY = 8,
+
+ /* internal */
+ RASQAL_UPDATE_TYPE_LAST = RASQAL_UPDATE_TYPE_COPY
+} rasqal_update_type;
+
+
+/**
+ * rasqal_update_flags:
+ * @RASQAL_UPDATE_FLAGS_SILENT: the update operation should be silent
+ * @RASQAL_UPDATE_FLAGS_DATA: the update operation is triple data not templates
+ *
+ * Bitflags for graph update operations
+ */
+typedef enum {
+ RASQAL_UPDATE_FLAGS_SILENT = 1,
+ RASQAL_UPDATE_FLAGS_DATA = 2
+} rasqal_update_flags;
+
+
+/**
+ * rasqal_update_graph_applies:
+ * @RASQAL_UPDATE_GRAPH_ONE: the update operation applies to 1 graph
+ * @RASQAL_UPDATE_GRAPH_DEFAULT: the update operation applies to the default graph
+ * @RASQAL_UPDATE_GRAPH_NAMED: the update operation applies to all named graphs
+ * @RASQAL_UPDATE_GRAPH_ALL: the update operation applies ALL graphs
+ *
+ * The graph(s) that the update operation applies to.
+ */
+typedef enum {
+ RASQAL_UPDATE_GRAPH_ONE = 0,
+ RASQAL_UPDATE_GRAPH_DEFAULT = 1,
+ RASQAL_UPDATE_GRAPH_NAMED = 2,
+ RASQAL_UPDATE_GRAPH_ALL = 3
+} rasqal_update_graph_applies;
+
+
+/**
+ * rasqal_update_operation:
+ * @type: type of update
+ * @graph_uri: optional graph URI (clear, drop, load, with ... delete, insert); source graph (add, move, copy)
+ * @document_uri: optional document URI (load); destination graph (add, move, copy)
+ * @insert_templates: optional sequence of #rasqal_triple to insert. Data triples if @flags is #RASQAL_UPDATE_FLAGS_DATA set, templates otherwise.
+ * @delete_templates: optional sequence of #rasqal_triple templates to delete
+ * @where: optional where template (insert/delete)
+ * @flags: update flags - bit-or of flags defined in #rasqal_update_flags
+ * @applies: the graph(s) that the update operation applies to, or @graph_uri if #RASQAL_UPDATE_GRAPH_ONE
+ *
+ * Update operation - changing the dataset
+ *
+ * For LOAD and CLEAR if @applies is set (not 0) then the operation
+ * applies to just those graph(), otherwise it applies to the @graph_uri.
+ *
+ * For ADD, MOVE and COPY the source graph is stored in @graph_uri
+ * field and the destination graph in the @document_uri field. The
+ * field names have no meaning in this case since both values are
+ * always present, always graphs and a NULL value signifies the
+ * default graph.
+ *
+ */
+typedef struct {
+ rasqal_update_type type;
+
+ raptor_uri* graph_uri;
+
+ raptor_uri* document_uri;
+
+ raptor_sequence* insert_templates;
+
+ raptor_sequence* delete_templates;
+
+ rasqal_graph_pattern* where;
+
+ int flags;
+
+ rasqal_update_graph_applies applies;
+} rasqal_update_operation;
+
+
+/**
+ * rasqal_graph_pattern_operator:
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_BASIC: Just triple patterns and constraints.
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL: Set of graph patterns (ANDed) and constraints.
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_UNION: Set of graph patterns (UNIONed) and constraints.
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_GROUP: Set of graph patterns (ANDed) and constraints.
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH: A graph term + a graph pattern and constraints.
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_FILTER: A filter graph pattern with an expression
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_LET: LET ?var := Expression (LAQRS)
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_SELECT: SELECT graph pattern
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_SERVICE: SERVICE graph pattern
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_MINUS: MINUS graph pattern
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_UNKNOWN: Internal.
+ * @RASQAL_GRAPH_PATTERN_OPERATOR_LAST: Internal.
+ *
+ * Graph pattern operators
+ */
+typedef enum {
+ RASQAL_GRAPH_PATTERN_OPERATOR_UNKNOWN = 0,
+ RASQAL_GRAPH_PATTERN_OPERATOR_BASIC = 1,
+ RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL = 2,
+ RASQAL_GRAPH_PATTERN_OPERATOR_UNION = 3,
+ RASQAL_GRAPH_PATTERN_OPERATOR_GROUP = 4,
+ RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH = 5,
+ RASQAL_GRAPH_PATTERN_OPERATOR_FILTER = 6,
+ RASQAL_GRAPH_PATTERN_OPERATOR_LET = 7,
+ RASQAL_GRAPH_PATTERN_OPERATOR_SELECT = 8,
+ RASQAL_GRAPH_PATTERN_OPERATOR_SERVICE = 9,
+ RASQAL_GRAPH_PATTERN_OPERATOR_MINUS = 10,
+
+ RASQAL_GRAPH_PATTERN_OPERATOR_LAST = RASQAL_GRAPH_PATTERN_OPERATOR_MINUS
+} rasqal_graph_pattern_operator;
+
+
+/**
+ * rasqal_graph_pattern_visit_fn:
+ * @query: #rasqal_query containing the graph pattern
+ * @gp: current graph_pattern
+ * @user_data: user data passed in
+ *
+ * User function to visit an graph_pattern and operate on it with
+ * rasqal_graph_pattern_visit() or rasqal_query_graph_pattern_visit()
+ *
+ * Return value: non-0 to truncate the visit
+ */
+typedef int (*rasqal_graph_pattern_visit_fn)(rasqal_query* query, rasqal_graph_pattern* gp, void *user_data);
+
+
+/* RASQAL API */
+
+/* Public functions */
+
+RASQAL_API
+rasqal_world *rasqal_new_world(void);
+RASQAL_API
+int rasqal_world_open(rasqal_world* world);
+RASQAL_API
+void rasqal_free_world(rasqal_world* world);
+
+RASQAL_API
+void rasqal_world_set_raptor(rasqal_world* world, raptor_world* raptor_world_ptr);
+RASQAL_API
+raptor_world *rasqal_world_get_raptor(rasqal_world* world);
+
+RASQAL_API
+void rasqal_world_set_log_handler(rasqal_world* world, void *user_data, raptor_log_handler handler);
+
+RASQAL_API
+int rasqal_world_set_default_generate_bnodeid_parameters(rasqal_world* world, char *prefix, int base);
+RASQAL_API
+int rasqal_world_set_generate_bnodeid_handler(rasqal_world* world, void *user_data, rasqal_generate_bnodeid_handler handler);
+
+RASQAL_API
+int rasqal_world_set_warning_level(rasqal_world* world, unsigned int warning_level);
+
+RASQAL_API
+const raptor_syntax_description* rasqal_world_get_query_results_format_description(rasqal_world* world, unsigned int counter);
+
+RASQAL_API
+const char* rasqal_world_guess_query_results_format_name(rasqal_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier);
+
+/* Features */
+RASQAL_API
+int rasqal_features_enumerate(rasqal_world* world, const rasqal_feature feature, const char **name, raptor_uri **uri, const char **label);
+RASQAL_API
+unsigned int rasqal_get_feature_count(void);
+RASQAL_API
+rasqal_feature rasqal_feature_from_uri(rasqal_world* world, raptor_uri *uri);
+RASQAL_API
+int rasqal_feature_value_type(const rasqal_feature feature);
+
+
+RASQAL_API
+const raptor_syntax_description* rasqal_world_get_query_language_description(rasqal_world* world, unsigned int counter);
+
+RASQAL_API RASQAL_DEPRECATED
+int rasqal_languages_enumerate(rasqal_world* world, unsigned int counter, const char **name, const char **label, const unsigned char **uri_string);
+
+RASQAL_API
+int rasqal_language_name_check(rasqal_world* world, const char *name);
+
+
+/* Query class */
+
+/* Create */
+RASQAL_API
+rasqal_query* rasqal_new_query(rasqal_world* world, const char *name, const unsigned char *uri);
+
+/* Destroy */
+RASQAL_API
+void rasqal_free_query(rasqal_query* query);
+
+/* Methods */
+RASQAL_API
+const char* rasqal_query_get_name(rasqal_query* query);
+RASQAL_API
+const char* rasqal_query_get_label(rasqal_query* query);
+
+
+RASQAL_API
+int rasqal_query_set_feature(rasqal_query* query, rasqal_feature feature, int value);
+RASQAL_API
+int rasqal_query_set_feature_string(rasqal_query *query, rasqal_feature feature, const unsigned char *value);
+RASQAL_API
+int rasqal_query_get_feature(rasqal_query *query, rasqal_feature feature);
+RASQAL_API
+const unsigned char* rasqal_query_get_feature_string(rasqal_query *query, rasqal_feature feature);
+
+RASQAL_API
+rasqal_query_verb rasqal_query_get_verb(rasqal_query* query);
+RASQAL_API
+int rasqal_query_get_wildcard(rasqal_query* query);
+RASQAL_API
+void rasqal_query_set_wildcard(rasqal_query* query, int wildcard);
+RASQAL_API
+int rasqal_query_get_distinct(rasqal_query* query);
+RASQAL_API
+void rasqal_query_set_distinct(rasqal_query* query, int distinct_mode);
+RASQAL_API
+int rasqal_query_get_explain(rasqal_query* query);
+RASQAL_API
+void rasqal_query_set_explain(rasqal_query* query, int is_explain);
+RASQAL_API
+int rasqal_query_get_limit(rasqal_query* query);
+RASQAL_API
+void rasqal_query_set_limit(rasqal_query* query, int limit);
+RASQAL_API
+int rasqal_query_get_offset(rasqal_query* query);
+RASQAL_API
+void rasqal_query_set_offset(rasqal_query* query, int offset);
+
+RASQAL_API
+int rasqal_query_add_data_graph(rasqal_query* query, rasqal_data_graph* data_graph);
+RASQAL_API
+int rasqal_query_add_data_graphs(rasqal_query* query, raptor_sequence* data_graphs);
+
+RASQAL_API
+raptor_sequence* rasqal_query_get_data_graph_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_data_graph* rasqal_query_get_data_graph(rasqal_query* query, int idx);
+RASQAL_API
+int rasqal_query_dataset_contains_named_graph(rasqal_query* query, raptor_uri *graph_uri);
+
+RASQAL_API
+int rasqal_query_add_variable(rasqal_query* query, rasqal_variable* var);
+RASQAL_API
+raptor_sequence* rasqal_query_get_bound_variable_sequence(rasqal_query* query);
+RASQAL_API
+raptor_sequence* rasqal_query_get_describe_sequence(rasqal_query* query);
+RASQAL_API
+raptor_sequence* rasqal_query_get_anonymous_variable_sequence(rasqal_query* query);
+RASQAL_API
+raptor_sequence* rasqal_query_get_all_variable_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_variable* rasqal_query_get_variable(rasqal_query* query, int idx);
+RASQAL_API
+int rasqal_query_has_variable2(rasqal_query* query, rasqal_variable_type type, const unsigned char *name);
+RASQAL_API RASQAL_DEPRECATED
+int rasqal_query_has_variable(rasqal_query* query, const unsigned char *name);
+RASQAL_API
+int rasqal_query_set_variable2(rasqal_query* query, rasqal_variable_type type, const unsigned char *name, rasqal_literal* value);
+RASQAL_API RASQAL_DEPRECATED
+int rasqal_query_set_variable(rasqal_query* query, const unsigned char *name, rasqal_literal* value);
+RASQAL_API
+raptor_sequence* rasqal_query_get_triple_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_triple* rasqal_query_get_triple(rasqal_query* query, int idx);
+RASQAL_API
+int rasqal_query_add_prefix(rasqal_query* query, rasqal_prefix* prefix);
+RASQAL_API
+raptor_sequence* rasqal_query_get_prefix_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_prefix* rasqal_query_get_prefix(rasqal_query* query, int idx);
+RASQAL_API
+raptor_sequence* rasqal_query_get_order_conditions_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_expression* rasqal_query_get_order_condition(rasqal_query* query, int idx);
+RASQAL_API
+raptor_sequence* rasqal_query_get_group_conditions_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_expression* rasqal_query_get_group_condition(rasqal_query* query, int idx);
+RASQAL_API
+raptor_sequence* rasqal_query_get_having_conditions_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_expression* rasqal_query_get_having_condition(rasqal_query* query, int idx);
+RASQAL_API
+raptor_sequence* rasqal_query_get_construct_triples_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_triple* rasqal_query_get_construct_triple(rasqal_query* query, int idx);
+RASQAL_API RASQAL_DEPRECATED
+void rasqal_query_graph_pattern_visit(rasqal_query* query, rasqal_graph_pattern_visit_fn visit_fn, void* data);
+RASQAL_API
+int rasqal_query_graph_pattern_visit2(rasqal_query* query, rasqal_graph_pattern_visit_fn visit_fn, void* data);
+RASQAL_API
+int rasqal_query_write(raptor_iostream* iostr, rasqal_query* query, raptor_uri* format_uri, raptor_uri* base_uri);
+
+/* update */
+RASQAL_API
+raptor_sequence* rasqal_query_get_update_operations_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_update_operation* rasqal_query_get_update_operation(rasqal_query* query, int idx);
+
+/* results */
+int rasqal_query_set_store_results(rasqal_query* query, int store_results);
+
+/* graph patterns */
+RASQAL_API
+rasqal_graph_pattern* rasqal_query_get_query_graph_pattern(rasqal_query* query);
+RASQAL_API
+raptor_sequence* rasqal_query_get_graph_pattern_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_graph_pattern* rasqal_query_get_graph_pattern(rasqal_query* query, int idx);
+RASQAL_API
+int rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pattern* graph_pattern, rasqal_graph_pattern* sub_graph_pattern);
+RASQAL_API
+rasqal_triple* rasqal_graph_pattern_get_triple(rasqal_graph_pattern* graph_pattern, int idx);
+RASQAL_API
+raptor_sequence* rasqal_graph_pattern_get_sub_graph_pattern_sequence(rasqal_graph_pattern* graph_pattern);
+RASQAL_API
+rasqal_graph_pattern* rasqal_graph_pattern_get_sub_graph_pattern(rasqal_graph_pattern* graph_pattern, int idx);
+RASQAL_API
+rasqal_graph_pattern_operator rasqal_graph_pattern_get_operator(rasqal_graph_pattern* graph_pattern);
+RASQAL_API
+const char* rasqal_graph_pattern_operator_as_string(rasqal_graph_pattern_operator op);
+RASQAL_API
+int rasqal_graph_pattern_print(rasqal_graph_pattern* gp, FILE* fh);
+RASQAL_API
+int rasqal_graph_pattern_set_filter_expression(rasqal_graph_pattern* gp, rasqal_expression* expr);
+RASQAL_API
+rasqal_expression* rasqal_graph_pattern_get_filter_expression(rasqal_graph_pattern* gp);
+RASQAL_API
+int rasqal_graph_pattern_visit(rasqal_query* query, rasqal_graph_pattern *gp, rasqal_graph_pattern_visit_fn fn, void* user_data);
+RASQAL_API
+int rasqal_graph_pattern_get_index(rasqal_graph_pattern* gp);
+RASQAL_API
+int rasqal_graph_pattern_variable_bound_in(rasqal_graph_pattern *gp, rasqal_variable *v);
+RASQAL_API
+rasqal_literal* rasqal_graph_pattern_get_origin(rasqal_graph_pattern* graph_pattern);
+RASQAL_API
+rasqal_variable* rasqal_graph_pattern_get_variable(rasqal_graph_pattern* graph_pattern);
+RASQAL_API
+rasqal_literal* rasqal_graph_pattern_get_service(rasqal_graph_pattern* graph_pattern);
+RASQAL_API
+raptor_sequence* rasqal_graph_pattern_get_flattened_triples(rasqal_query* query, rasqal_graph_pattern* graph_pattern);
+
+/* Utility methods */
+RASQAL_API
+const char* rasqal_query_verb_as_string(rasqal_query_verb verb);
+RASQAL_API
+int rasqal_query_print(rasqal_query* query, FILE* fh);
+
+/* Query */
+RASQAL_API
+int rasqal_query_prepare(rasqal_query* query, const unsigned char *query_string, raptor_uri *base_uri);
+RASQAL_API
+rasqal_query_results* rasqal_query_execute(rasqal_query* query);
+
+RASQAL_API
+void* rasqal_query_get_user_data(rasqal_query* query);
+RASQAL_API
+void rasqal_query_set_user_data(rasqal_query* query, void *user_data);
+
+RASQAL_API
+raptor_sequence* rasqal_query_get_bindings_variables_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_variable* rasqal_query_get_bindings_variable(rasqal_query* query, int idx);
+RASQAL_API
+raptor_sequence* rasqal_query_get_bindings_rows_sequence(rasqal_query* query);
+RASQAL_API
+rasqal_row* rasqal_query_get_bindings_row(rasqal_query* query, int idx);
+RASQAL_API
+rasqal_query_results_type rasqal_query_get_result_type(rasqal_query* query);
+
+/* query results */
+RASQAL_API
+rasqal_query_results* rasqal_new_query_results(rasqal_world* world, rasqal_query* query, rasqal_query_results_type type, rasqal_variables_table* vars_table);
+RASQAL_API
+void rasqal_free_query_results(rasqal_query_results *query_results);
+
+RASQAL_API
+rasqal_query* rasqal_query_results_get_query(rasqal_query_results* query_results);
+
+/* Bindings result format */
+RASQAL_API
+rasqal_query_results_type rasqal_query_results_get_type(rasqal_query_results* query_results);
+RASQAL_API
+int rasqal_query_results_is_bindings(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_get_count(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_next(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_finished(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_get_bindings(rasqal_query_results *query_results, const unsigned char ***names, rasqal_literal ***values);
+RASQAL_API
+rasqal_literal* rasqal_query_results_get_binding_value(rasqal_query_results *query_results, int offset);
+RASQAL_API
+const unsigned char* rasqal_query_results_get_binding_name(rasqal_query_results *query_results, int offset);
+RASQAL_API
+rasqal_literal* rasqal_query_results_get_binding_value_by_name(rasqal_query_results *query_results, const unsigned char *name);
+RASQAL_API
+int rasqal_query_results_get_bindings_count(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_add_row(rasqal_query_results* query_results, rasqal_row* row);
+RASQAL_API
+rasqal_row* rasqal_query_results_get_row_by_offset(rasqal_query_results* query_results, int result_offset);
+
+/* Boolean result format */
+RASQAL_API
+int rasqal_query_results_is_boolean(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_get_boolean(rasqal_query_results *query_results);
+
+/* Graph result format */
+RASQAL_API
+int rasqal_query_results_is_graph(rasqal_query_results *query_results);
+RASQAL_API
+raptor_statement* rasqal_query_results_get_triple(rasqal_query_results *query_results);
+RASQAL_API
+int rasqal_query_results_next_triple(rasqal_query_results *query_results);
+
+/* Syntax result format */
+RASQAL_API
+int rasqal_query_results_is_syntax(rasqal_query_results* query_results);
+
+RASQAL_API
+int rasqal_query_results_write(raptor_iostream *iostr, rasqal_query_results *results, const char* name, const char* mime_type, raptor_uri *format_uri, raptor_uri *base_uri);
+RASQAL_API
+int rasqal_query_results_read(raptor_iostream *iostr, rasqal_query_results *results, const char* name, const char* mime_type, raptor_uri *format_uri, raptor_uri *base_uri);
+
+/* One more time */
+RASQAL_API
+int rasqal_query_results_rewind(rasqal_query_results* query_results);
+
+
+/**
+ * rasqal_query_results_format_flags:
+ * @RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER: format can be read.
+ * @RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER: format can be written.
+ *
+ * Bitflags for rasqal_query_results_formats_check() to find formats with features.
+ */
+typedef enum {
+ RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER = 1,
+ RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER = 2
+} rasqal_query_results_format_flags;
+
+
+RASQAL_API
+int rasqal_query_results_formats_check(rasqal_world* world, const char *name, raptor_uri* uri, const char *mime_type, int flags);
+RASQAL_API
+rasqal_query_results_formatter* rasqal_new_query_results_formatter(rasqal_world* world, const char *name, const char *mime_type, raptor_uri* format_uri);
+RASQAL_API
+rasqal_query_results_formatter* rasqal_new_query_results_formatter_for_content(rasqal_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier);
+RASQAL_API
+void rasqal_free_query_results_formatter(rasqal_query_results_formatter* formatter);
+RASQAL_API
+int rasqal_query_results_formatter_write(raptor_iostream *iostr, rasqal_query_results_formatter* formatter, rasqal_query_results* results, raptor_uri *base_uri);
+RASQAL_API
+int rasqal_query_results_formatter_read(rasqal_world* world, raptor_iostream *iostr, rasqal_query_results_formatter* formatter, rasqal_query_results* results, raptor_uri *base_uri);
+
+RASQAL_API
+int rasqal_query_iostream_write_escaped_counted_string(rasqal_query* query, raptor_iostream* iostr, const unsigned char* string, size_t len);
+RASQAL_API
+unsigned char* rasqal_query_escape_counted_string(rasqal_query* query, const unsigned char *string, size_t len, size_t* output_len_p);
+
+
+/* Data graph class */
+RASQAL_API
+rasqal_data_graph* rasqal_new_data_graph_from_uri(rasqal_world* world, raptor_uri* uri, raptor_uri* name_uri, int flags, const char* format_type, const char* format_name, raptor_uri* format_uri);
+RASQAL_API
+rasqal_data_graph* rasqal_new_data_graph_from_iostream(rasqal_world* world, raptor_iostream* iostr, raptor_uri* base_uri, raptor_uri* name_uri, unsigned int flags, const char* format_type, const char* format_name, raptor_uri* format_uri);
+RASQAL_API
+rasqal_data_graph* rasqal_new_data_graph_from_data_graph(rasqal_data_graph* dg);
+RASQAL_API
+void rasqal_free_data_graph(rasqal_data_graph* dg);
+RASQAL_API
+int rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh);
+
+
+/**
+ * rasqal_compare_flags:
+ * @RASQAL_COMPARE_NOCASE: String comparisons are case independent.
+ * @RASQAL_COMPARE_XQUERY: XQuery comparsion rules apply.
+ * @RASQAL_COMPARE_RDF: RDF Term comparsion rules apply.
+ * @RASQAL_COMPARE_URI: Allow comparison of URIs and allow strings to have a boolean value (unused; was for RDQL)
+ * @RASQAL_COMPARE_SAMETERM: SPARQL sameTerm() builtin rules apply.
+ *
+ * Flags for rasqal_expression_evaluate(), rasqal_literal_compare() or
+ * rasqal_literal_as_string_flags()
+ */
+typedef enum {
+ RASQAL_COMPARE_NOCASE = 1,
+ RASQAL_COMPARE_XQUERY = 2,
+ RASQAL_COMPARE_RDF = 4,
+ RASQAL_COMPARE_URI = 8,
+ RASQAL_COMPARE_SAMETERM = 16
+} rasqal_compare_flags;
+
+
+/**
+ * rasqal_random:
+ *
+ * Internal
+ */
+typedef struct rasqal_random_s rasqal_random;
+
+
+/**
+ * rasqal_evaluation_context:
+ * @world: rasqal world
+ * @base_uri: base URI of expression context (or NULL)
+ * @locator: locator or NULL
+ * @flags: expression comparison flags
+ * @seed: random seeed
+ * @random: random number generator object
+ *
+ * A context for evaluating an expression such as with
+ * rasqal_expression_evaluate2()
+ */
+typedef struct {
+ rasqal_world *world;
+ raptor_uri* base_uri;
+ raptor_locator *locator;
+ int flags;
+ unsigned int seed;
+ rasqal_random* random;
+} rasqal_evaluation_context;
+
+
+/* Expression class */
+RASQAL_API
+rasqal_expression* rasqal_new_0op_expression(rasqal_world* world, rasqal_op op);
+RASQAL_API
+rasqal_expression* rasqal_new_1op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg);
+RASQAL_API
+rasqal_expression* rasqal_new_2op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2);
+RASQAL_API
+rasqal_expression* rasqal_new_3op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2, rasqal_expression* arg3);
+RASQAL_API
+rasqal_expression* rasqal_new_4op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2, rasqal_expression* arg3, rasqal_expression* arg4);
+RASQAL_API
+rasqal_expression* rasqal_new_string_op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_literal* literal);
+RASQAL_API
+rasqal_expression* rasqal_new_literal_expression(rasqal_world* world, rasqal_literal* literal);
+RASQAL_API
+rasqal_expression* rasqal_new_function_expression(rasqal_world* world, raptor_uri* name, raptor_sequence* args, raptor_sequence* params, unsigned int flags);
+RASQAL_API
+rasqal_expression* rasqal_new_aggregate_function_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, raptor_sequence* params, unsigned int flags);
+RASQAL_API
+rasqal_expression* rasqal_new_cast_expression(rasqal_world* world, raptor_uri* name, rasqal_expression *value);
+RASQAL_API
+rasqal_expression* rasqal_new_expr_seq_expression(rasqal_world* world, rasqal_op op, raptor_sequence* args);
+RASQAL_API
+rasqal_expression* rasqal_new_set_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, raptor_sequence* args);
+RASQAL_API
+rasqal_expression* rasqal_new_group_concat_expression(rasqal_world* world, int flags, raptor_sequence* args, rasqal_literal* separator);
+RASQAL_API
+rasqal_expression* rasqal_new_expression_from_expression(rasqal_expression* e);
+
+RASQAL_API
+void rasqal_free_expression(rasqal_expression* e);
+RASQAL_API
+void rasqal_expression_print_op(rasqal_expression* e, FILE* fh);
+RASQAL_API
+int rasqal_expression_print(rasqal_expression* e, FILE* fh);
+RASQAL_API RASQAL_DEPRECATED
+rasqal_literal* rasqal_expression_evaluate(rasqal_world *world, raptor_locator *locator, rasqal_expression* e, int flags);
+RASQAL_API
+rasqal_literal* rasqal_expression_evaluate2(rasqal_expression *e, rasqal_evaluation_context* eval_context, int *error_p);
+RASQAL_API
+const char* rasqal_expression_op_label(rasqal_op op);
+RASQAL_API
+int rasqal_expression_compare(rasqal_expression* e1, rasqal_expression* e2, int flags, int* error_p);
+
+/**
+ * rasqal_expression_visit_fn:
+ * @user_data: user data passed in with rasqal_expression_visit()
+ * @e: current expression
+ *
+ * User function to visit an expression and operate on it with
+ * rasqal_expression_visit()
+ *
+ * Return value: non-0 to truncate the visit
+ */
+typedef int (*rasqal_expression_visit_fn)(void *user_data, rasqal_expression *e);
+RASQAL_API
+int rasqal_expression_visit(rasqal_expression* e, rasqal_expression_visit_fn fn, void *user_data);
+
+RASQAL_API
+rasqal_evaluation_context* rasqal_new_evaluation_context(rasqal_world* world, raptor_locator* locator, int flags);
+RASQAL_API
+void rasqal_free_evaluation_context(rasqal_evaluation_context* eval_context);
+RASQAL_API
+int rasqal_evaluation_context_set_base_uri(rasqal_evaluation_context* eval_context, raptor_uri *base_uri);
+RASQAL_API
+int rasqal_evaluation_context_set_rand_seed(rasqal_evaluation_context* eval_context, unsigned int seed);
+
+
+/* Literal class */
+RASQAL_API
+rasqal_literal* rasqal_new_integer_literal(rasqal_world* world, rasqal_literal_type type, int integer);
+RASQAL_API
+rasqal_literal* rasqal_new_numeric_literal_from_long(rasqal_world* world, rasqal_literal_type type, long value);
+RASQAL_API
+rasqal_literal* rasqal_new_typed_literal(rasqal_world* world, rasqal_literal_type type, const unsigned char* string);
+RASQAL_API
+rasqal_literal* rasqal_new_double_literal(rasqal_world* world, double d);
+RASQAL_API
+rasqal_literal* rasqal_new_floating_literal(rasqal_world *world, rasqal_literal_type type, double d);
+RASQAL_API RASQAL_DEPRECATED
+rasqal_literal* rasqal_new_float_literal(rasqal_world* world, float f);
+RASQAL_API
+rasqal_literal* rasqal_new_uri_literal(rasqal_world* world, raptor_uri* uri);
+RASQAL_API
+rasqal_literal* rasqal_new_pattern_literal(rasqal_world* world, const unsigned char *pattern, const char *flags);
+RASQAL_API
+rasqal_literal* rasqal_new_string_literal(rasqal_world* world, const unsigned char *string, const char *language, raptor_uri *datatype, const unsigned char *datatype_qname);
+RASQAL_API
+rasqal_literal* rasqal_new_simple_literal(rasqal_world* world, rasqal_literal_type type, const unsigned char *string);
+RASQAL_API
+rasqal_literal* rasqal_new_boolean_literal(rasqal_world* world, int value);
+RASQAL_API
+rasqal_literal* rasqal_new_variable_literal(rasqal_world* world, rasqal_variable *variable);
+RASQAL_API
+rasqal_literal* rasqal_new_decimal_literal(rasqal_world* world, const unsigned char *string);
+RASQAL_API
+rasqal_literal* rasqal_new_decimal_literal_from_decimal(rasqal_world* world, const unsigned char *string, rasqal_xsd_decimal* decimal);
+RASQAL_API
+rasqal_literal* rasqal_new_datetime_literal_from_datetime(rasqal_world* world, rasqal_xsd_datetime* dt);
+
+
+RASQAL_API
+rasqal_literal* rasqal_new_literal_from_literal(rasqal_literal* l);
+RASQAL_API
+void rasqal_free_literal(rasqal_literal* l);
+RASQAL_API
+int rasqal_literal_print(rasqal_literal* l, FILE* fh);
+RASQAL_API
+const char* rasqal_literal_type_label(rasqal_literal_type type);
+RASQAL_API
+void rasqal_literal_print_type(rasqal_literal* l, FILE* fh);
+RASQAL_API
+rasqal_variable* rasqal_literal_as_variable(rasqal_literal* l);
+RASQAL_API
+const unsigned char* rasqal_literal_as_counted_string(rasqal_literal* l, size_t *len_p, int flags, int *error_p);
+RASQAL_API
+const unsigned char* rasqal_literal_as_string(rasqal_literal* l);
+RASQAL_API
+const unsigned char* rasqal_literal_as_string_flags(rasqal_literal* l, int flags, int *error_p);
+RASQAL_API
+rasqal_literal* rasqal_literal_as_node(rasqal_literal* l);
+RASQAL_API
+raptor_uri* rasqal_literal_datatype(rasqal_literal* l);
+RASQAL_API
+rasqal_literal* rasqal_literal_value(rasqal_literal* l);
+
+RASQAL_API
+int rasqal_literal_compare(rasqal_literal* l1, rasqal_literal* l2, int flags, int *error_p);
+RASQAL_API
+int rasqal_literal_equals(rasqal_literal* l1, rasqal_literal* l2);
+RASQAL_API
+int rasqal_literal_same_term(rasqal_literal* l1, rasqal_literal* l2);
+RASQAL_API
+rasqal_literal_type rasqal_literal_get_rdf_term_type(rasqal_literal* l);
+RASQAL_API
+int rasqal_literal_is_rdf_literal(rasqal_literal* l);
+
+
+RASQAL_API
+rasqal_prefix* rasqal_new_prefix(rasqal_world* world, const unsigned char* prefix, raptor_uri* uri);
+RASQAL_API
+void rasqal_free_prefix(rasqal_prefix* p);
+RASQAL_API
+int rasqal_prefix_print(rasqal_prefix* p, FILE* fh);
+
+
+/* Row class */
+RASQAL_API
+rasqal_row* rasqal_new_row_for_size(rasqal_world* world, int size);
+RASQAL_API
+void rasqal_free_row(rasqal_row* row);
+RASQAL_API
+int rasqal_row_set_value_at(rasqal_row* row, int offset, rasqal_literal* value);
+
+
+/* Triple class */
+RASQAL_API
+rasqal_triple* rasqal_new_triple(rasqal_literal* subject, rasqal_literal* predicate, rasqal_literal* object);
+RASQAL_API
+rasqal_triple* rasqal_new_triple_from_triple(rasqal_triple* t);
+RASQAL_API
+void rasqal_free_triple(rasqal_triple* t);
+RASQAL_API
+int rasqal_triple_print(rasqal_triple* t, FILE* fh);
+RASQAL_API
+void rasqal_triple_set_origin(rasqal_triple* t, rasqal_literal *l);
+RASQAL_API
+rasqal_literal* rasqal_triple_get_origin(rasqal_triple* t);
+
+/* Variable class */
+RASQAL_API
+rasqal_variable* rasqal_new_variable_from_variable(rasqal_variable* v);
+RASQAL_API
+void rasqal_free_variable(rasqal_variable* v);
+RASQAL_API
+int rasqal_variable_print(rasqal_variable* v, FILE* fh);
+RASQAL_API
+void rasqal_variable_set_value(rasqal_variable* v, rasqal_literal* l);
+
+
+/* Variables Table */
+RASQAL_API
+rasqal_variables_table* rasqal_new_variables_table(rasqal_world* world);
+RASQAL_API
+void rasqal_free_variables_table(rasqal_variables_table* vt);
+RASQAL_API
+rasqal_variable* rasqal_variables_table_add(rasqal_variables_table* vt, rasqal_variable_type type, const unsigned char *name, rasqal_literal *value);
+RASQAL_API
+int rasqal_variables_table_add_variable(rasqal_variables_table* vt, rasqal_variable* variable);
+RASQAL_API
+rasqal_variable* rasqal_variables_table_get_by_name(rasqal_variables_table* vt, rasqal_variable_type type, const unsigned char *name);
+RASQAL_API
+int rasqal_variables_table_contains(rasqal_variables_table* vt, rasqal_variable_type type, const unsigned char *name);
+
+/* memory functions */
+RASQAL_API
+void rasqal_free_memory(void *ptr);
+RASQAL_API
+void* rasqal_alloc_memory(size_t size);
+RASQAL_API
+void* rasqal_calloc_memory(size_t nmemb, size_t size);
+
+
+/* decimal functions */
+RASQAL_API
+rasqal_xsd_decimal* rasqal_new_xsd_decimal(rasqal_world* world);
+RASQAL_API
+void rasqal_free_xsd_decimal(rasqal_xsd_decimal* dec);
+RASQAL_API
+int rasqal_xsd_decimal_set_string(rasqal_xsd_decimal* dec, const char* string);
+RASQAL_API
+double rasqal_xsd_decimal_get_double(rasqal_xsd_decimal* dec);
+RASQAL_API
+long rasqal_xsd_decimal_get_long(rasqal_xsd_decimal* dec, int* error_p);
+RASQAL_API
+char* rasqal_xsd_decimal_as_string(rasqal_xsd_decimal* dec);
+RASQAL_API
+char* rasqal_xsd_decimal_as_counted_string(rasqal_xsd_decimal* dec, size_t* len_p);
+RASQAL_API
+int rasqal_xsd_decimal_set_long(rasqal_xsd_decimal* dec, long l);
+RASQAL_API
+int rasqal_xsd_decimal_set_double(rasqal_xsd_decimal* dec, double d);
+RASQAL_API
+int rasqal_xsd_decimal_print(rasqal_xsd_decimal* dec, FILE* stream);
+RASQAL_API
+int rasqal_xsd_decimal_add(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a, rasqal_xsd_decimal* b);
+RASQAL_API
+int rasqal_xsd_decimal_subtract(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a, rasqal_xsd_decimal* b);
+RASQAL_API
+int rasqal_xsd_decimal_multiply(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a, rasqal_xsd_decimal* b);
+RASQAL_API
+int rasqal_xsd_decimal_divide(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a, rasqal_xsd_decimal* b);
+RASQAL_API
+int rasqal_xsd_decimal_negate(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a);
+RASQAL_API
+int rasqal_xsd_decimal_compare(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b);
+RASQAL_API
+int rasqal_xsd_decimal_equals(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b);
+RASQAL_API
+int rasqal_xsd_decimal_is_zero(rasqal_xsd_decimal* d);
+RASQAL_API
+int rasqal_xsd_decimal_abs(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a);
+RASQAL_API
+int rasqal_xsd_decimal_round(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a);
+RASQAL_API
+int rasqal_xsd_decimal_ceil(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a);
+RASQAL_API
+int rasqal_xsd_decimal_floor(rasqal_xsd_decimal* result, rasqal_xsd_decimal* a);
+
+
+/* date functions */
+RASQAL_API
+rasqal_xsd_date* rasqal_new_xsd_date(rasqal_world* world, const char *date_string);
+RASQAL_API
+void rasqal_free_xsd_date(rasqal_xsd_date* d);
+RASQAL_API
+char* rasqal_xsd_date_to_counted_string(const rasqal_xsd_date *date, size_t *len_p);
+RASQAL_API
+char* rasqal_xsd_date_to_string(const rasqal_xsd_date *d);
+RASQAL_API
+int rasqal_xsd_date_equals(const rasqal_xsd_date *d1, const rasqal_xsd_date *d2, int *incomparible_p);
+RASQAL_API
+int rasqal_xsd_date_compare(const rasqal_xsd_date *d1, const rasqal_xsd_date *d2, int *incomparible_p);
+
+/* datetime functions */
+RASQAL_API
+rasqal_xsd_datetime* rasqal_new_xsd_datetime(rasqal_world* world, const char *datetime_string);
+RASQAL_API
+rasqal_xsd_datetime* rasqal_new_xsd_datetime_from_unixtime(rasqal_world* world, time_t secs);
+RASQAL_API
+rasqal_xsd_datetime* rasqal_new_xsd_datetime_from_timeval(rasqal_world* world, struct timeval *tv);
+RASQAL_API
+rasqal_xsd_datetime* rasqal_new_xsd_datetime_from_xsd_date(rasqal_world* world, rasqal_xsd_date *date);
+RASQAL_API
+void rasqal_free_xsd_datetime(rasqal_xsd_datetime* dt);
+RASQAL_API
+char* rasqal_xsd_datetime_to_counted_string(const rasqal_xsd_datetime *dt, size_t *len_p);
+RASQAL_API
+char* rasqal_xsd_datetime_to_string(const rasqal_xsd_datetime *dt);
+RASQAL_API
+int rasqal_xsd_datetime_equals2(const rasqal_xsd_datetime *dt1, const rasqal_xsd_datetime *dt2, int *incomparible_p);
+RASQAL_API RASQAL_DEPRECATED
+int rasqal_xsd_datetime_equals(const rasqal_xsd_datetime *dt1, const rasqal_xsd_datetime *dt2);
+RASQAL_API
+int rasqal_xsd_datetime_compare2(const rasqal_xsd_datetime *dt1, const rasqal_xsd_datetime *dt2, int *incomparible_p);
+RASQAL_API RASQAL_DEPRECATED
+int rasqal_xsd_datetime_compare(const rasqal_xsd_datetime *dt1, const rasqal_xsd_datetime *dt2);
+RASQAL_API
+rasqal_xsd_decimal* rasqal_xsd_datetime_get_seconds_as_decimal(rasqal_world* world, rasqal_xsd_datetime* dt);
+RASQAL_API
+int rasqal_xsd_datetime_set_from_timeval(rasqal_xsd_datetime *dt, struct timeval *tv);
+RASQAL_API
+int rasqal_xsd_datetime_set_from_unixtime(rasqal_xsd_datetime* dt, time_t clock);
+RASQAL_API
+time_t rasqal_xsd_datetime_get_as_unixtime(rasqal_xsd_datetime* dt);
+RASQAL_API
+struct timeval* rasqal_xsd_datetime_get_as_timeval(rasqal_xsd_datetime *dt);
+RASQAL_API
+char* rasqal_xsd_datetime_get_timezone_as_counted_string(rasqal_xsd_datetime *dt, size_t *len_p);
+RASQAL_API
+char* rasqal_xsd_datetime_get_tz_as_counted_string(rasqal_xsd_datetime* dt, size_t *len_p);
+
+
+/* regex utilities */
+RASQAL_API
+char* rasqal_regex_replace(rasqal_world* world, raptor_locator* locator, const char* pattern, const char* regex_flags, const char* subject, size_t subject_len, const char* replace, size_t replace_len, size_t* result_len_p);
+
+
+/**
+ * rasqal_service:
+ *
+ * Rasqal SPARQL Protocol Service
+ */
+typedef struct rasqal_service_s rasqal_service;
+
+RASQAL_API
+rasqal_service* rasqal_new_service(rasqal_world* world, raptor_uri* service_uri, const unsigned char* query_string, raptor_sequence* data_graphs);
+RASQAL_API
+void rasqal_free_service(rasqal_service* svc);
+RASQAL_API
+rasqal_query_results* rasqal_service_execute(rasqal_service* svc);
+RASQAL_API
+int rasqal_service_set_www(rasqal_service* svc, raptor_www* www);
+RASQAL_API
+int rasqal_service_set_format(rasqal_service* svc, const char *format);
+
+
+
+/**
+ * rasqal_triple_parts:
+ * @RASQAL_TRIPLE_NONE: no parts
+ * @RASQAL_TRIPLE_SUBJECT: Subject present in a triple.
+ * @RASQAL_TRIPLE_PREDICATE: Predicate present in a triple.
+ * @RASQAL_TRIPLE_OBJECT: Object present in a triple.
+ * @RASQAL_TRIPLE_ORIGIN: Origin/graph present in a triple.
+ * @RASQAL_TRIPLE_GRAPH: Alias for RASQAL_TRIPLE_ORIGIN
+ * @RASQAL_TRIPLE_SPO: Subject, Predicate and Object present in a triple.
+ * @RASQAL_TRIPLE_SPOG: Subject, Predicate, Object, Graph present in a triple.
+ *
+ * Flags for parts of a triple.
+ */
+typedef enum {
+ RASQAL_TRIPLE_NONE = 0,
+ RASQAL_TRIPLE_SUBJECT = 1,
+ RASQAL_TRIPLE_PREDICATE= 2,
+ RASQAL_TRIPLE_OBJECT = 4,
+ RASQAL_TRIPLE_ORIGIN = 8,
+ RASQAL_TRIPLE_GRAPH = RASQAL_TRIPLE_ORIGIN,
+ RASQAL_TRIPLE_SPO = RASQAL_TRIPLE_SUBJECT | RASQAL_TRIPLE_PREDICATE | RASQAL_TRIPLE_OBJECT,
+ RASQAL_TRIPLE_SPOG = RASQAL_TRIPLE_SPO | RASQAL_TRIPLE_GRAPH
+} rasqal_triple_parts;
+
+
+
+/**
+ * rasqal_triples_match:
+ * @world: rasqal_world object
+ * @user_data: User data pointer for factory methods.
+ * @bind_match: The [4]array (s,p,o,origin) bindings against the current triple match only touching triple parts given. Returns parts that were bound or 0 on failure.
+ * @next_match: Move to next match.
+ * @is_end: Check for end of triple match - return non-0 if is end.
+ * @finish: Finish triples match and destroy any allocated memory.
+ * @is_exact: non-0 if triple to match is all literal constants
+ * @finished: >0 if the match has finished
+ *
+ * Triples match structure as initialised by #rasqal_triples_source
+ * method init_triples_match.
+ */
+struct rasqal_triples_match_s {
+ rasqal_world *world;
+
+ void *user_data;
+
+ rasqal_triple_parts (*bind_match)(struct rasqal_triples_match_s* rtm, void *user_data, rasqal_variable *bindings[4], rasqal_triple_parts parts);
+
+ void (*next_match)(struct rasqal_triples_match_s* rtm, void *user_data);
+
+ int (*is_end)(struct rasqal_triples_match_s* rtm, void *user_data);
+
+ void (*finish)(struct rasqal_triples_match_s* rtm, void *user_data);
+
+ int is_exact;
+
+ int finished;
+};
+typedef struct rasqal_triples_match_s rasqal_triples_match;
+
+
+/**
+ * rasqal_triple_meta:
+ * @bindings: Variable bindings for this triple+origin to set.
+ * @triples_match: The matcher that is setting these bindings.
+ * @context: Context data used by the matcher.
+ * @parts: Bitmask of #rasqal_triple_parts flags describing the parts of the triple pattern that will bind to variables. There may also be variables mentioned that are bound in other triple patterns even if @parts is 0.
+ * @is_exact: unused
+ * @executed: unused
+ *
+ * Metadata for triple pattern matching for one triple pattern.
+ */
+typedef struct {
+ /* triple (subject, predicate, object) and origin */
+ rasqal_variable* bindings[4];
+
+ rasqal_triples_match *triples_match;
+
+ void *context;
+
+ rasqal_triple_parts parts;
+
+ int is_exact;
+
+ int executed;
+} rasqal_triple_meta;
+
+
+/**
+ * RASQAL_TRIPLES_SOURCE_MIN_VERSION:
+ *
+ * Lowest accepted @rasqal_triples_source API version
+ */
+#define RASQAL_TRIPLES_SOURCE_MIN_VERSION 1
+
+/**
+ * RASQAL_TRIPLES_SOURCE_MAX_VERSION:
+ *
+ * Highest accepted @rasqal_triples_source API version
+ */
+#define RASQAL_TRIPLES_SOURCE_MAX_VERSION 2
+
+
+/**
+ * rasqal_triples_source_feature:
+ * @RASQAL_TRIPLES_SOURCE_FEATURE_NONE: No feature
+ * @RASQAL_TRIPLES_SOURCE_FEATURE_IOSTREAM_DATA_GRAPH: Support raptor_iostream data graphs
+ *
+ * Optional features that may be supported by a triple source factory
+ */
+typedef enum {
+ RASQAL_TRIPLES_SOURCE_FEATURE_NONE,
+ RASQAL_TRIPLES_SOURCE_FEATURE_IOSTREAM_DATA_GRAPH
+} rasqal_triples_source_feature;
+
+
+/**
+ * rasqal_triples_source:
+ * @version: API version - only V1 is defined for now
+ * @query: Source for this query.
+ * @user_data: Context user data passed into the factory methods.
+ * @init_triples_match: Factory method to initalise a new #rasqal_triples_match.
+ * @triple_present: Factory method to return presence or absence of a complete triple.
+ * @free_triples_source: Factory method to deallocate resources.
+ * @support_feature: Factory method to test support for a feature, returning non-0 if supported
+ *
+ * Triples source as initialised by a #rasqal_triples_source_factory.
+ */
+struct rasqal_triples_source_s {
+ int version;
+
+ rasqal_query* query;
+
+ void *user_data;
+
+ /* API v1 */
+ int (*init_triples_match)(rasqal_triples_match* rtm, struct rasqal_triples_source_s* rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t);
+
+ int (*triple_present)(struct rasqal_triples_source_s* rts, void *user_data, rasqal_triple *t);
+
+ void (*free_triples_source)(void *user_data);
+
+ /* API v2 onwards */
+ int (*support_feature)(void *user_data, rasqal_triples_source_feature feature);
+};
+typedef struct rasqal_triples_source_s rasqal_triples_source;
+
+
+/**
+ * RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION:
+ *
+ * Lowest accepted @rasqal_triples_source_factory API version
+ */
+#define RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION 1
+
+/**
+ * RASQAL_TRIPLES_SOURCE_FACTORY_MAX_VERSION:
+ *
+ * Highest accepted @rasqal_triples_source_factory API version
+ */
+#define RASQAL_TRIPLES_SOURCE_FACTORY_MAX_VERSION 2
+
+
+/**
+ * rasqal_triples_error_handler:
+ * @query: query object
+ * @locator: error locator (or NULL)
+ * @message: error message
+ *
+ * Triples source factory error handler callback.
+ */
+typedef void (*rasqal_triples_error_handler)(rasqal_query* query, raptor_locator* locator, const char* message);
+
+
+/**
+ * rasqal_triples_source_factory:
+ * @version: API factory version from 1 to 2
+ * @user_data: User data for triples_source_factory.
+ * @user_data_size: Size of @user_data for new_triples_source.
+ * @new_triples_source: Create a new triples source - returns non-zero on failure < 0 is a 'no rdf data error', > 0 is an unspecified error. Error messages are generated by rasqal internally. (V1)
+ * @init_triples_source: Initialise a new triples source V2 for a particular source URI/base URI and syntax. Returns non-zero on failure with errors reported via the handler callback by the implementation. (V2)
+ *
+ * A factory that initialises #rasqal_triples_source structures to
+ * returning matches to a triple pattern across the dataset formed
+ * from the data graphs recorded in the @query object.
+ */
+typedef struct {
+ int version;
+
+ void *user_data;
+ size_t user_data_size;
+
+ /* API v1 */
+ int (*new_triples_source)(rasqal_query* query, void *factory_user_data, void *user_data, rasqal_triples_source* rts);
+ /* API v2 onwards */
+ int (*init_triples_source)(rasqal_query* query, void *factory_user_data, void *user_data, rasqal_triples_source* rts, rasqal_triples_error_handler handler);
+} rasqal_triples_source_factory;
+
+
+/**
+ * rasqal_triples_source_factory_register_fn:
+ * @factory: factory to register
+ *
+ * Register a factory for generating triples sources #rasqal_triples_source
+ *
+ * Return value: non-0 on failure
+ */
+typedef int (*rasqal_triples_source_factory_register_fn)(rasqal_triples_source_factory *factory);
+
+
+/* set the triples_source_factory */
+RASQAL_API
+int rasqal_set_triples_source_factory(rasqal_world* world, rasqal_triples_source_factory_register_fn register_fn, void* user_data);
+
+
+
+/* The info below is solely for gtk-doc - ignore it */
+
+/**
+ * raptor_world:
+ *
+ * Internal
+ */
+
+/**
+ * RASQAL_QUERY_RESULTS_FORMATTER_DECLARED:
+ *
+ * Internal
+ */
+
+/**
+ * RASQAL_WORLD_DECLARED:
+ *
+ * Internal
+ */
+
+
+/**
+ * RASQAL_LITERAL_UDT_DEFINED
+ *
+ * Internal
+ */
+
+/**
+ * rasqal_expression_s:
+ * @usage: Internal
+ * @op: Internal
+ * @arg1: Internal
+ * @arg2: Internal
+ * @arg3: Internal
+ * @literal: Internal
+ * @value: Internal
+ * @name: Internal
+ * @args: Internal
+ * @params: Internal
+ * @flags: Internal
+ *
+ * Internal - see #rasqal_expression.
+ *
+ */
+
+/**
+ * bind_match:
+ * @rtm: triples match context
+ * @user_data: user data
+ * @bindings: variable binding for parts of triple (s, p, o, g)
+ * @parts: parts of triple to match
+ *
+ * Internal - see #rasqal_triples_match
+ *
+ * Return value: match parts
+*/
+
+/**
+ * next_match:
+ * @rtm: triples match context
+ * @user_data: user data
+ *
+ * Internal - see #rasqal_triples_match
+ */
+
+/**
+ * is_end:
+ * @rtm: triples match context
+ * @user_data: user data
+ *
+ * Internal - see #rasqal_triples_match
+ *
+ * Return value: non-0 if end of match
+ */
+
+/**
+ * finish:
+ * @rtm: triples match context
+ * @user_data: user data
+ *
+ * Internal - see #rasqal_triples_match
+ */
+
+/**
+ * init_triples_match:
+ * @rtm: triples match context
+ * @rts: triples match source
+ * @user_data: user data
+ * @m: triple meta
+ * @t: triple
+ *
+ * Internal - see #rasqal_triples_source
+ *
+ * Return value: non-0 on failure
+ */
+
+/**
+ * triple_present:
+ * @rts: triples match source
+ * @user_data: user data
+ * @t: triple to test for presence
+ *
+ * Internal - see #rasqal_triples_source
+ *
+ * Return value: non-0 on failure
+ */
+
+/**
+ * free_triples_source:
+ * @user_data: user data
+ *
+ * Internal - see #rasqal_triples_source
+ */
+
+/**
+ * support_feature:
+ * @user_data: user data
+ * @feature: feature to test
+ *
+ * Internal - see #rasqal_triples_source
+ *
+ * Return value: non-0 if supported
+ */
+
+/**
+ * rasqal_variables_table:
+ *
+ * Internal - for now
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/* -*- Mode: c; c-basic-offset: 2 -*-
+ *
+ * redland.h - Redland RDF Application Framework public API
+ *
+ * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/
+ * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
+ *
+ * This package is Free Software and part of Redland http://librdf.org/
+ *
+ * It is licensed under the following three licenses as alternatives:
+ * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
+ * 2. GNU General Public License (GPL) V2 or any newer version
+ * 3. Apache License, V2.0 or any newer version
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above three licenses.
+ *
+ * See LICENSE.html or LICENSE.txt at the top of this package for the
+ * complete terms and further detail along with the license texts for
+ * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
+ *
+ *
+ */
+
+
+#ifndef LIBRDF_H
+#define LIBRDF_H
+
+#ifndef LIBRDF_OBJC_FRAMEWORK
+/* raptor */
+#include <raptor2.h>
+/* rasqal: uses raptor */
+#include <rasqal.h>
+/* librdf: uses rasqal and raptor */
+#else
+#include <Redland/raptor2.h>
+#include <Redland/rasqal.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+
+#ifndef REDLAND_API
+# ifdef WIN32
+# ifdef __GNUC__
+# undef _declspec
+# define _declspec(x) __declspec(x)
+# endif
+# ifdef REDLAND_STATIC
+# define REDLAND_API
+# else
+# ifdef LIBRDF_INTERNAL
+# define REDLAND_API _declspec(dllexport)
+# else
+# define REDLAND_API _declspec(dllimport)
+# endif
+# endif
+# else
+# define REDLAND_API
+# endif
+#endif
+
+#ifndef REDLAND_CALLBACK_STDCALL
+# if defined(WIN32) && defined(USE_STDCALL_CALLBACKS)
+# define REDLAND_CALLBACK_STDCALL _stdcall
+# else
+# define REDLAND_CALLBACK_STDCALL
+# endif
+#endif
+
+/* Use gcc 3.1+ feature to allow marking of deprecated API calls.
+ * This gives a warning during compiling.
+ */
+#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
+#define REDLAND_DEPRECATED __attribute__((deprecated))
+#define REDLAND_NORETURN __attribute__((__noreturn__))
+#else
+#define REDLAND_DEPRECATED
+#define REDLAND_NORETURN
+#endif
+
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) \
+ __attribute__((__format__(__printf__, string_index, first_to_check_index)))
+#else
+#define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index)
+#endif
+
+
+/* Public defines */
+
+/**
+ * LIBRDF_VERSION:
+ *
+ * Redland librdf library version number
+ *
+ * Format: major * 10000 + minor * 100 + release
+ */
+#define LIBRDF_VERSION 10016
+
+/**
+ * LIBRDF_VERSION_STRING:
+ *
+ * Redland librdf library version string
+ */
+#define LIBRDF_VERSION_STRING "1.0.16"
+
+/**
+ * LIBRDF_VERSION_MAJOR:
+ *
+ * Redland librdf library major version
+ */
+#define LIBRDF_VERSION_MAJOR 1
+
+/**
+ * LIBRDF_VERSION_MINOR:
+ *
+ * Redland librdf library minor version
+ */
+#define LIBRDF_VERSION_MINOR 0
+
+/**
+ * LIBRDF_VERSION_RELEASE:
+ *
+ * Redland librdf library release
+ */
+#define LIBRDF_VERSION_RELEASE 16
+
+
+
+/* Public typedefs (references to private structures) */
+
+/**
+ * librdf_world:
+ *
+ * Redland world class.
+ */
+typedef struct librdf_world_s librdf_world;
+
+/**
+ * librdf_hash:
+ *
+ * Redland hash class.
+ */
+typedef struct librdf_hash_s librdf_hash;
+
+/**
+ * librdf_hash_cursor:
+ *
+ * Redland hash cursor class.
+ */
+typedef struct librdf_hash_cursor_s librdf_hash_cursor;
+
+/**
+ * librdf_digest:
+ *
+ * Redland content digest class.
+ */
+typedef struct librdf_digest_s librdf_digest;
+
+/**
+ * librdf_digest_factory:
+ *
+ * Redland digest factory class.
+ */
+typedef struct librdf_digest_factory_s librdf_digest_factory;
+
+/**
+ * librdf_uri:
+ *
+ * Redland URI class.
+ */
+typedef struct raptor_uri_s librdf_uri;
+
+/**
+ * librdf_list:
+ *
+ * Redland list class.
+ */
+typedef struct librdf_list_s librdf_list;
+
+/**
+ * librdf_iterator:
+ *
+ * Redland iterator class.
+ */
+typedef struct librdf_iterator_s librdf_iterator;
+
+/**
+ * librdf_node:
+ *
+ * Redland node class.
+ */
+typedef raptor_term librdf_node;
+
+/**
+ * librdf_statement:
+ *
+ * Redland statement class.
+ */
+typedef raptor_statement librdf_statement;
+
+/**
+ * librdf_model:
+ *
+ * Redland model class.
+ */
+typedef struct librdf_model_s librdf_model;
+
+/**
+ * librdf_model_factory:
+ *
+ * Redland model factory class.
+ */
+typedef struct librdf_model_factory_s librdf_model_factory;
+
+/**
+ * librdf_storage:
+ *
+ * Redland storage class.
+ */
+typedef struct librdf_storage_s librdf_storage;
+
+/**
+ * librdf_storage_factory:
+ *
+ * Redland storage factory class.
+ */
+typedef struct librdf_storage_factory_s librdf_storage_factory;
+
+/**
+ * librdf_stream:
+ *
+ * Redland stream class.
+ */
+typedef struct librdf_stream_s librdf_stream;
+
+/**
+ * librdf_parser:
+ *
+ * Redland parser class.
+ */
+typedef struct librdf_parser_s librdf_parser;
+
+/**
+ * librdf_parser_factory:
+ *
+ * Redland parser factory class.
+ */
+typedef struct librdf_parser_factory_s librdf_parser_factory;
+
+/**
+ * librdf_query:
+ *
+ * Redland query class.
+ */
+typedef struct librdf_query_s librdf_query;
+
+/**
+ * librdf_query_factory:
+ *
+ * Redland query factory class.
+ */
+typedef struct librdf_query_factory_s librdf_query_factory;
+
+/**
+ * librdf_query_results:
+ *
+ * Redland query results class.
+ */
+typedef struct librdf_query_results_s librdf_query_results;
+
+/**
+ * librdf_query_results_formatter:
+ *
+ * Redland query results formatter class.
+ */
+typedef struct librdf_query_results_formatter_s librdf_query_results_formatter;
+
+/**
+ * librdf_serializer:
+ *
+ * Redland serializer class.
+ */
+typedef struct librdf_serializer_s librdf_serializer;
+
+/**
+ * librdf_serializer_factory:
+ *
+ * Redland serializer factory class.
+ */
+typedef struct librdf_serializer_factory_s librdf_serializer_factory;
+
+
+/* Public statics */
+
+/**
+ * librdf_short_copyright_string:
+ *
+ * Short copyright string (one line).
+ */
+REDLAND_API
+extern const char * const librdf_short_copyright_string;
+
+/**
+ * librdf_copyright_string:
+ *
+ * Copyright string (multiple lines).
+ */
+REDLAND_API
+extern const char * const librdf_copyright_string;
+
+/**
+ * librdf_version_string:
+ *
+ * Redland librdf version as a string.
+ */
+REDLAND_API
+extern const char * const librdf_version_string;
+
+/**
+ * librdf_version_major:
+ *
+ * Redland librdf major version number.
+ */
+REDLAND_API
+extern const unsigned int librdf_version_major;
+
+/**
+ * librdf_version_minor:
+ *
+ * Redland librdf minor version number.
+ */
+REDLAND_API
+extern const unsigned int librdf_version_minor;
+
+/**
+ * librdf_version_release:
+ *
+ * Redland librdf release version number.
+ */
+REDLAND_API
+extern const unsigned int librdf_version_release;
+
+/**
+ * librdf_version_decimal:
+ *
+ * Redland librdf version as a decimal number.
+ *
+ * Format: major * 10000 + minor * 100 + release
+ */
+REDLAND_API
+extern const unsigned int librdf_version_decimal;
+
+/**
+ * librdf_license_string:
+ *
+ * Redland librdf license string.
+ */
+REDLAND_API
+extern const char * const librdf_license_string;
+
+/**
+ * librdf_home_url_string:
+ *
+ * Redland librdf home page URL.
+ */
+REDLAND_API
+extern const char * const librdf_home_url_string;
+
+/* Required for va_list in error handler function registrations
+ * which are in the public API
+ */
+#include <stdarg.h>
+
+
+/* internal interfaces */
+#ifdef LIBRDF_INTERNAL
+#include <rdf_internal.h>
+#endif
+
+/* public interfaces */
+
+/* FIXME: Should be replaced with automatically pulled
+ * definitions from the listed rdf_*.h header files.
+ */
+
+#ifndef LIBRDF_OBJC_FRAMEWORK
+#include <rdf_log.h>
+#include <rdf_digest.h>
+#include <rdf_hash.h>
+#include <rdf_init.h>
+#include <rdf_iterator.h>
+#include <rdf_uri.h>
+#include <rdf_node.h>
+#include <rdf_concepts.h>
+#include <rdf_statement.h>
+#include <rdf_model.h>
+#include <rdf_storage.h>
+#include <rdf_parser.h>
+#include <rdf_raptor.h>
+#include <rdf_serializer.h>
+#include <rdf_stream.h>
+#include <rdf_query.h>
+#include <rdf_utf8.h>
+#else
+#include <Redland/rdf_log.h>
+#include <Redland/rdf_digest.h>
+#include <Redland/rdf_hash.h>
+#include <Redland/rdf_init.h>
+#include <Redland/rdf_iterator.h>
+#include <Redland/rdf_uri.h>
+#include <Redland/rdf_node.h>
+#include <Redland/rdf_concepts.h>
+#include <Redland/rdf_statement.h>
+#include <Redland/rdf_model.h>
+#include <Redland/rdf_storage.h>
+#include <Redland/rdf_parser.h>
+#include <Redland/rdf_raptor.h>
+#include <Redland/rdf_serializer.h>
+#include <Redland/rdf_stream.h>
+#include <Redland/rdf_query.h>
+#include <Redland/rdf_utf8.h>
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+No sonames on Android
+
+--- a/configure 2013-03-29 19:46:34.922901756 +0100
++++ b/configure 2013-03-29 19:46:56.051901574 +0100
+@@ -10267,7 +10267,7 @@
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+
--- /dev/null
+rhbz#809466 change soname of bundled redland libs
+
+--- a/src/Makefile.in 2013-03-30 17:43:48.127008037 +0100
++++ b/src/Makefile.in 2013-03-30 17:44:19.294007769 +0100
+@@ -625,7 +625,7 @@
+ rdf_parser_raptor.c
+
+ EXTRA_DIST = redland.spec redland.spec.in mysql-v1.ttl mysql-v2.ttl
+-librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ \
++librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ -release lo \
+ @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@
+
+ pkgdata_DATA = $(am__append_13)
--- /dev/null
+--- src/rdf_log.c
++++ src/rdf_log.c
+@@ -136,6 +136,7 @@
+ char *buffer = LIBRDF_MALLOC(char*, slocator_len + 2);
+ *buffer=' ';
+ raptor_locator_format(buffer + 1, slocator_len, (raptor_locator*)locator);
++ buffer[slocator_len + 1] = '\0';
+ fputs(buffer, stderr);
+ LIBRDF_FREE(char*, buffer);
+ }
--- /dev/null
+Usual patch to produce Linux-like .so files on FreeBSD
+
+--- a/build/ltmain.sh 2008-02-02 22:28:24.000000000 +0900
++++ b/build/ltmain.sh 2008-07-08 11:58:42.000000000 +0900
+@@ -7341,9 +7341,9 @@
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+- current="$number_major"
+- revision="$number_minor"
+- age="0"
++ current=`expr $number_major + $number_minor`
++ age="$number_minor"
++ revision="$number_revision"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+@@ -7420,8 +7420,8 @@
+ ;;
+
+ freebsd-elf)
+- major=".$current"
+- versuffix=".$current"
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
+ ;;
+
+ irix | nonstopux)
--- /dev/null
+MinGW: libtool falls back to static lib unless -no-undefined given
+
+--- redland/src/Makefile.in.old 2013-03-30 17:43:48.127008037 +0100
++++ redland/src/Makefile.in 2013-03-30 17:47:15.753006253 +0100
+@@ -625,7 +625,7 @@
+ rdf_parser_raptor.c
+
+ EXTRA_DIST = redland.spec redland.spec.in mysql-v1.ttl mysql-v2.ttl
+-librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ \
++librdf_la_LDFLAGS = -version-info @LIBRDF_LIBTOOL_VERSION@ -no-undefined \
+ @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@
+
+ pkgdata_DATA = $(am__append_13)
--- /dev/null
+--- a/src/win32_rdf_config.h Tue Jul 1 05:10:26 2008
++++ b/src/win32_rdf_config.h Wed Feb 18 13:31:07 2009
+@@ -43,7 +43,8 @@
+ #define HAVE_STRICMP 1
+
+ /* MS names for these functions */
+-#define vsnprintf _vsnprintf
++// next line breaks build on wntmsci12
++//#define vsnprintf _vsnprintf
+ #define snprintf _snprintf
+ #define access _access
+ #define stricmp _stricmp
+@@ -72,40 +73,40 @@
+ */
+
+ /* BDB has close method with 2 args */
+-#define HAVE_BDB_CLOSE_2_ARGS 1
++// #define HAVE_BDB_CLOSE_2_ARGS 1
+
+ /* BDB defines DBC */
+-#define HAVE_BDB_CURSOR 1
++// #define HAVE_BDB_CURSOR 1
+
+ /* BDB cursor method has 4 arguments */
+-#define HAVE_BDB_CURSOR_4_ARGS 1
++// #define HAVE_BDB_CURSOR_4_ARGS 1
+
+ /* BDB defines DB_TXN */
+-#define HAVE_BDB_DB_TXN 1
++// #define HAVE_BDB_DB_TXN 1
+
+ /* BDB has fd method with 2 args */
+-#define HAVE_BDB_FD_2_ARGS 1
++// #define HAVE_BDB_FD_2_ARGS 1
+
+ /* Have BDB hash support */
+-#define HAVE_BDB_HASH 1
++// #define HAVE_BDB_HASH 1
+
+ /* BDB has open method with 6 args */
+ /* #undef HAVE_BDB_OPEN_6_ARGS */
+
+ /* BDB has open method with 7 args */
+-#define HAVE_BDB_OPEN_7_ARGS 1
++// #define HAVE_BDB_OPEN_7_ARGS 1
+
+ /* BDB has set_flags method */
+-#define HAVE_BDB_SET_FLAGS 1
++// #define HAVE_BDB_SET_FLAGS 1
+
+ /* BDB has dbopen method */
+ /* #undef HAVE_DBOPEN */
+
+ /* BDB has db_create method */
+-#define HAVE_DB_CREATE 1
++// #define HAVE_DB_CREATE 1
+
+ /* Define to 1 if you have the <db.h> header file. */
+-#define HAVE_DB_H 1
++// #define HAVE_DB_H 1
+
+ /* Define to 1 if you have the <dlfcn.h> header file. */
+ /* undef HAVE_DLFCN_H */
+@@ -141,13 +142,13 @@
+ /* #undef HAVE_LIBWWW */
+
+ /* Have local MD5 digest */
+-#define HAVE_LOCAL_MD5_DIGEST 1
++// #define HAVE_LOCAL_MD5_DIGEST 1
+
+ /* Have local RIPEMD160 digest */
+ /* #undef HAVE_LOCAL_RIPEMD160_DIGEST */
+
+ /* Have local SHA1 digest */
+-#define HAVE_LOCAL_SHA1_DIGEST 1
++// #define HAVE_LOCAL_SHA1_DIGEST 1
+
+ /* Define to 1 if you have the <memory.h> header file. */
+ #define HAVE_MEMORY_H 1
+@@ -159,25 +160,28 @@
+ #define HAVE_MKTEMP 1
+
+ /* MySQL libraries are present */
+-#define HAVE_MYSQL 1
++// #define HAVE_MYSQL 1
+
+ /* Define to 1 if you have the <openssl/crypto.h> header file. */
+ /* #undef HAVE_OPENSSL_CRYPTO_H */
+
+ /* Have openssl MD5 digest */
+ /* #undef HAVE_OPENSSL_CRYPTO_MD5_DIGEST */
+
+ /* Have openssl RIPEMD160 digest */
+ /* #undef HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST */
+
+ /* Have openssl SHA1 digest */
+ /* #undef HAVE_OPENSSL_CRYPTO_SHA1_DIGEST */
+
+ /* Have openssl digests */
+ /* #undef HAVE_OPENSSL_DIGESTS */
+
+ /* Define to 1 if you have the <pthread.h> header file. */
+ /* #undef HAVE_PTHREAD_H */
++#ifdef __MINGW32__
++#undef HAVE_PTHREAD_H
++#endif
+
+ /* Define to 1 if you have the <stdint.h> header file. */
+ #define HAVE_STDINT_H 1
+@@ -246,7 +255,7 @@
+ #define SIZEOF_UNSIGNED_LONG_LONG 8
+
+ /* SQLite API version */
+-#define REDLAND_SQLITE_API 3
++// #define REDLAND_SQLITE_API 3
+
+ /* Define to 1 if you have the ANSI C header files. */
+ #define STDC_HEADERS 1
+@@ -254,14 +263,17 @@
+ /* Building file storage */
+ #define STORAGE_FILE 1
+
++#define STORAGE_HASHES 1
++#define STORAGE_MEMORY 1
++
+ /* Building MySQL storage */
+ /* #define STORAGE_MYSQL 1 */
+
+ /* Building PostgreSQL storage */
+ /*#undef STORAGE_POSTGRESQL*/
+
+ /* Building SQLite storage */
+-#define STORAGE_SQLITE 1
++// #define STORAGE_SQLITE 1
+
+ /* Building 3store storage */
+ /*#undef STORAGE_TSTORE*/
+@@ -273,7 +273,7 @@
+ #define VERSION "1.0.16"
+
+ /* Use POSIX threads */
+-#define WITH_THREADS
++#undef WITH_THREADS
+
+ /* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
--- /dev/null
+--- a/configure.ac 2013-03-30 19:17:11.040959896 +0100
++++ b/configure.ac 2013-03-30 19:47:16.304944385 +0100
+@@ -122,7 +122,7 @@
+
+ AC_CHECK_PROGS(PERL, perl)
+ # Gnome
+-AC_CHECK_PROGS(PKG_CONFIG, pkg-config)
++PKG_PROG_PKG_CONFIG
+
+
+ AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+@@ -520,62 +520,39 @@
+
+ # Check for rasqal before raptor so that we can see if rasqal was already
+ # built with raptor2 and can then enforce raptor2 is required
+-AC_MSG_CHECKING(for rasqal)
+
+ RASQAL_MIN_VERSION=0.9.25
+ RASQAL_MAX_VERSION=0.9.99
+ AC_SUBST(RASQAL_MIN_VERSION)
+ AC_SUBST(RASQAL_MAX_VERSION)
+-if $PKG_CONFIG rasqal --exists; then
+- :
+-else
++PKG_CHECK_MODULES([RASQAL],[rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION],[
++ RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null`
++],[
+ AC_MSG_ERROR(Rasqal is not installed - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION)
+-fi
+-
+-RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null`
+-
+-if $PKG_CONFIG rasqal --atleast-version=$RASQAL_MIN_VERSION --max-version=$RASQAL_MAX_VERSION; then
+- :
+-else
+- AC_MSG_ERROR(Installed rasqal $RASQAL_VERSION is not in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION)
+-fi
++])
+
+-LIBRDF_EXTERNAL_CPPFLAGS="`$PKG_CONFIG rasqal --cflags` $LIBRDF_EXTERNAL_CPPFLAGS"
+-LIBRDF_EXTERNAL_LIBS="`$PKG_CONFIG rasqal --libs` $LIBRDF_EXTERNAL_LIBS"
++LIBRDF_EXTERNAL_CPPFLAGS="$RASQAL_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS"
++LIBRDF_EXTERNAL_LIBS="$RASQAL_LIBS $LIBRDF_EXTERNAL_LIBS"
+
+ rdf_query="rasqal(system $RASQAL_VERSION)"
+-AC_MSG_RESULT(system $RASQAL_VERSION)
+
+
+ # Check for raptor
+ RAPTOR_MIN_VERSION=2.0.7
+
+-
+-
+-AC_MSG_CHECKING(for raptor)
+-
+-if $PKG_CONFIG raptor2 --exists; then
+- :
+-else
++PKG_CHECK_MODULES([RAPTOR2],[raptor2 >= $RAPTOR_MIN_VERSION],[
++ RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
++],[
+ AC_MSG_ERROR(Raptor2 is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION)
+-fi
+-
+-RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
+-
+-if $PKG_CONFIG raptor2 --atleast-version=$RAPTOR_MIN_VERSION; then
+- :
+-else
+- AC_MSG_ERROR(Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION)
+-fi
++])
+
+-LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS `$PKG_CONFIG raptor2 --libs`"
+-LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS `$PKG_CONFIG rasqal --libs`"
++LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RAPTOR2_LIBS"
++LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RASQAL_LIBS"
+
+-LIBRDF_EXTERNAL_CPPFLAGS="`$PKG_CONFIG raptor2 --cflags` $LIBRDF_EXTERNAL_CPPFLAGS"
++LIBRDF_EXTERNAL_CPPFLAGS="$RAPTOR2_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS"
+ LIBRDF_EXTERNAL_LIBS="$LIBRDF_DIRECT_LIBS $LIBRDF_EXTERNAL_LIBS"
+
+ rdf_parsers_available="$parser_available raptor(system $RAPTOR_VERSION)"
+-AC_MSG_RESULT(system $RAPTOR_VERSION)
+
+ AC_SUBST(RAPTOR_MIN_VERSION)
+
+--- a/configure 2013-03-30 19:51:46.680942062 +0100
++++ b/configure 2013-03-30 19:48:15.487943876 +0100
+@@ -660,8 +660,6 @@
+ GTKDOC_MKPDF
+ GTKDOC_REBASE
+ GTKDOC_CHECK
+-PKG_CONFIG_LIBDIR
+-PKG_CONFIG_PATH
+ AM_BACKSLASH
+ AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V
+@@ -725,6 +723,10 @@
+ HASH_OBJS
+ HAVE_RAPTOR2_API
+ RAPTOR_MIN_VERSION
++RAPTOR2_LIBS
++RAPTOR2_CFLAGS
++RASQAL_LIBS
++RASQAL_CFLAGS
+ RASQAL_MAX_VERSION
+ RASQAL_MIN_VERSION
+ GETOPT_FALSE
+@@ -732,6 +734,8 @@
+ MEMCMP_FALSE
+ MEMCMP_TRUE
+ RECHO
++PKG_CONFIG_LIBDIR
++PKG_CONFIG_PATH
+ PKG_CONFIG
+ PERL
+ TAR
+@@ -930,6 +934,10 @@
+ PKG_CONFIG
+ PKG_CONFIG_PATH
+ PKG_CONFIG_LIBDIR
++RASQAL_CFLAGS
++RASQAL_LIBS
++RAPTOR2_CFLAGS
++RAPTOR2_LIBS
+ GTKDOC_DEPS_CFLAGS
+ GTKDOC_DEPS_LIBS'
+ ac_subdirs_all='libltdl'
+@@ -1631,6 +1639,13 @@
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
++ RASQAL_CFLAGS
++ C compiler flags for RASQAL, overriding pkg-config
++ RASQAL_LIBS linker flags for RASQAL, overriding pkg-config
++ RAPTOR2_CFLAGS
++ C compiler flags for RAPTOR2, overriding pkg-config
++ RAPTOR2_LIBS
++ linker flags for RAPTOR2, overriding pkg-config
+ GTKDOC_DEPS_CFLAGS
+ C compiler flags for GTKDOC_DEPS, overriding pkg-config
+ GTKDOC_DEPS_LIBS
+@@ -14088,26 +14103,35 @@
+ done
+
+ # Gnome
+-for ac_prog in pkg-config
+-do
+- # Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
++
++
++
++
++
++
++
++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++ if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
++set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_PKG_CONFIG+:} false; then :
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+- if test -n "$PKG_CONFIG"; then
+- ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ case $PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in $PATH
+ do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_prog_PKG_CONFIG="$ac_prog"
++ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -14115,9 +14139,10 @@
+ done
+ IFS=$as_save_IFS
+
++ ;;
++esac
+ fi
+-fi
+-PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+ if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+ $as_echo "$PKG_CONFIG" >&6; }
+@@ -14127,9 +14152,77 @@
+ fi
+
+
+- test -n "$PKG_CONFIG" && break
++fi
++if test -z "$ac_cv_path_PKG_CONFIG"; then
++ ac_pt_PKG_CONFIG=$PKG_CONFIG
++ # Extract the first word of "pkg-config", so it can be a program name with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $ac_pt_PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
+ done
++ done
++IFS=$as_save_IFS
+
++ ;;
++esac
++fi
++ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
++if test -n "$ac_pt_PKG_CONFIG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
++$as_echo "$ac_pt_PKG_CONFIG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_pt_PKG_CONFIG" = x; then
++ PKG_CONFIG=""
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ PKG_CONFIG=$ac_pt_PKG_CONFIG
++ fi
++else
++ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
++fi
++
++fi
++if test -n "$PKG_CONFIG"; then
++ _pkg_min_version=0.9.0
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ PKG_CONFIG=""
++ fi
++fi
+
+
+
+@@ -15525,66 +15618,183 @@
+
+ # Check for rasqal before raptor so that we can see if rasqal was already
+ # built with raptor2 and can then enforce raptor2 is required
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rasqal" >&5
+-$as_echo_n "checking for rasqal... " >&6; }
+
+ RASQAL_MIN_VERSION=0.9.25
+ RASQAL_MAX_VERSION=0.9.99
+
+
+-if $PKG_CONFIG rasqal --exists; then
+- :
++
++pkg_failed=no
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RASQAL" >&5
++$as_echo_n "checking for RASQAL... " >&6; }
++
++if test -n "$RASQAL_CFLAGS"; then
++ pkg_cv_RASQAL_CFLAGS="$RASQAL_CFLAGS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rasqal >= \$RASQAL_MIN_VERSION rasqal <= \$RASQAL_MAX_VERSION\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RASQAL_CFLAGS=`$PKG_CONFIG --cflags "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
+ else
+- as_fn_error $? "Rasqal is not installed - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION" "$LINENO" 5
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++if test -n "$RASQAL_LIBS"; then
++ pkg_cv_RASQAL_LIBS="$RASQAL_LIBS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rasqal >= \$RASQAL_MIN_VERSION rasqal <= \$RASQAL_MAX_VERSION\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RASQAL_LIBS=`$PKG_CONFIG --libs "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
+ fi
+
+-RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null`
+
+-if $PKG_CONFIG rasqal --atleast-version=$RASQAL_MIN_VERSION --max-version=$RASQAL_MAX_VERSION; then
+- :
++
++if test $pkg_failed = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
+ else
+- as_fn_error $? "Installed rasqal $RASQAL_VERSION is not in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION" "$LINENO" 5
++ _pkg_short_errors_supported=no
+ fi
++ if test $_pkg_short_errors_supported = yes; then
++ RASQAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>&1`
++ else
++ RASQAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rasqal >= $RASQAL_MIN_VERSION rasqal <= $RASQAL_MAX_VERSION" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$RASQAL_PKG_ERRORS" >&5
+
+-LIBRDF_EXTERNAL_CPPFLAGS="`$PKG_CONFIG rasqal --cflags` $LIBRDF_EXTERNAL_CPPFLAGS"
+-LIBRDF_EXTERNAL_LIBS="`$PKG_CONFIG rasqal --libs` $LIBRDF_EXTERNAL_LIBS"
++
++ as_fn_error $? "Rasqal is not installed - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION" "$LINENO" 5
++
++elif test $pkg_failed = untried; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++ as_fn_error $? "Rasqal is not installed - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION" "$LINENO" 5
++
++else
++ RASQAL_CFLAGS=$pkg_cv_RASQAL_CFLAGS
++ RASQAL_LIBS=$pkg_cv_RASQAL_LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++ RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null`
++
++fi
++
++LIBRDF_EXTERNAL_CPPFLAGS="$RASQAL_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS"
++LIBRDF_EXTERNAL_LIBS="$RASQAL_LIBS $LIBRDF_EXTERNAL_LIBS"
+
+ rdf_query="rasqal(system $RASQAL_VERSION)"
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: system $RASQAL_VERSION" >&5
+-$as_echo "system $RASQAL_VERSION" >&6; }
+
+
+ # Check for raptor
+ RAPTOR_MIN_VERSION=2.0.7
+
+
++pkg_failed=no
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAPTOR2" >&5
++$as_echo_n "checking for RAPTOR2... " >&6; }
++
++if test -n "$RAPTOR2_CFLAGS"; then
++ pkg_cv_RAPTOR2_CFLAGS="$RAPTOR2_CFLAGS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RAPTOR2_CFLAGS=`$PKG_CONFIG --cflags "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++if test -n "$RAPTOR2_LIBS"; then
++ pkg_cv_RAPTOR2_LIBS="$RAPTOR2_LIBS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"raptor2 >= \$RAPTOR_MIN_VERSION\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "raptor2 >= $RAPTOR_MIN_VERSION") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RAPTOR2_LIBS=`$PKG_CONFIG --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++
++
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for raptor" >&5
+-$as_echo_n "checking for raptor... " >&6; }
++if test $pkg_failed = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
+
+-if $PKG_CONFIG raptor2 --exists; then
+- :
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
+ else
+- as_fn_error $? "Raptor2 is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
++ _pkg_short_errors_supported=no
+ fi
++ if test $_pkg_short_errors_supported = yes; then
++ RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1`
++ else
++ RAPTOR2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "raptor2 >= $RAPTOR_MIN_VERSION" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$RAPTOR2_PKG_ERRORS" >&5
+
+-RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
+
+-if $PKG_CONFIG raptor2 --atleast-version=$RAPTOR_MIN_VERSION; then
+- :
++ as_fn_error $? "Raptor2 is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
++
++elif test $pkg_failed = untried; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++ as_fn_error $? "Raptor2 is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION" "$LINENO" 5
++
+ else
+- as_fn_error $? "Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION" "$LINENO" 5
++ RAPTOR2_CFLAGS=$pkg_cv_RAPTOR2_CFLAGS
++ RAPTOR2_LIBS=$pkg_cv_RAPTOR2_LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++ RAPTOR_VERSION=`$PKG_CONFIG raptor2 --modversion 2>/dev/null`
++
+ fi
+
+-LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS `$PKG_CONFIG raptor2 --libs`"
+-LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS `$PKG_CONFIG rasqal --libs`"
++LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RAPTOR2_LIBS"
++LIBRDF_DIRECT_LIBS="$LIBRDF_DIRECT_LIBS $RASQAL_LIBS"
+
+-LIBRDF_EXTERNAL_CPPFLAGS="`$PKG_CONFIG raptor2 --cflags` $LIBRDF_EXTERNAL_CPPFLAGS"
++LIBRDF_EXTERNAL_CPPFLAGS="$RAPTOR2_CFLAGS $LIBRDF_EXTERNAL_CPPFLAGS"
+ LIBRDF_EXTERNAL_LIBS="$LIBRDF_DIRECT_LIBS $LIBRDF_EXTERNAL_LIBS"
+
+ rdf_parsers_available="$parser_available raptor(system $RAPTOR_VERSION)"
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: system $RAPTOR_VERSION" >&5
+-$as_echo "system $RAPTOR_VERSION" >&6; }
+
+
+
+@@ -17014,126 +17224,6 @@
+
+
+
+-
+-
+-
+-
+-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+- if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- case $PKG_CONFIG in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+- done
+-IFS=$as_save_IFS
+-
+- ;;
+-esac
+-fi
+-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+-if test -n "$PKG_CONFIG"; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+-$as_echo "$PKG_CONFIG" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-fi
+-if test -z "$ac_cv_path_PKG_CONFIG"; then
+- ac_pt_PKG_CONFIG=$PKG_CONFIG
+- # Extract the first word of "pkg-config", so it can be a program name with args.
+-set dummy pkg-config; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- case $ac_pt_PKG_CONFIG in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+- ;;
+- *)
+- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+- IFS=$as_save_IFS
+- test -z "$as_dir" && as_dir=.
+- for ac_exec_ext in '' $ac_executable_extensions; do
+- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+- done
+-IFS=$as_save_IFS
+-
+- ;;
+-esac
+-fi
+-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+-if test -n "$ac_pt_PKG_CONFIG"; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+- if test "x$ac_pt_PKG_CONFIG" = x; then
+- PKG_CONFIG=""
+- else
+- case $cross_compiling:$ac_tool_warned in
+-yes:)
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+-ac_tool_warned=yes ;;
+-esac
+- PKG_CONFIG=$ac_pt_PKG_CONFIG
+- fi
+-else
+- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+-fi
+-
+-fi
+-if test -n "$PKG_CONFIG"; then
+- _pkg_min_version=0.9.0
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+- else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- PKG_CONFIG=""
+- fi
+-fi
+-
+-
+-
+ # Extract the first word of "gtkdoc-check", so it can be a program name with args.
+ set dummy gtkdoc-check; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
--- /dev/null
+avoid an assert inside rasqal_query_results_next_triple
+
+Happens on the "CONSTRUCT" query in the unordf test.
+
+--- redland/src/rdf_query_rasqal.c 2013-04-14 17:32:08.442000000 +0200
++++ redland/src/rdf_query_rasqal.c 2013-04-14 17:31:57.834000000 +0200
+@@ -1096,7 +1096,9 @@
+ scontext->statement=NULL;
+ }
+
+- scontext->finished=rasqal_query_results_next_triple(scontext->qcontext->results);
++ scontext->finished = !scontext->qcontext->results;
++ if(!scontext->finished)
++ scontext->finished=rasqal_query_results_next_triple(scontext->qcontext->results);
+ if(!scontext->finished)
+ librdf_query_rasqal_query_results_update_statement(scontext);
+
--- /dev/null
+No point in creating example or util executables when cross-compiling.
+(Especially as doing it anyway wouldn't work without tweaks to have it find
+libxml2 and libm, at least for Android.)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -395,7 +395,7 @@
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
+ # Subdirectories to build/install/distribute etc.
+-SUBDIRS = $(subdirs) src examples utils demos docs data scripts
++SUBDIRS = $(subdirs) src docs data scripts
+ EXTRA_DIST = \
+ ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \
+ ChangeLog.5 ChangeLog.6 ChangeLog.7 ChangeLog.8 ChangeLog.9 ChangeLog.10 \
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,rhino,rhino))
+
+$(eval $(call gb_ExternalPackage_use_external_project,rhino,rhino))
+
+$(eval $(call gb_ExternalPackage_add_file,rhino,$(LIBO_SHARE_JAVA_FOLDER)/js.jar,build/rhino1_5R5/js.jar))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,rhino))
+
+$(eval $(call gb_ExternalProject_register_targets,rhino,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,rhino,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(ICECREAM_RUN) "$(ANT)" \
+ -q \
+ -f build.xml \
+ -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
+ -DTARFILE_LOCATION="$(if $(findstring -cygwin,$(BUILD_PLATFORM)),$(shell cygpath -m $(TARFILE_LOCATION)),$(TARFILE_LOCATION))" \
+ $(if $(filter yes,$(JAVACISGCJ))\
+ ,-Dbuild.compiler=gcj \
+ ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
+ -Dant.build.javac.target=$(JAVA_TARGET_VER) \
+ ) \
+ $(if $(debug),-Dbuild.debug="on") \
+ jar \
+ )
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,rhino))
+
+ifneq ($(ENABLE_JAVA),)
+ifneq ($(filter RHINO,$(BUILD_TYPE)),)
+$(eval $(call gb_Module_add_targets,rhino,\
+ ExternalPackage_rhino \
+ ExternalProject_rhino \
+ UnpackedTarball_rhino \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+package org.mozilla.javascript.tools.debugger;
+import java.net.URL;
+import java.util.HashMap;
+import org.mozilla.javascript.Scriptable;
+
+public class OfficeScriptInfo
+{
+ private HashMap<String, SFScriptInfo> loadedSFScripts = new HashMap<String, SFScriptInfo>();
+
+ public void addScript( URL url, Scriptable scope, Runnable closeCallback )
+ {
+ addScript( url.toString(), url, scope, closeCallback );
+ }
+
+ public void addScript( String key, URL url, Scriptable scope, Runnable closeCallback )
+ {
+ SFScriptInfo si = loadedSFScripts.get( key );
+ if ( si == null )
+ {
+ si = new SFScriptInfo();
+ si.url = url;
+ si.scope = scope;
+ si.closeCallback = closeCallback;
+ loadedSFScripts.put( key, si );
+ }
+ }
+
+ public void deleteScript( String key )
+ {
+ SFScriptInfo info = loadedSFScripts.remove( key );
+ if ( info != null )
+ {
+ if ( info.closeCallback != null )
+ {
+ System.out.println("** In removeSFScriptInfo have callback for " + key );
+ info.closeCallback.run(); // really need to do this in separate thread????
+ }
+ }
+ }
+
+ public Scriptable getScriptScope( String key )
+ {
+ Scriptable result = null;
+ SFScriptInfo info = loadedSFScripts.get( key );
+ if ( info != null )
+ {
+ result = info.scope;
+ }
+ return result;
+ }
+
+ public URL getScriptUrl( String key )
+ {
+ URL result = null;
+ SFScriptInfo info = loadedSFScripts.get( key );
+ if ( info != null )
+ {
+ result = info.url;
+ }
+ return result;
+ }
+ public boolean hasScript( String key )
+ {
+ boolean result = true;
+ SFScriptInfo info = loadedSFScripts.get( key );
+ if ( info == null )
+ {
+ result = false;
+ }
+ return result;
+ }
+
+ public void setScriptRunning( String key, boolean running )
+ {
+ SFScriptInfo info = loadedSFScripts.get( key );
+ if ( info != null )
+ {
+ info.isExecuting = running;
+ }
+ }
+
+ public boolean isScriptRunning( String key )
+ {
+ boolean result = false;
+ SFScriptInfo info = loadedSFScripts.get( key );
+ if ( info != null )
+ {
+ result = info.isExecuting;
+ }
+ return result;
+ }
+
+ class SFScriptInfo
+ {
+ Scriptable scope;
+ boolean isExecuting;
+ URL url;
+ Runnable closeCallback;
+ }
+}
--- /dev/null
+JavaScript engine/interpreter written in Java, used to provide JavaScript extensions.
+
+The Scripting Framework makes use of the Rhino ([http://www.mozilla.org/rhino/])
+JavaScript interpreter, available under the Mozilla Public License
+([http://www.mozilla.org/MPL/MPL-1.1.html]).
+
+In addition, to support the debugging of scripts contained in OpenOffice.org
+documents, we have modified the Java source file Main.java.
+
+The Rhino source tarball is unpacked and patched with the modified code. The
+Rhino Jar file (js.jar) is then built (download/swingExSrc.zip is unpacked and
+built as part of this procesS) and delivered to the solver. The file
+rhino1_5R5.patch contains the changes made in order to build Rhino. The patch
+was generated using the command: diff -wurN
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,rhino))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,rhino,$(RHINO_TARBALL),,rhino))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,rhino,2))
+
+$(eval $(call gb_UnpackedTarball_add_patches,rhino,\
+ external/rhino/rhino1_5R5.patch \
+ external/rhino/rhino1_5R5-find_swing.patch \
+ external/rhino/rhino1_5R5-updateToolTip.patch \
+))
+
+$(eval $(call gb_UnpackedTarball_add_file,rhino,toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java,external/rhino/OfficeScriptInfo.java))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/rhino1_5R5/toolsrc/build.xml 2009-10-29 18:29:46.605524507 +0100
++++ misc/build/rhino1_5R5/toolsrc/build.xml 2009-10-29 18:29:26.536908810 +0100
+@@ -12,6 +12,7 @@
+ <os family="unix"/>
+ </and>
+ </condition>
++ <property name="swing_zip" value="${TARFILE_LOCATION}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip"/>
+ <path id="macPath" location="${java.home}/../Classes/classes.jar"/>
+ <!-- rhino.jar from OpenJDK breaks build -->
+ <path id="nonMacPath">
+@@ -38,7 +42,7 @@
+ <!-- Download source from Sun's site, unzip it, remove
+ the files we don't need, and change the package
+ -->
+- <unzip src="../../../../../download/swingExSrc.zip" dest="${src.debugger}"/>
++ <unzip src="${swing_zip}" dest="${src.debugger}"/>
+ <delete file="${src.debugger}/FileSystemModel2.java" />
+ <delete file="${src.debugger}/MergeSort.java" />
+ <delete file="${src.debugger}/TreeTableExample2.java" />
--- /dev/null
+--- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java Wed Feb 23 10:25:09 2011
++++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java Wed Feb 23 10:25:01 2011
+@@ -1045,9 +1045,18 @@
+ } );
+ }
+
++ // Fix taken from <ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip>
++ // toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java:
+ private void updateToolTip() {
+- // in case fileName is very long, try to set tool tip on frame
+- Component c = getComponent(1);
++ // Try to set tool tip on frame. On Mac OS X 10.5,
++ // the number of components is different, so try to be safe.
++ int n = getComponentCount() - 1;
++ if (n > 1) {
++ n = 1;
++ } else if (n < 0) {
++ return;
++ }
++ Component c = getComponent(n);
+ // this will work at least for Metal L&F
+ if (c != null && c instanceof JComponent) {
+ ((JComponent)c).setToolTipText(getUrl());
--- /dev/null
+--- misc/rhino1_5R5/src/org/mozilla/javascript/DefiningClassLoader.java Thu Mar 25 21:54:34 2004
++++ misc/build/rhino1_5R5/src/org/mozilla/javascript/DefiningClassLoader.java Fri Mar 28 17:24:23 2008
+@@ -38,6 +38,7 @@
+ package org.mozilla.javascript;
+
+ import java.lang.reflect.Method;
++import java.lang.reflect.InvocationTargetException;
+
+ /**
+ * Load generated classes.
+@@ -48,11 +49,34 @@
+ implements GeneratedClassLoader
+ {
+ public DefiningClassLoader() {
+- this.parentLoader = getClass().getClassLoader();
++ init(getClass().getClassLoader());
+ }
+
+ public DefiningClassLoader(ClassLoader parentLoader) {
++
++ init(parentLoader);
++ }
++
++ private void init(ClassLoader parentLoader) {
++
+ this.parentLoader = parentLoader;
++
++ this.contextLoader = null;
++ if (method_getContextClassLoader != null) {
++ try {
++ this.contextLoader = (ClassLoader)
++ method_getContextClassLoader.invoke(
++ Thread.currentThread(),
++ ScriptRuntime.emptyArgs);
++ } catch (IllegalAccessException ex) {
++ } catch (InvocationTargetException ex) {
++ } catch (SecurityException ex) {
++ }
++ if (this.contextLoader == this.parentLoader) {
++ this.contextLoader = null;
++ }
++ }
++
+ }
+
+ public Class defineClass(String name, byte[] data) {
+@@ -68,10 +92,20 @@
+ {
+ Class cl = findLoadedClass(name);
+ if (cl == null) {
+- if (parentLoader != null) {
+- cl = parentLoader.loadClass(name);
++ // First try parent class loader and if that does not work, try
++ // contextLoader, but that will be null if
++ // Thread.getContextClassLoader() == parentLoader
++ // or on JDK 1.1 due to lack Thread.getContextClassLoader().
++ // To avoid catching and rethrowing ClassNotFoundException
++ // in this cases, use try/catch check only if contextLoader != null.
++ if (contextLoader == null) {
++ cl = loadFromParent(name);
+ } else {
+- cl = findSystemClass(name);
++ try {
++ cl = loadFromParent(name);
++ } catch (ClassNotFoundException ex) {
++ cl = contextLoader.loadClass(name);
++ }
+ }
+ }
+ if (resolve) {
+@@ -80,5 +114,37 @@
+ return cl;
+ }
+
++ private Class loadFromParent(String name)
++ throws ClassNotFoundException
++ {
++ if (parentLoader != null) {
++ return parentLoader.loadClass(name);
++ } else {
++ return findSystemClass(name);
++ }
++
++ }
++
+ private ClassLoader parentLoader;
++
++ private ClassLoader contextLoader;
++
++ // We'd like to use "Thread.getContextClassLoader", but
++ // that's only available on Java2.
++ private static Method method_getContextClassLoader;
++
++ static {
++ try {
++ // Don't use "Thread.class": that performs the lookup
++ // in the class initializer, which doesn't allow us to
++ // catch possible security exceptions.
++ Class threadClass = Class.forName("java.lang.Thread");
++ method_getContextClassLoader =
++ threadClass.getDeclaredMethod("getContextClassLoader",
++ new Class[0]);
++ } catch (ClassNotFoundException e) {
++ } catch (NoSuchMethodException e) {
++ } catch (SecurityException e) {
++ }
++ }
+ }
+--- misc/rhino1_5R5/toolsrc/build.xml 2004-03-25 21:54:34.000000000 +0100
++++ misc/build/rhino1_5R5/toolsrc/build.xml 2009-01-17 20:46:44.000000000 +0100
+@@ -6,6 +6,24 @@
+ -->
+ <project name="toolsrc" default="compile" basedir=".">
+
++ <condition property="boot_refID" value="macPath" else="nonMacPath">
++ <and>
++ <os family="mac"/>
++ <os family="unix"/>
++ </and>
++ </condition>
++ <path id="macPath" location="${java.home}/../Classes/classes.jar"/>
++ <!-- rhino.jar from OpenJDK breaks build -->
++ <path id="nonMacPath">
++ <fileset dir="${java.home}/">
++ <include name="jre/lib/*.jar"/>
++ <include name="lib/*.jar"/>
++ <exclude name="jre/lib/rhino.jar"/>
++ <exclude name="lib/rhino.jar"/>
++ </fileset>
++ </path>
++ <path id="my.bootstrap.classpath" refID="${boot_refID}"/>
++
+ <target name="properties">
+ <property name="nest" value=".."/>
+ <property name="build.dir" value="./build"/>
+@@ -20,46 +38,10 @@
+ <!-- Download source from Sun's site, unzip it, remove
+ the files we don't need, and change the package
+ -->
+- <get src="http://java.sun.com/products/jfc/tsc/articles/treetable2/downloads/src.zip" dest="${nest}/${build.dir}/swingExSrc.zip"/>
+- <unzip src="${nest}/${build.dir}/swingExSrc.zip" dest="${src.debugger}"/>
++ <unzip src="../../../../../download/swingExSrc.zip" dest="${src.debugger}"/>
+ <delete file="${src.debugger}/FileSystemModel2.java" />
+ <delete file="${src.debugger}/MergeSort.java" />
+ <delete file="${src.debugger}/TreeTableExample2.java" />
+- <replace file="${src.debugger}/AbstractCellEditor.java">
+- <replacetoken>import java.awt.Component;</replacetoken>
+- <replacevalue>
+- package org.mozilla.javascript.tools.debugger;
+- import java.awt.Component;
+- </replacevalue>
+- </replace>
+- <replace file="${src.debugger}/AbstractTreeTableModel.java">
+- <replacetoken>import javax.swing.tree.*;</replacetoken>
+- <replacevalue>
+- package org.mozilla.javascript.tools.debugger;
+- import javax.swing.tree.*;
+- </replacevalue>
+- </replace>
+- <replace file="${src.debugger}/JTreeTable.java">
+- <replacetoken>import javax.swing.*;</replacetoken>
+- <replacevalue>
+- package org.mozilla.javascript.tools.debugger;
+- import javax.swing.*;
+- </replacevalue>
+- </replace>
+- <replace file="${src.debugger}/TreeTableModel.java">
+- <replacetoken>import javax.swing.tree.TreeModel;</replacetoken>
+- <replacevalue>
+- package org.mozilla.javascript.tools.debugger;
+- import javax.swing.tree.TreeModel;
+- </replacevalue>
+- </replace>
+- <replace file="${src.debugger}/TreeTableModelAdapter.java">
+- <replacetoken>import javax.swing.JTree;</replacetoken>
+- <replacevalue>
+- package org.mozilla.javascript.tools.debugger;
+- import javax.swing.JTree;
+- </replacevalue>
+- </replace>
+ </target>
+
+ <target name="compile" depends="properties,get-swing-ex">
+@@ -68,6 +50,7 @@
+ includes="org/**/*.java"
+ deprecation="on"
+ debug="${debug}">
++ <compilerarg value="-Xbootclasspath:${toString:my.bootstrap.classpath}"/>
+ </javac>
+ <copy todir="${nest}/${classes}">
+ <fileset dir="." includes="org/**/*.properties" />
+--- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java 2004-03-25 21:54:34.000000000 +0100
++++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/Main.java 2009-01-17 20:44:22.000000000 +0100
+@@ -470,15 +470,21 @@
+ case KeyEvent.VK_BACK_SPACE:
+ case KeyEvent.VK_ENTER:
+ case KeyEvent.VK_DELETE:
++ if (w.isEditable() == false) {
+ e.consume();
++ }
+ break;
+ }
+ }
+ public void keyTyped(KeyEvent e) {
++ if (w.isEditable() == false) {
+ e.consume();
++ }
+ }
+ public void keyReleased(KeyEvent e) {
++ if (w.isEditable() == false) {
+ e.consume();
++ }
+ }
+ }
+
+@@ -879,7 +885,7 @@
+ }
+ };
+
+-class FileWindow extends JInternalFrame implements ActionListener {
++class FileWindow extends JInternalFrame implements ActionListener, DocumentListener {
+
+ Main db;
+ SourceInfo sourceInfo;
+@@ -888,15 +894,16 @@
+ JScrollPane p;
+ int currentPos;
+ JLabel statusBar;
++ boolean isModified = false;
+
+ public void actionPerformed(ActionEvent e) {
+ String cmd = e.getActionCommand();
+ if (cmd.equals("Cut")) {
+- // textArea.cut();
++ textArea.cut();
+ } else if (cmd.equals("Copy")) {
+ textArea.copy();
+ } else if (cmd.equals("Paste")) {
+- // textArea.paste();
++ textArea.paste();
+ }
+ }
+
+@@ -910,17 +917,73 @@
+ }
+
+ void load() {
+- Scriptable scope = db.getScope();
++ //Scriptable scope = db.getScope();
++ Scriptable scope = db.officeScripts.getScriptScope( getUrl() );
++ if ( scope == null )
++ {
++ scope = db.getScope();
++ }
+ if (scope == null) {
+ MessageDialogWrapper.showMessageDialog(db, "Can't load scripts: no scope available", "Run", JOptionPane.ERROR_MESSAGE);
+ } else {
+ String url = getUrl();
+ if (url != null) {
+- new Thread(new LoadFile(db,scope,url)).start();
++ new Thread(new LoadFile(db,scope, url, new StringReader(textArea.getText()))).start();
+ }
+ }
+ }
+
++ void save() {
++ if (getUrl() != null) {
++ OutputStream os = null;
++ try {
++ if ( getUrl().startsWith("vnd.sun.star") )
++ {
++ URL scriptUrl = db.officeScripts.getScriptUrl( getUrl() );
++ if ( scriptUrl == null )
++ {
++ throw new IOException("Can't optain stream for " + getUrl() );
++ }
++ os = scriptUrl.openConnection().getOutputStream();
++ }
++ else
++ {
++ os = new FileOutputStream( getUrl() );
++ }
++ String s = textArea.getText();
++ os.write(s.getBytes(), 0, s.length());
++
++ this.isModified = false;
++ }
++ catch (IOException ioe) {
++ JOptionPane.showMessageDialog(this,
++ "Error saving file: " + ioe.getMessage(),
++ "Error", JOptionPane.ERROR_MESSAGE);
++ }
++ finally
++ {
++ if ( os != null )
++ {
++ try
++ {
++ os.close();
++ os = null;
++ }
++ catch( IOException ioe )
++ {
++ System.err.println("Error closing stream: " + ioe.getMessage() );
++ ioe.printStackTrace();
++ }
++ }
++ }
++ }
++ }
++
++ public boolean isEditable() {
++ return db.isSourceEditingEnabled();
++ }
++
++
+ public int getPosition(int line) {
+ int result = -1;
+ try {
+@@ -953,7 +1016,7 @@
+ fileHeader.repaint();
+ }
+ }
+-
++ public Main getDB() { return db; }
+ FileWindow(Main db, SourceInfo sourceInfo) {
+ super(SourceInfo.getShortName(sourceInfo.getUrl()),
+ true, true, true, true);
+@@ -972,6 +1035,14 @@
+ pack();
+ updateText();
+ textArea.select(0);
++ addInternalFrameListener( new InternalFrameAdapter() {
++ public void internalFrameClosed(InternalFrameEvent e) {
++ // clean up scriptItems and sourceNames hashes
++ getDB().removeScript( getUrl() );
++ // remove scripts for officeScripts
++ getDB().officeScripts.deleteScript( getUrl() );
++ }
++ } );
+ }
+
+ private void updateToolTip() {
+@@ -990,7 +1061,10 @@
+ void updateText() {
+ String newText = sourceInfo.getSource();
+ if (!textArea.getText().equals(newText)) {
++ textArea.getDocument().removeDocumentListener(this);
+ textArea.setText(newText);
++ this.isModified = false;
++ textArea.getDocument().addDocumentListener(this);
+ int pos = 0;
+ if (currentPos != -1) {
+ pos = currentPos;
+@@ -1001,6 +1075,31 @@
+ fileHeader.repaint();
+ }
+
++ /* Implementation of DocumentListener interface */
++ public void insertUpdate(DocumentEvent e) {
++ doChanged(e);
++ }
++
++ public void removeUpdate(DocumentEvent e) {
++ doChanged(e);
++ }
++
++ public void changedUpdate(DocumentEvent e) {
++ doChanged(e);
++ }
++
++ public void doChanged(DocumentEvent e) {
++ this.isModified = true;
++ }
++
++ public boolean isModified() {
++ return this.isModified;
++ }
++
++ public String getText() {
++ return textArea.getText();
++ }
++
+ void setPosition(int pos) {
+ textArea.select(pos);
+ currentPos = pos;
+@@ -1618,7 +1717,7 @@
+ if (line != -1) {
+ db.currentWindow = w;
+ }
+- db.menubar.addFile(url);
++ // db.menubar.addFile(url);
+ w.setVisible(true);
+ if (activate) {
+ try {
+@@ -1752,8 +1851,10 @@
+ Menubar(Main db) {
+ super();
+ this.db = db;
+- String[] fileItems = {"Open...", "Run...", "", "Exit"};
+- String[] fileCmds = {"Open", "Load", "", "Exit"};
++ // String[] fileItems = {"Open...", "Run...", "", "Exit"};
++ // String[] fileCmds = {"Open", "Load", "", "Exit"};
++ String[] fileItems = {"Run", "Save", "", "Exit"};
++ String[] fileCmds = {"Run", "Save", "", "Exit"};
+ char[] fileShortCuts = {'0', 'N', '\0', 'X'};
+ int[] fileAccelerators = {KeyEvent.VK_O,
+ KeyEvent.VK_N,
+@@ -1795,6 +1896,9 @@
+ KeyStroke k = KeyStroke.getKeyStroke(fileAccelerators[i], Event.CTRL_MASK);
+ item.setAccelerator(k);
+ }
++ if (fileItems[i].equals("Save")) {
++ saveItem = item;
++ }
+ }
+ }
+ for (int i = 0; i < editItems.length; ++i) {
+@@ -1849,9 +1953,9 @@
+ item.addActionListener(this);
+ windowMenu.add(item = new JMenuItem("Tile", 'T'));
+ item.addActionListener(this);
+- windowMenu.addSeparator();
+- windowMenu.add(item = new JMenuItem("Console", 'C'));
+- item.addActionListener(this);
++// windowMenu.addSeparator();
++// windowMenu.add(item = new JMenuItem("Console", 'C'));
++// item.addActionListener(this);
+ add(windowMenu);
+
+ }
+@@ -1925,11 +2029,16 @@
+ item.addActionListener(this);
+ }
+
++ public void setSaveEnabled(boolean state) {
++ saveItem.setEnabled(state);
++ }
++
+ Main db;
+ JMenu windowMenu;
+ JCheckBoxMenuItem breakOnExceptions;
+ JCheckBoxMenuItem breakOnEnter;
+ JCheckBoxMenuItem breakOnReturn;
++ JMenuItem saveItem;
+ };
+
+ class EnterInterrupt implements Runnable {
+@@ -1942,6 +2051,13 @@
+ public void run() {
+ JMenu menu = db.getJMenuBar().getMenu(0);
+ //menu.getItem(0).setEnabled(false); // File->Load
++
++ // disable Edit menu Cut, Copy, Paste items
++ menu = db.getJMenuBar().getMenu(1);
++ for (int i = 0; i < 3; i++) {
++ menu.getItem(i).setEnabled(false);
++ }
++
+ menu = db.getJMenuBar().getMenu(2);
+ menu.getItem(0).setEnabled(false); // Debug->Break
+ int count = menu.getItemCount();
+@@ -1954,6 +2070,10 @@
+ b = true;
+ }
+ db.toolBar.setEnabled(true);
++
++ // set flag to disable source editing
++ db.setSourceEditingEnabled(false);
++
+ // raise the debugger window
+ db.toFront();
+ }
+@@ -1967,6 +2087,13 @@
+ public void run() {
+ JMenu menu = db.getJMenuBar().getMenu(0);
+ menu.getItem(0).setEnabled(true); // File->Load
++
++ // enable Edit menu items
++ menu = db.getJMenuBar().getMenu(1);
++ for (int i = 0; i < 3; i++) {
++ menu.getItem(i).setEnabled(true);
++ }
++
+ menu = db.getJMenuBar().getMenu(2);
+ menu.getItem(0).setEnabled(true); // Debug->Break
+ int count = menu.getItemCount() - 1;
+@@ -1980,6 +2107,10 @@
+ db.toolBar.getComponent(ci).setEnabled(b);
+ b = false;
+ }
++
++ // set flag to enable source editing
++ db.setSourceEditingEnabled(true);
++
+ //db.console.consoleTextArea.requestFocus();
+ }
+ };
+@@ -1988,17 +2119,24 @@
+ {
+ String fileName;
+ Main db;
++ Reader reader = null;
+ OpenFile(Main db, String fileName)
+ {
+ this.fileName = fileName;
+ this.db = db;
+ }
++ OpenFile(Main db, String fileName, Reader reader) {
++ this(db, fileName);
++ this.reader = reader;
++ }
+ public void run() {
+ Context cx = Context.enter();
+ ContextData contextData = ContextData.get(cx);
+ contextData.breakNextLine = true;
+ try {
+- cx.compileReader(new FileReader(fileName), fileName, 1, null);
++ cx.compileReader(
++ reader == null ? new FileReader(fileName) : reader,
++ fileName, 1, null);
+ } catch (Exception exc) {
+ String msg = exc.getMessage();
+ if (exc instanceof EcmaError) {
+@@ -2019,29 +2157,79 @@
+ Scriptable scope;
+ String fileName;
+ Main db;
++ Reader reader = null;
++ Object result = null;
++ Exception exception = null;
++ int lineNum = -1;
++ boolean sfExecute = false;
++
+ LoadFile(Main db, Scriptable scope, String fileName) {
+ this.scope = scope;
+ this.fileName = fileName;
+ this.db = db;
+ }
++
++ LoadFile(Main db, Scriptable scope, String fileName, Reader reader) {
++ this(db, scope, fileName);
++ this.reader = reader;
++ }
++ LoadFile(Main db, Scriptable scope, String fileName, Reader reader, boolean sfExecute ) {
++ this(db, scope, fileName);
++ this.reader = reader;
++ this.sfExecute = sfExecute;
++ }
++
+ public void run() {
++ if ( db.officeScripts.isScriptRunning( fileName ) )
++ {
++ exception = new Exception("The script is already executing");
++ if ( !sfExecute ) {
++ MessageDialogWrapper.showMessageDialog(db,
++ "Script already executing",
++ "Run",
++ JOptionPane.ERROR_MESSAGE);
++ }
++ return;
++ }
++ db.officeScripts.setScriptRunning( fileName, true );
+ Context cx = Context.enter();
+ ContextData contextData = ContextData.get(cx);
++ if ( sfExecute )
++ {
++ contextData.breakNextLine = false;
++ }
++ else
++ {
+ contextData.breakNextLine = true;
++ }
++ /*
++ FileWindow w = (FileWindow)db.getSelectedFrame();
++ if ( sfExecute )
++ {
++ db.swingInvoke(new SetFilePosition(db, w, -1 ) );
++ }*/
+ try {
+- cx.evaluateReader(scope, new FileReader(fileName),
++ result = cx.evaluateReader(scope,
++ reader == null ? new FileReader(fileName) : reader,
+ fileName, 1, null);
+ } catch (Exception exc) {
++ exception = exc;
+ String msg = exc.getMessage();
+ if (exc instanceof EcmaError) {
+ EcmaError err = (EcmaError)exc;
+ msg = err.getSourceName() + ", line " + err.getLineNumber() + ": " + msg;
+- }
++
++ int lineNum = err.getLineNumber() ;
++ //db.swingInvoke(new SetFilePosition(db, w, lineNum ) );
++ if ( !sfExecute ) {
+ MessageDialogWrapper.showMessageDialog(db,
+ msg,
+ "Run",
+ JOptionPane.ERROR_MESSAGE);
++ }
++ }
+ } finally {
++ db.officeScripts.setScriptRunning( fileName, false );
+ cx.exit();
+ }
+ }
+@@ -2416,13 +2604,13 @@
+ super.setVisible(b);
+ if (b) {
+ // this needs to be done after the window is visible
+- console.consoleTextArea.requestFocus();
++ // console.consoleTextArea.requestFocus();
+ context.split.setDividerLocation(0.5);
+ try {
+- console.setMaximum(true);
+- console.setSelected(true);
+- console.show();
+- console.consoleTextArea.requestFocus();
++ // console.setMaximum(true);
++ // console.setSelected(true);
++ // console.show();
++ // console.consoleTextArea.requestFocus();
+ } catch (Exception exc) {
+ }
+ }
+@@ -2449,35 +2637,6 @@
+
+ Hashtable functionNames = new Hashtable();
+
+- ScriptItem getScriptItem(DebuggableScript fnOrScript) {
+- ScriptItem item = (ScriptItem)scriptItems.get(fnOrScript);
+- if (item == null) {
+- String url = getNormilizedUrl(fnOrScript);
+- SourceInfo si = (SourceInfo)sourceNames.get(url);
+- if (si == null) {
+- if (!fnOrScript.isGeneratedScript()) {
+- // Not eval or Function, try to load it from URL
+- String source = null;
+- try {
+- InputStream is = openSource(url);
+- try { source = readSource(is); }
+- finally { is.close(); }
+- } catch (IOException ex) {
+- System.err.println
+- ("Failed to load source from "+url+": "+ ex);
+- }
+- if (source != null) {
+- si = registerSource(url, source);
+- }
+- }
+- }
+- if (si != null) {
+- item = registerScript(si, fnOrScript);
+- }
+- }
+- return item;
+- }
+-
+ /* Debugger Interface */
+
+ public void handleCompilationDone(Context cx, DebuggableScript fnOrScript,
+@@ -2490,7 +2649,7 @@
+
+ String getNormilizedUrl(DebuggableScript fnOrScript) {
+ String url = fnOrScript.getSourceName();
+- if (url == null) { url = "<stdin>"; }
++ if (url == null) { url = "document"; }
+ else {
+ // Not to produce window for eval from different lines,
+ // strip line numbers, i.e. replace all #[0-9]+\(eval\) by (eval)
+@@ -2601,7 +2760,7 @@
+ if (si == null) {
+ si = new SourceInfo(sourceUrl, source);
+ sourceNames.put(sourceUrl, si);
+- } else {
++ } else if (!source.equals(si.getSource())) {
+ si.setSource(source);
+ }
+ }
+@@ -2762,7 +2921,7 @@
+ desk = new JDesktopPane();
+ desk.setPreferredSize(new Dimension(600, 300));
+ desk.setMinimumSize(new Dimension(150, 50));
+- desk.add(console = new JSInternalConsole("JavaScript Console"));
++ // desk.add(console = new JSInternalConsole("JavaScript Console"));
+ context = new ContextWindow(this);
+ context.setPreferredSize(new Dimension(600, 120));
+ context.setMinimumSize(new Dimension(50, 50));
+@@ -2871,7 +3030,7 @@
+ FrameHelper frame = contextData.getFrame(frameIndex);
+ String sourceName = frame.getUrl();
+ if (sourceName == null || sourceName.equals("<stdin>")) {
+- console.show();
++ // console.show();
+ helper.reset();
+ return;
+ }
+@@ -2895,6 +3054,19 @@
+ int dispatcherIsWaiting = 0;
+ Context currentContext = null;
+
++ // Flag used to establish whether source code editing is allowed in
++ // the debugger, switched on and off depending on whether a debug session
++ // is active
++ boolean sourceEditingEnabled = true;
++
++ public boolean isSourceEditingEnabled() {
++ return sourceEditingEnabled;
++ }
++
++ void setSourceEditingEnabled(boolean b) {
++ sourceEditingEnabled = b;
++ }
++
+ Context getCurrentContext() {
+ return currentContext;
+ }
+@@ -3028,14 +3200,14 @@
+ swingInvoke(CreateFileWindow.action(this, si, line));
+ }
+ } else {
+- if (console.isVisible()) {
++ /* if (console.isVisible()) {
+ final JSInternalConsole finalConsole = console;
+ swingInvoke(new Runnable() {
+ public void run() {
+ finalConsole.show();
+ }
+ });
+- }
++ } */
+ }
+ swingInvoke(new EnterInterrupt(this, cx));
+ swingInvoke(new UpdateContext(this, cx));
+@@ -3217,6 +3389,14 @@
+ fileName)).start();
+ }
+ }
++ } else if (cmd.equals("Run")) {
++ FileWindow w = (FileWindow)getSelectedFrame();
++ if (w != null)
++ w.load();
++ } else if (cmd.equals("Save")) {
++ FileWindow w = (FileWindow)getSelectedFrame();
++ if (w != null)
++ w.save();
+ } else if (cmd.equals("More Windows...")) {
+ MoreWindows dlg = new MoreWindows(this, fileWindows,
+ "Window", "Files");
+@@ -3509,6 +3689,60 @@
+ }
+ }
+
++ JInternalFrame getFrameForUrl( URL url )
++ {
++ JInternalFrame[] frames = desk.getAllFrames();
++ for (int i = 0; i < frames.length; i++) {
++ FileWindow w = (FileWindow)frames[i];
++ if ( url.toString().equals( w.getUrl() ) ) {
++ return w;
++ }
++ }
++ return null;
++ }
++ public void highlighLineInSelectedWindow(URL url, int lineNum ){
++ //FileWindow w = (FileWindow)getFrameForUrl( url );
++ FileWindow w = (FileWindow)getSelectedFrame();
++ if (w != null)
++ {
++ if ( lineNum > -1 )
++ swingInvoke(new SetFilePosition(this, w, lineNum ) );
++ }
++ }
++ public Object runSelectedWindow( URL scriptUrl ) throws Exception
++ {
++ Object result = null;
++ FileWindow w = (FileWindow)getSelectedFrame();
++ //FileWindow w = (FileWindow)getFrameForUrl( scriptUrl );
++ w.toFront();
++ if (w != null)
++ {
++ Scriptable scope = w.db.getScope();
++ if (scope == null)
++ {
++ MessageDialogWrapper.showMessageDialog(w.db, "Can't load scripts: no scope available", "Run", JOptionPane.ERROR_MESSAGE);
++ result = null;
++ }
++ else
++ {
++ String url = w.getUrl();
++ Thread executorThread = null;
++ if (url != null)
++ {
++ LoadFile executor = new LoadFile(w.db,scope, url, new StringReader(w.textArea.getText()), true );
++ executor.run();
++ result = executor.result;
++ if ( executor.exception != null )
++ {
++ throw executor.exception;
++ }
++ }
++ }
++ }
++ return result;
++
++ }
++
+ //
+ // public interface
+ //
+@@ -3604,6 +3838,69 @@
+ return console.getErr();
+ }
+
++ public void openFile(URL scriptUrl, Scriptable scope, Runnable closeCallback ) {
++ if (scope == null) {
++ MessageDialogWrapper.showMessageDialog(this,
++ "Can't compile scripts: no scope available",
++ "Open", JOptionPane.ERROR_MESSAGE);
++ } else {
++ if (scriptUrl != null) {
++ try
++ {
++ InputStreamReader reader = new InputStreamReader(scriptUrl.openStream());
++ String fileName = null;
++ if ( scriptUrl.getProtocol().startsWith("vnd.sun.star.") )
++ {
++ fileName = scriptUrl.toString();
++ }
++ else
++ {
++ fileName = scriptUrl.getPath();
++ }
++ officeScripts.addScript( fileName, scriptUrl, scope, closeCallback );
++ //new Thread(new OpenFile(this, scope, fileName, reader )).start();
++ swingInvoke( new OpenFile(this, fileName, reader ));
++ }
++ catch ( IOException e )
++ {
++ MessageDialogWrapper.showMessageDialog(this,
++ "Can't open stream for script: " + e.toString(),
++ "Open", JOptionPane.ERROR_MESSAGE);
++ }
++ }
++ }
++ split1.setDividerLocation(1.0);
++ }
++
++ public void openFile(String fileName) {
++ Scriptable scope = getScope();
++ if (scope == null) {
++ MessageDialogWrapper.showMessageDialog(this,
++ "Can't compile scripts: no scope available",
++ "Open", JOptionPane.ERROR_MESSAGE);
++ } else {
++ if (fileName != null) {
++ new Thread(new OpenFile(this, fileName)).start();
++ }
++ }
++ split1.setDividerLocation(1.0);
++ }
++
++ public void openStream(InputStream in) {
++ Scriptable scope = getScope();
++ if (scope == null) {
++ MessageDialogWrapper.showMessageDialog(this,
++ "Can't compile scripts: no scope available",
++ "Open", JOptionPane.ERROR_MESSAGE);
++ } else {
++ if (in != null) {
++ new Thread(new OpenFile(this, null, new InputStreamReader(in))).start();
++ }
++ }
++ split1.setDividerLocation(1.0);
++ menubar.setSaveEnabled(false);
++ }
++
+ public static void main(String[] args) {
+ try {
+ mainThread = Thread.currentThread();
+@@ -3635,5 +3932,162 @@
+ }
+ }
+
++ // patched Office specific interface
++
++ OfficeScriptInfo officeScripts = new OfficeScriptInfo();
++
++ void removeScript( String url )
++ {
++ // Remove the FileWindow from list of open sources
++ fileWindows.remove( url );
++
++ // Remove sourceInfo from sourceNames, ensures that
++ // breakpoints etc are deleted
++ synchronized (sourceNames) {
++ sourceNames.remove( url );
++ }
++ // Removes scriptItems for the script, ensures that a new open ( from openFile )
++ // will succeed, openFile should open file but fails due to fact that
++ synchronized ( scriptItems )
++ {
++ Iterator iter = scriptItems.entrySet().iterator();
++ while ( iter.hasNext() )
++ {
++ Map.Entry me = ( Map.Entry )iter.next();
++ ScriptItem item = (ScriptItem)me.getValue();
++ SourceInfo si = item.getSourceInfo();
++ if ( si.getUrl().equals( url ) )
++ {
++ //match
++ scriptItems.remove( me.getKey() );
++ break;
++ }
++ }
++ }
++ officeScripts.deleteScript( url );
++ }
++
++
++ ScriptItem getScriptItem(DebuggableScript fnOrScript) {
++ ScriptItem item = (ScriptItem)scriptItems.get(fnOrScript);
++ if (item == null) {
++ String url = getNormilizedUrl(fnOrScript);
++ SourceInfo si = (SourceInfo)sourceNames.get(url);
++ if (si == null) {
++ if (!fnOrScript.isGeneratedScript()) {
++ // Not eval or Function, try to load it from URL
++ String source = null;
++ try {
++ InputStream is = openSource(url);
++ try { source = readSource(is); }
++ finally { is.close(); }
++ } catch (IOException ex) {
++ System.err.println
++ ("Failed to load source from "+url+": "+ ex);
++ }
++ if (source != null) {
++ si = registerSource(url, source);
++ }
++ }
++ }
++ if (si != null) {
++ item = registerScript(si, fnOrScript);
++ }
++ }
++
++ return item;
++ }
++
++ public void showScriptWindow(URL url ){
++ String key = url.getPath();
++ if ( url.getProtocol().startsWith("vnd.sun.star") )
++ {
++ key = url.toString();
++ }
++ FileWindow w = (FileWindow)getFileWindow( key );
++ if ( w != null )
++ {
++ //w.maximize();
++ desk.getDesktopManager().deiconifyFrame(w);
++ desk.getDesktopManager().activateFrame(w);
++ w.show();
++ w.toFront();
++ }
++ }
++
++ public void highlighLineInScriptWindow(URL url, int lineNum ){
++ String key = url.getPath();
++ if ( url.getProtocol().startsWith("vnd.sun.star") )
++ {
++ key = url.getPath();
++ }
++ FileWindow w = (FileWindow)getFileWindow( key );
++ if (w != null)
++ {
++ if ( lineNum > -1 )
++ swingInvoke(new SetFilePosition(this, w, lineNum ) );
++ }
++ }
++ public Object runScriptWindow( URL scriptUrl ) throws Exception
++ {
++ String key = scriptUrl.getPath();
++ if ( scriptUrl.getProtocol().startsWith("vnd.sun.star") )
++ {
++ key = scriptUrl.toString();
++ }
++ FileWindow w = (FileWindow)getFileWindow( key );
++ Object result = null;
++ w.toFront();
++ if (w != null)
++ {
++ //Scriptable scope = w.db.getScope();
++ Scriptable scope = w.db.officeScripts.getScriptScope( key );
++ if (scope == null)
++ {
++ MessageDialogWrapper.showMessageDialog(w.db, "Can't load scripts: no scope available", "Run", JOptionPane.ERROR_MESSAGE);
++ result = null;
++ }
++ else
++ {
++ String url = w.getUrl();
++ Thread executorThread = null;
++ if (url != null)
++ {
++ LoadFile executor = new LoadFile(w.db,scope, url, new StringReader(w.textArea.getText()), true );
++ executor.run();
++ result = executor.result;
++ if ( executor.exception != null )
++ {
++ throw executor.exception;
++ }
++ }
++ }
++ }
++ return result;
++
++ }
++
++ public boolean isModified( URL url )
++ {
++ String key = url.getPath();
++ if ( url.getProtocol().startsWith("vnd.sun.star") )
++ {
++ key = url.toString();
++ }
++ FileWindow w = (FileWindow)getFileWindow( key );
++ return w.isModified();
++ }
++
++ public String getText( URL url )
++ {
++ String key = url.toString();
++ if ( url.getProtocol().startsWith("vnd.sun.star") )
++ {
++ key = url.toString();
++ }
++ FileWindow w = (FileWindow)getFileWindow( key );
++ return w.getText();
++ }
++
+ }
+
+--- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java Thu Mar 25 21:54:34 2004
++++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java Fri Mar 28 17:24:23 2008
+@@ -36,6 +36,7 @@
+ package org.mozilla.javascript.tools.shell;
+
+ import java.security.*;
++import java.security.cert.Certificate;
+ import java.net.MalformedURLException;
+ import java.net.URL;
+ import java.util.Hashtable;
+@@ -124,7 +125,7 @@
+
+ public JavaPolicySecurity() {
+ // To trigger error on jdk-1.1 with lazy load
+- new CodeSource(null, null);
++ new CodeSource(null, (Certificate [])null);
+ }
+
+ protected void callProcessFileSecure(final Context cx,
+@@ -167,7 +168,7 @@
+ }
+
+ private ProtectionDomain getUrlDomain(URL url) {
+- CodeSource cs = new CodeSource(url, null);
++ CodeSource cs = new CodeSource(url, (Certificate [])null);
+ PermissionCollection pc = Policy.getPolicy().getPermissions(cs);
+ return new ProtectionDomain(cs, pc);
+ }
--- /dev/null
+Scanner library from [http://www.sane-project.org/]
--- /dev/null
+/* sane - Scanner Access Now Easy.
+ Copyright (C) 1997 David Mosberger-Tang and Andreas Beck
+ This file is part of the SANE package.
+
+ This file is in the public domain. You may use and modify it as
+ you see fit, as long as this copyright message is included and
+ that there is an indication as to what modifications have been
+ made (if any).
+
+ SANE is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ This file declares SANE application interface. See the SANE
+ standard for a detailed explanation of the interface. */
+#ifndef sane_h
+#define sane_h
+
+#define SANE_CURRENT_MAJOR 0
+
+#define SANE_VERSION_CODE(major, minor, build) \
+ ( (((SANE_Word) (major) & 0xff) << 24) \
+ | (((SANE_Word) (minor) & 0xff) << 16) \
+ | (((SANE_Word) (build) & 0xffff) << 0))
+
+#define SANE_VERSION_MAJOR(code) ((((SANE_Word)(code)) >> 24) & 0xff)
+#define SANE_VERSION_MINOR(code) ((((SANE_Word)(code)) >> 16) & 0xff)
+#define SANE_VERSION_BUILD(code) ((((SANE_Word)(code)) >> 0) & 0xffff)
+
+#define SANE_FALSE 0
+#define SANE_TRUE 1
+
+typedef unsigned char SANE_Byte;
+typedef int SANE_Word;
+typedef SANE_Word SANE_Bool;
+typedef SANE_Word SANE_Int;
+typedef char SANE_Char;
+typedef SANE_Char *SANE_String;
+typedef const SANE_Char *SANE_String_Const;
+typedef void *SANE_Handle;
+typedef SANE_Word SANE_Fixed;
+
+#define SANE_FIXED_SCALE_SHIFT 16
+#define SANE_FIX(v) ((SANE_Word) ((v) * (1 << SANE_FIXED_SCALE_SHIFT)))
+#define SANE_UNFIX(v) ((double)(v) / (1 << SANE_FIXED_SCALE_SHIFT))
+
+typedef enum
+ {
+ SANE_STATUS_GOOD = 0, /* everything A-OK */
+ SANE_STATUS_UNSUPPORTED, /* operation is not supported */
+ SANE_STATUS_CANCELLED, /* operation was cancelled */
+ SANE_STATUS_DEVICE_BUSY, /* device is busy; try again later */
+ SANE_STATUS_INVAL, /* data is invalid (includes no dev at open) */
+ SANE_STATUS_EOF, /* no more data available (end-of-file) */
+ SANE_STATUS_JAMMED, /* document feeder jammed */
+ SANE_STATUS_NO_DOCS, /* document feeder out of documents */
+ SANE_STATUS_COVER_OPEN, /* scanner cover is open */
+ SANE_STATUS_IO_ERROR, /* error during device I/O */
+ SANE_STATUS_NO_MEM, /* out of memory */
+ SANE_STATUS_ACCESS_DENIED /* access to resource has been denied */
+ }
+SANE_Status;
+
+typedef enum
+ {
+ SANE_TYPE_BOOL = 0,
+ SANE_TYPE_INT,
+ SANE_TYPE_FIXED,
+ SANE_TYPE_STRING,
+ SANE_TYPE_BUTTON,
+ SANE_TYPE_GROUP
+ }
+SANE_Value_Type;
+
+typedef enum
+ {
+ SANE_UNIT_NONE = 0, /* the value is unit-less (e.g., # of scans) */
+ SANE_UNIT_PIXEL, /* value is number of pixels */
+ SANE_UNIT_BIT, /* value is number of bits */
+ SANE_UNIT_MM, /* value is millimeters */
+ SANE_UNIT_DPI, /* value is resolution in dots/inch */
+ SANE_UNIT_PERCENT, /* value is a percentage */
+ SANE_UNIT_MICROSECOND /* value is micro seconds */
+ }
+SANE_Unit;
+
+typedef struct
+ {
+ SANE_String_Const name; /* unique device name */
+ SANE_String_Const vendor; /* device vendor string */
+ SANE_String_Const model; /* device model name */
+ SANE_String_Const type; /* device type (e.g., "flatbed scanner") */
+ }
+SANE_Device;
+
+#define SANE_CAP_SOFT_SELECT (1 << 0)
+#define SANE_CAP_HARD_SELECT (1 << 1)
+#define SANE_CAP_SOFT_DETECT (1 << 2)
+#define SANE_CAP_EMULATED (1 << 3)
+#define SANE_CAP_AUTOMATIC (1 << 4)
+#define SANE_CAP_INACTIVE (1 << 5)
+#define SANE_CAP_ADVANCED (1 << 6)
+#define SANE_CAP_ALWAYS_SETTABLE (1 << 7)
+
+#define SANE_OPTION_IS_ACTIVE(cap) (((cap) & SANE_CAP_INACTIVE) == 0)
+#define SANE_OPTION_IS_SETTABLE(cap) (((cap) & SANE_CAP_SOFT_SELECT) != 0)
+
+#define SANE_INFO_INEXACT (1 << 0)
+#define SANE_INFO_RELOAD_OPTIONS (1 << 1)
+#define SANE_INFO_RELOAD_PARAMS (1 << 2)
+
+typedef enum
+ {
+ SANE_CONSTRAINT_NONE = 0,
+ SANE_CONSTRAINT_RANGE,
+ SANE_CONSTRAINT_WORD_LIST,
+ SANE_CONSTRAINT_STRING_LIST
+ }
+SANE_Constraint_Type;
+
+typedef struct
+ {
+ SANE_Word min; /* minimum (element) value */
+ SANE_Word max; /* maximum (element) value */
+ SANE_Word quant; /* quantization value (0 if none) */
+ }
+SANE_Range;
+
+typedef struct
+ {
+ SANE_String_Const name; /* name of this option (command-line name) */
+ SANE_String_Const title; /* title of this option (single-line) */
+ SANE_String_Const desc; /* description of this option (multi-line) */
+ SANE_Value_Type type; /* how are values interpreted? */
+ SANE_Unit unit; /* what is the (physical) unit? */
+ SANE_Int size;
+ SANE_Int cap; /* capabilities */
+
+ SANE_Constraint_Type constraint_type;
+ union
+ {
+ const SANE_String_Const *string_list; /* NULL-terminated list */
+ const SANE_Word *word_list; /* first element is list-length */
+ const SANE_Range *range;
+ }
+ constraint;
+ }
+SANE_Option_Descriptor;
+
+typedef enum
+ {
+ SANE_ACTION_GET_VALUE = 0,
+ SANE_ACTION_SET_VALUE,
+ SANE_ACTION_SET_AUTO
+ }
+SANE_Action;
+
+typedef enum
+ {
+ SANE_FRAME_GRAY, /* band covering human visual range */
+ SANE_FRAME_RGB, /* pixel-interleaved red/green/blue bands */
+ SANE_FRAME_RED, /* red band only */
+ SANE_FRAME_GREEN, /* green band only */
+ SANE_FRAME_BLUE /* blue band only */
+ }
+SANE_Frame;
+
+typedef struct
+ {
+ SANE_Frame format;
+ SANE_Bool last_frame;
+ SANE_Int bytes_per_line;
+ SANE_Int pixels_per_line;
+ SANE_Int lines;
+ SANE_Int depth;
+ }
+SANE_Parameters;
+
+struct SANE_Auth_Data;
+
+#define SANE_MAX_USERNAME_LEN 256
+#define SANE_MAX_PASSWORD_LEN 256
+
+typedef void (*SANE_Auth_Callback) (SANE_String_Const resource,
+ SANE_Char username[SANE_MAX_USERNAME_LEN],
+ SANE_Char password[SANE_MAX_PASSWORD_LEN]);
+
+extern SANE_Status sane_init (SANE_Int * version_code,
+ SANE_Auth_Callback authorize);
+extern void sane_exit (void);
+extern SANE_Status sane_get_devices (const SANE_Device *** device_list,
+ SANE_Bool local_only);
+extern SANE_Status sane_open (SANE_String_Const devicename,
+ SANE_Handle * handle);
+extern void sane_close (SANE_Handle handle);
+extern const SANE_Option_Descriptor *
+ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option);
+extern SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option,
+ SANE_Action action, void *value,
+ SANE_Int * info);
+extern SANE_Status sane_get_parameters (SANE_Handle handle,
+ SANE_Parameters * params);
+extern SANE_Status sane_start (SANE_Handle handle);
+extern SANE_Status sane_read (SANE_Handle handle, SANE_Byte * data,
+ SANE_Int max_length, SANE_Int * length);
+extern void sane_cancel (SANE_Handle handle);
+extern SANE_Status sane_set_io_mode (SANE_Handle handle,
+ SANE_Bool non_blocking);
+extern SANE_Status sane_get_select_fd (SANE_Handle handle,
+ SANE_Int * fd);
+extern SANE_String_Const sane_strstatus (SANE_Status status);
+
+#endif /* sane_h */
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,serf))
+
+$(eval $(call gb_ExternalProject_use_externals,serf,\
+ apr \
+))
+
+$(eval $(call gb_ExternalProject_register_targets,serf,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_nmake,serf,build))
+
+ifeq ($(COM),MSC)
+$(call gb_ExternalProject_get_state_target,serf,build):
+ $(call gb_ExternalProject_run,build,\
+ APR_SRC="..\apr" \
+ APRUTIL_SRC="..\apr_util" \
+ OPENSSL_SRC="..\openssl" \
+ ZLIB_SRC="..\zlib" \
+ nmake -nologo -f serf.mak \
+ $(if $(MSVC_USE_DEBUG_RUNTIME),DEBUG_BUILD=T Debug,Release)/serf-1.lib \
+ )
+
+else
+# serf is using SERF_LIBS variable, so pass it empty
+$(call gb_ExternalProject_get_state_target,serf,build):
+ +$(call gb_ExternalProject_run,build,\
+ ./configure SERF_LIBS= \
+ --enable-option-checking=fatal \
+ $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
+ $(if $(SYSTEM_APR),,--with-apr=$(call gb_UnpackedTarball_get_dir,apr)/apr-1-config) \
+ $(if $(SYSTEM_APR),,--with-apr-util=$(call gb_UnpackedTarball_get_dir,apr_util)/apu-1-config) \
+ $(if $(SYSTEM_OPENSSL),,--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl)) \
+ && $(MAKE) libserf-1.la \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,serf))
+
+$(eval $(call gb_Module_add_targets,serf,\
+ UnpackedTarball_serf \
+ ExternalProject_serf \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+The serf library is a high performance C-based HTTP client library
+built upon the Apache Portable Runtime (APR) library.
+
+From [http://code.google.com/p/serf/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,serf))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,serf,$(SERF_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,serf,\
+ serf.mak \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,serf,\
+ external/serf/windows.build.patch.1 \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+diff -ur serf.org/serf.mak serf/serf.mak
+--- serf.org/serf.mak 2014-03-05 16:31:26.681695709 +0100
++++ serf/serf.mak 2014-03-05 16:32:20.969696348 +0100
+@@ -93,7 +93,7 @@
+ WIN32_DEFS = /D WIN32 /D WIN32_LEAN_AND_MEAN /D NOUSER /D NOGDI /D NONLS /D NOCRYPT /D SERF_HAVE_SSPI
+
+ CPP=cl.exe
+-CPP_PROJ = /c /nologo $(CFLAGS) $(WIN32_DEFS) $(APR_FLAGS) $(APRUTIL_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"
++CPP_PROJ = /c /nologo /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC $(CFLAGS) $(WIN32_DEFS) $(APR_FLAGS) $(APRUTIL_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"
+ LIB32=link.exe
+ LIB32_FLAGS=/nologo
+
+@@ -127,16 +127,6 @@
+ "$(INTDIR)\socket_buckets.obj" \
+ "$(INTDIR)\ssl_buckets.obj" \
+
+-!IFDEF OPENSSL_STATIC
+-LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32\libeay32.lib" \
+- "$(OPENSSL_SRC)\out32\ssleay32.lib"
+-!ELSE
+-LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32dll\libeay32.lib" \
+- "$(OPENSSL_SRC)\out32dll\ssleay32.lib"
+-!ENDIF
+-
+-LIB32_OBJS = $(LIB32_OBJS) $(APR_LIBS) $(APRUTIL_LIBS) $(ZLIB_LIBS)
+-
+ SYS_LIBS = secur32.lib
+
+ TEST_OBJS = \
--- /dev/null
+17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip.dfsg
\ No newline at end of file
--- /dev/null
+7681383be6ce489d84c1c74f4e7f9643-liborcus-0.7.0.tar.bz2.dfsg
\ No newline at end of file
--- /dev/null
+db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip.dfsg
\ No newline at end of file
--- /dev/null
+Sa 1. Jun 17:15:40 CEST 2013
--- /dev/null
+zlib-1.2.8.tar.gz.dfsg
\ No newline at end of file
--- /dev/null
+Windows scanner support.
--- /dev/null
+/* This comment added at LibrOffice:
+
+ This file is covered by the "TWAIN License", at the time of this
+ writing in http://www.twain.org/devfiles/readme.txt, which says:
+
+ The TWAIN Working Group grants customer ("Customer") the worldwide,
+ royalty-free, non-exclusive license to reproduce and distribute the
+ software and documentation of the TWAIN toolkit ("TWAIN
+ Toolkit"). The TWAIN Toolkit was designed to be used by third
+ parties to assist them in becoming compliant with the TWAIN
+ standard, but it has not been developed to the standards of a
+ commercial product. Consequently, the TWAIN toolkit is provided AS
+ IS without any warranty. THE TWAIN Working Group disclaims all
+ warranties in the TWAIN toolkit whether implied, express or
+ statutory, including, without limitation, the implied warranties of
+ merchantability, noninfringement of third party rights and fitness
+ for a particular purpose. The TWAIN Working Group disclaims all
+ liability for damages, whether direct, indirect, special,
+ incidental, or consequential, arising from the reproduction,
+ distribution, modification, or other use of the TWAIN Toolkit.
+
+ As a condition of this license, Customer agrees to include in
+ software programs based in whole or in part on the TWAIN Toolkit
+ the following provisions in (i) the header or similar file in such
+ software and (ii) prominently in its documentation and to require
+ its sublicensees to include these provisions in similar locations:
+ The TWAIN Toolkit is distributed as is. The developer and
+ distributors of the TWAIN Toolkit expressly disclaim all implied,
+ express or statutory warranties including, without limitation, the
+ implied warranties of merchantability, noninfringement of third
+ party rights and fitness for a particular purpose. Neither the
+ developers nor the distributors will be liable for damages, whether
+ direct, indirect, special, incidental, or consequential, as a
+ result of the reproduction, modification, distribution or other use
+ of the TWAIN Toolkit.
+*/
+
+/* ======================================================================== *\
+
+ Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated,
+ AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products
+ of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and
+ Xerox Corporation. All rights reserved.
+
+ Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak,
+ Hewlett-Packard and Logitech Corporations. All rights reserved.
+
+ Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix,
+ Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and
+ Ricoh Corporation. All rights reserved.
+
+ Copyright (C) 1998 TWAIN Working Group: Adobe Systems Incorporated,
+ Canon Information Systems, Eastman Kodak Company,
+ Fujitsu Computer Products of America, Genoa Technology,
+ Hewlett-Packard Company, Intel Corporation, Kofax Image Products,
+ JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation.
+ All rights reserved.
+
+ Copyright (C) 2000 TWAIN Working Group: Adobe Systems Incorporated,
+ Canon Information Systems, Digimarc Corporation, Eastman Kodak Company,
+ Fujitsu Computer Products of America, Hewlett-Packard Company,
+ JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation.
+ All rights reserved.
+
+
+ TWAIN.h - This is the definitive include file for applications and
+ data sources written to the TWAIN specification.
+ It defines constants, data structures, messages etc.
+ for the public interface to TWAIN.
+
+ Revision History:
+ version 1.0, March 6, 1992. TWAIN 1.0.
+ version 1.1, January 1993. Tech Notes 1.1
+ version 1.5, June 1993. Specification Update 1.5
+ Change DC to TW
+ Change filename from DC.H to TWAIN.H
+ version 1.5, July 1993. Remove spaces from country identifiers
+
+ version 1.7, July 1997 Added Capabilities and data structure for
+ document imaging and digital cameras.
+ KHL.
+ version 1.7, July 1997 Inserted Borland compatibile structure packing
+ directives provided by Mentor. JMH
+ version 1.7, Aug 1997 Expanded file tabs to spaces.
+ NOTE: future authors should be sure to have
+ their editors set to automatically expand tabs
+ to spaces (original tab setting was 4 spaces).
+ version 1.7, Sept 1997 Added job control values
+ Added return codes
+ version 1.7, Sept 1997 changed definition of pRGBRESPONSE to
+ pTW_RGBRESPONSE
+ version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values
+ TWBCOR_ types JMH
+ version 1.8 August 1998 Added new types and definitions required
+ for 1.8 Specification JMH
+ version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as
+ in 1.8 Specification, added TWBT_MAXICODE JMH
+ version 1.8 January 1999 Removed undocumented duplicate AUTO<cap> JMH
+ version 1.8 March 1999 Removed undocumented 1.8 caps:
+ CAP_FILESYSTEM
+ CAP_PAPERBINDING
+ CAP_PASSTHRU
+ CAP_POWERDOWNTIME
+ ICAP_AUTODISCARDBLANKPAGES
+ * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED,
+ requires spec change. JMH
+ Added Mac structure packing modifications JMH
+ version 1.9 March 2000 Added new types and definations required
+ for 1.9 Specification MLM
+ version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values,
+ updated TWON_PROTOCOLMINOR for Release v1.9 MN
+ version 1.91 August 2007 Added new types and definitions required
+ for 1.91 Specification MLM
+ version 2.0 Sept 2007 Added new types and definitions required
+ for 2.0 Specification FHH
+ version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR,
+ TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW
+ version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW
+ version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW
+ version 2.1 Mar 2009 Added new types and definitions required
+ for 2.1 Specification JMW
+ version 2.2 Nov 2010 Added new types and definitions required
+ for 2.2 Specification MSM
+ version 2.3 Feb 2013 Added new types and definitions required
+ for 2.3 Specification MLM
+\* ======================================================================== */
+
+#ifndef TWAIN
+#define TWAIN
+
+/****************************************************************************
+ * TWAIN Version *
+ ****************************************************************************/
+#define TWON_PROTOCOLMINOR 3 /* Changed for Version 2.3 */
+#define TWON_PROTOCOLMAJOR 2
+
+/****************************************************************************
+ * Platform Dependent Definitions and Typedefs *
+ ****************************************************************************/
+
+/*
+ * Mingw32 may be detected as both GNUC or WIN32/64 so try
+ * to detect it early and override both GNU and MS.
+ */
+#if defined(__MINGW32__)
+ #define TWH_CMP_MING32
+#endif
+
+/* Microsoft C/C++ Compiler */
+#if defined(WIN32) || defined(WIN64) || defined (_WINDOWS)
+ #define TWH_CMP_MSC
+ #if defined(_WIN64) || defined(WIN64)
+ #define TWH_64BIT
+ #elif defined(WIN32) || defined(_WIN32)
+ #define TWH_32BIT
+ #endif
+
+/* GNU C/C++ Compiler */
+#elif defined(__GNUC__)
+ #define TWH_CMP_GNU
+ #if defined(__alpha__)\
+ ||defined(__ia64__)\
+ ||defined(__ppc64__)\
+ ||defined(__s390x__)\
+ ||defined(__x86_64__)
+ #define TWH_64BIT
+ #else
+ #define TWH_32BIT
+ #endif
+
+
+/* Borland C/C++ Compiler */
+#elif defined(__BORLAND__)
+ #define TWH_CMP_BORLAND
+ #define TWH_32BIT
+/* Unrecognized */
+#else
+ #error Unrecognized compiler
+#endif
+
+/* Apple Compiler (which is GNU now) */
+#if defined(__APPLE__)
+ #define TWH_CMP_XCODE
+ #ifdef __MWERKS__
+ #include <Carbon.h>
+ #else
+ #include <Carbon/Carbon.h>
+ #endif
+#endif
+
+/* Win32 and Win64 systems */
+#if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND)
+ typedef HANDLE TW_HANDLE;
+ typedef LPVOID TW_MEMREF;
+ typedef UINT_PTR TW_UINTPTR;
+
+/* MacOS/X... */
+#elif defined(TWH_CMP_XCODE)
+ #define PASCAL pascal
+ #define FAR
+ typedef Handle TW_HANDLE;
+ typedef char *TW_MEMREF;
+ typedef unsigned char BYTE;
+
+ #ifdef TWH_32BIT
+ //32 bit GNU
+ typedef unsigned long TW_UINTPTR;
+ #else
+ //64 bit GNU
+ typedef unsigned long long TW_UINTPTR;
+ #endif
+
+/* Everything else... */
+#else
+ #define PASCAL
+ #define FAR
+ typedef void* TW_HANDLE;
+ typedef void* TW_MEMREF;
+ typedef unsigned char BYTE;
+
+ #ifdef TWH_32BIT
+ //32 bit GNU
+ typedef unsigned long TW_UINTPTR;
+ #else
+ //64 bit GNU
+ typedef unsigned long long TW_UINTPTR;
+ #endif
+#endif
+
+
+/* Set the packing: this occurs before any structures are defined */
+#if defined(TWH_CMP_MING32)
+ #pragma pack (push, 2)
+#elif defined(TWH_CMP_MSC)
+ #pragma pack (push, before_twain)
+ #pragma pack (2)
+#elif defined(TWH_CMP_GNU)
+ #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ #pragma options align = power
+ #else
+ #pragma pack (push, before_twain)
+ #pragma pack (2)
+ #endif
+#elif defined(TWH_CMP_BORLAND)
+ #pragma option -a2
+#endif
+
+
+/****************************************************************************
+ * Type Definitions *
+ ****************************************************************************/
+
+/* String types. These include room for the strings and a NULL char, *
+ * or, on the Mac, a length byte followed by the string. *
+ * TW_STR255 must hold less than 256 chars so length fits in first byte. */
+#if defined(__APPLE__)/* cf: Mac version of TWAIN.h */
+ typedef unsigned char TW_STR32[34], FAR *pTW_STR32;
+ typedef unsigned char TW_STR64[66], FAR *pTW_STR64;
+ typedef unsigned char TW_STR128[130], FAR *pTW_STR128;
+ typedef unsigned char TW_STR255[256], FAR *pTW_STR255;
+#else
+ typedef char TW_STR32[34], FAR *pTW_STR32;
+ typedef char TW_STR64[66], FAR *pTW_STR64;
+ typedef char TW_STR128[130], FAR *pTW_STR128;
+ typedef char TW_STR255[256], FAR *pTW_STR255;
+#endif
+
+/* Numeric types. */
+typedef char TW_INT8, FAR *pTW_INT8;
+typedef short TW_INT16, FAR *pTW_INT16;
+#if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ typedef int TW_INT32, FAR *pTW_INT32;
+#else
+ typedef long TW_INT32, FAR *pTW_INT32;
+#endif
+typedef unsigned char TW_UINT8, FAR *pTW_UINT8;
+typedef unsigned short TW_UINT16, FAR *pTW_UINT16;
+#if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ typedef unsigned int TW_UINT32, FAR *pTW_UINT32;
+#else
+ typedef unsigned long TW_UINT32, FAR *pTW_UINT32;
+#endif
+typedef unsigned short TW_BOOL, FAR *pTW_BOOL;
+
+
+/****************************************************************************
+ * Structure Definitions *
+ ****************************************************************************/
+
+/* Fixed point structure type. */
+typedef struct {
+ TW_INT16 Whole;
+ TW_UINT16 Frac;
+} TW_FIX32, FAR *pTW_FIX32;
+
+/* Defines a frame rectangle in ICAP_UNITS coordinates. */
+typedef struct {
+ TW_FIX32 Left;
+ TW_FIX32 Top;
+ TW_FIX32 Right;
+ TW_FIX32 Bottom;
+} TW_FRAME, FAR * pTW_FRAME;
+
+/* Defines the parameters used for channel-specific transformation. */
+typedef struct {
+ TW_FIX32 StartIn;
+ TW_FIX32 BreakIn;
+ TW_FIX32 EndIn;
+ TW_FIX32 StartOut;
+ TW_FIX32 BreakOut;
+ TW_FIX32 EndOut;
+ TW_FIX32 Gamma;
+ TW_FIX32 SampleCount;
+} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION;
+
+/* Stores a Fixed point number in two parts, a whole and a fractional part. */
+typedef struct {
+ TW_DECODEFUNCTION Decode[3];
+ TW_FIX32 Mix[3][3];
+} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE;
+
+/* Container for array of values */
+typedef struct {
+ TW_UINT16 ItemType;
+ TW_UINT32 NumItems;
+ TW_UINT8 ItemList[1];
+} TW_ARRAY, FAR * pTW_ARRAY;
+
+/* Information about audio data */
+typedef struct {
+ TW_STR255 Name;
+ TW_UINT32 Reserved;
+} TW_AUDIOINFO, FAR * pTW_AUDIOINFO;
+
+/* Used to register callbacks. */
+typedef struct {
+ TW_MEMREF CallBackProc;
+ #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ TW_MEMREF RefCon;
+ #else
+ TW_UINT32 RefCon;
+ #endif
+ TW_INT16 Message;
+} TW_CALLBACK, FAR * pTW_CALLBACK;
+
+/* Used to register callbacks. */
+typedef struct {
+ TW_MEMREF CallBackProc;
+ TW_UINTPTR RefCon;
+ TW_INT16 Message;
+} TW_CALLBACK2, FAR * pTW_CALLBACK2;
+
+/* Used by application to get/set capability from/in a data source. */
+typedef struct {
+ TW_UINT16 Cap;
+ TW_UINT16 ConType;
+ TW_HANDLE hContainer;
+} TW_CAPABILITY, FAR * pTW_CAPABILITY;
+
+/* Defines a CIE XYZ space tri-stimulus value. */
+typedef struct {
+ TW_FIX32 X;
+ TW_FIX32 Y;
+ TW_FIX32 Z;
+} TW_CIEPOINT, FAR * pTW_CIEPOINT;
+
+/* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. */
+typedef struct {
+ TW_UINT16 ColorSpace;
+ TW_INT16 LowEndian;
+ TW_INT16 DeviceDependent;
+ TW_INT32 VersionNumber;
+ TW_TRANSFORMSTAGE StageABC;
+ TW_TRANSFORMSTAGE StageLMN;
+ TW_CIEPOINT WhitePoint;
+ TW_CIEPOINT BlackPoint;
+ TW_CIEPOINT WhitePaper;
+ TW_CIEPOINT BlackInk;
+ TW_FIX32 Samples[1];
+} TW_CIECOLOR, FAR * pTW_CIECOLOR;
+
+/* Allows for a data source and application to pass custom data to each other. */
+typedef struct {
+ TW_UINT32 InfoLength;
+ TW_HANDLE hData;
+}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA;
+
+/* Provides information about the Event that was raised by the Source */
+typedef struct {
+ TW_UINT32 Event;
+ TW_STR255 DeviceName;
+ TW_UINT32 BatteryMinutes;
+ TW_INT16 BatteryPercentage;
+ TW_INT32 PowerSupply;
+ TW_FIX32 XResolution;
+ TW_FIX32 YResolution;
+ TW_UINT32 FlashUsed2;
+ TW_UINT32 AutomaticCapture;
+ TW_UINT32 TimeBeforeFirstCapture;
+ TW_UINT32 TimeBetweenCaptures;
+} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT;
+
+/* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/
+typedef struct {
+ TW_UINT8 Index;
+ TW_UINT8 Channel1;
+ TW_UINT8 Channel2;
+ TW_UINT8 Channel3;
+} TW_ELEMENT8, FAR * pTW_ELEMENT8;
+
+/* Stores a group of individual values describing a capability. */
+typedef struct {
+ TW_UINT16 ItemType;
+ TW_UINT32 NumItems;
+ TW_UINT32 CurrentIndex;
+ TW_UINT32 DefaultIndex;
+ TW_UINT8 ItemList[1];
+} TW_ENUMERATION, FAR * pTW_ENUMERATION;
+
+/* Used to pass application events/messages from the application to the Source. */
+typedef struct {
+ TW_MEMREF pEvent;
+ TW_UINT16 TWMessage;
+} TW_EVENT, FAR * pTW_EVENT;
+
+/* This structure is used to pass specific information between the data source and the application. */
+typedef struct {
+ TW_UINT16 InfoID;
+ TW_UINT16 ItemType;
+ TW_UINT16 NumItems;
+ union {
+ TW_UINT16 ReturnCode;
+ TW_UINT16 CondCode; // Deprecated, do not use
+ };
+ TW_UINTPTR Item;
+}TW_INFO, FAR* pTW_INFO;
+
+typedef struct {
+ TW_UINT32 NumInfos;
+ TW_INFO Info[1];
+}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO;
+
+/* Provides information about the currently selected device */
+typedef struct {
+ TW_STR255 InputName;
+ TW_STR255 OutputName;
+ TW_MEMREF Context;
+ union {
+ int Recursive;
+ TW_BOOL Subdirectories;
+ };
+ union {
+ TW_INT32 FileType;
+ TW_UINT32 FileSystemType;
+ };
+ TW_UINT32 Size;
+ TW_STR32 CreateTimeDate;
+ TW_STR32 ModifiedTimeDate;
+ TW_UINT32 FreeSpace;
+ TW_INT32 NewImageSize;
+ TW_UINT32 NumberOfFiles;
+ TW_UINT32 NumberOfSnippets;
+ TW_UINT32 DeviceGroupMask;
+ TW_INT8 Reserved[508];
+} TW_FILESYSTEM, FAR * pTW_FILESYSTEM;
+
+/* This structure is used by the application to specify a set of mapping values to be applied to grayscale data. */
+typedef struct {
+ TW_ELEMENT8 Response[1];
+} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE;
+
+/* A general way to describe the version of software that is running. */
+typedef struct {
+ TW_UINT16 MajorNum;
+ TW_UINT16 MinorNum;
+ TW_UINT16 Language;
+ TW_UINT16 Country;
+ TW_STR32 Info;
+} TW_VERSION, FAR * pTW_VERSION;
+
+/* Provides identification information about a TWAIN entity.*/
+typedef struct {
+ #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ TW_MEMREF Id;
+ #else
+ TW_UINT32 Id;
+ #endif
+ TW_VERSION Version;
+ TW_UINT16 ProtocolMajor;
+ TW_UINT16 ProtocolMinor;
+ TW_UINT32 SupportedGroups;
+ TW_STR32 Manufacturer;
+ TW_STR32 ProductFamily;
+ TW_STR32 ProductName;
+} TW_IDENTITY, FAR * pTW_IDENTITY;
+
+/* Describes the "real" image data, that is, the complete image being transferred between the Source and application. */
+typedef struct {
+ TW_FIX32 XResolution;
+ TW_FIX32 YResolution;
+ TW_INT32 ImageWidth;
+ TW_INT32 ImageLength;
+ TW_INT16 SamplesPerPixel;
+ TW_INT16 BitsPerSample[8];
+ TW_INT16 BitsPerPixel;
+ TW_BOOL Planar;
+ TW_INT16 PixelType;
+ TW_UINT16 Compression;
+} TW_IMAGEINFO, FAR * pTW_IMAGEINFO;
+
+/* Involves information about the original size of the acquired image. */
+typedef struct {
+ TW_FRAME Frame;
+ TW_UINT32 DocumentNumber;
+ TW_UINT32 PageNumber;
+ TW_UINT32 FrameNumber;
+} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT;
+
+/* Provides information for managing memory buffers. */
+typedef struct {
+ TW_UINT32 Flags;
+ TW_UINT32 Length;
+ TW_MEMREF TheMem;
+} TW_MEMORY, FAR * pTW_MEMORY;
+
+/* Describes the form of the acquired data being passed from the Source to the application.*/
+typedef struct {
+ TW_UINT16 Compression;
+ TW_UINT32 BytesPerRow;
+ TW_UINT32 Columns;
+ TW_UINT32 Rows;
+ TW_UINT32 XOffset;
+ TW_UINT32 YOffset;
+ TW_UINT32 BytesWritten;
+ TW_MEMORY Memory;
+} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER;
+
+/* Describes the information necessary to transfer a JPEG-compressed image. */
+typedef struct {
+ TW_UINT16 ColorSpace;
+ TW_UINT32 SubSampling;
+ TW_UINT16 NumComponents;
+ TW_UINT16 RestartFrequency;
+ TW_UINT16 QuantMap[4];
+ TW_MEMORY QuantTable[4];
+ TW_UINT16 HuffmanMap[4];
+ TW_MEMORY HuffmanDC[2];
+ TW_MEMORY HuffmanAC[2];
+} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION;
+
+/* Stores a single value (item) which describes a capability. */
+typedef struct {
+ TW_UINT16 ItemType;
+ TW_UINT32 Item;
+} TW_ONEVALUE, FAR * pTW_ONEVALUE;
+
+/* This structure holds the color palette information. */
+typedef struct {
+ TW_UINT16 NumColors;
+ TW_UINT16 PaletteType;
+ TW_ELEMENT8 Colors[256];
+} TW_PALETTE8, FAR * pTW_PALETTE8;
+
+/* Used to bypass the TWAIN protocol when communicating with a device */
+typedef struct {
+ TW_MEMREF pCommand;
+ TW_UINT32 CommandBytes;
+ TW_INT32 Direction;
+ TW_MEMREF pData;
+ TW_UINT32 DataBytes;
+ TW_UINT32 DataBytesXfered;
+} TW_PASSTHRU, FAR * pTW_PASSTHRU;
+
+/* This structure tells the application how many more complete transfers the Source currently has available. */
+typedef struct {
+ TW_UINT16 Count;
+ union {
+ TW_UINT32 EOJ;
+ TW_UINT32 Reserved;
+ #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ union {
+ TW_UINT32 EOJ;
+ TW_UINT32 Reserved;
+ } TW_JOBCONTROL;
+ #endif
+ };
+} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS;
+
+/* Stores a range of individual values describing a capability. */
+typedef struct {
+ TW_UINT16 ItemType;
+ TW_UINT32 MinValue;
+ TW_UINT32 MaxValue;
+ TW_UINT32 StepSize;
+ TW_UINT32 DefaultValue;
+ TW_UINT32 CurrentValue;
+} TW_RANGE, FAR * pTW_RANGE;
+
+/* This structure is used by the application to specify a set of mapping values to be applied to RGB color data. */
+typedef struct {
+ TW_ELEMENT8 Response[1];
+} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE;
+
+/* Describes the file format and file specification information for a transfer through a disk file. */
+typedef struct {
+ TW_STR255 FileName;
+ TW_UINT16 Format;
+ TW_INT16 VRefNum;
+} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER;
+
+/* Provides the application information about the Source's requirements and preferences regarding allocation of transfer buffer(s). */
+typedef struct {
+ TW_UINT32 MinBufSize;
+ TW_UINT32 MaxBufSize;
+ TW_UINT32 Preferred;
+} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER;
+
+/* Describes the status of a source. */
+typedef struct {
+ TW_UINT16 ConditionCode;
+ union {
+ TW_UINT16 Data;
+ TW_UINT16 Reserved;
+ };
+} TW_STATUS, FAR * pTW_STATUS;
+
+/* Translates the contents of Status into a localized UTF8string. */
+typedef struct {
+ TW_STATUS Status;
+ TW_UINT32 Size;
+ TW_HANDLE UTF8string;
+} TW_STATUSUTF8, FAR * pTW_STATUSUTF8;
+
+/* This structure is used to handle the user interface coordination between an application and a Source. */
+typedef struct {
+ TW_BOOL ShowUI;
+ TW_BOOL ModalUI;
+ TW_HANDLE hParent;
+} TW_USERINTERFACE, FAR * pTW_USERINTERFACE;
+
+
+/****************************************************************************
+ * Generic Constants *
+ ****************************************************************************/
+
+#define TWON_ARRAY 3
+#define TWON_ENUMERATION 4
+#define TWON_ONEVALUE 5
+#define TWON_RANGE 6
+
+#define TWON_ICONID 962
+#define TWON_DSMID 461
+#define TWON_DSMCODEID 63
+
+#define TWON_DONTCARE8 0xff
+#define TWON_DONTCARE16 0xffff
+#define TWON_DONTCARE32 0xffffffff
+
+/* Flags used in TW_MEMORY structure. */
+#define TWMF_APPOWNS 0x0001
+#define TWMF_DSMOWNS 0x0002
+#define TWMF_DSOWNS 0x0004
+#define TWMF_POINTER 0x0008
+#define TWMF_HANDLE 0x0010
+
+#define TWTY_INT8 0x0000
+#define TWTY_INT16 0x0001
+#define TWTY_INT32 0x0002
+
+#define TWTY_UINT8 0x0003
+#define TWTY_UINT16 0x0004
+#define TWTY_UINT32 0x0005
+
+#define TWTY_BOOL 0x0006
+
+#define TWTY_FIX32 0x0007
+
+#define TWTY_FRAME 0x0008
+
+#define TWTY_STR32 0x0009
+#define TWTY_STR64 0x000a
+#define TWTY_STR128 0x000b
+#define TWTY_STR255 0x000c
+#define TWTY_HANDLE 0x000f
+
+
+/****************************************************************************
+ * Capability Constants *
+ ****************************************************************************/
+
+/* CAP_ALARMS values */
+#define TWAL_ALARM 0
+#define TWAL_FEEDERERROR 1
+#define TWAL_FEEDERWARNING 2
+#define TWAL_BARCODE 3
+#define TWAL_DOUBLEFEED 4
+#define TWAL_JAM 5
+#define TWAL_PATCHCODE 6
+#define TWAL_POWER 7
+#define TWAL_SKEW 8
+
+/* ICAP_AUTOSIZE values */
+#define TWAS_NONE 0
+#define TWAS_AUTO 1
+#define TWAS_CURRENT 2
+
+/* TWEI_BARCODEROTATION values */
+#define TWBCOR_ROT0 0
+#define TWBCOR_ROT90 1
+#define TWBCOR_ROT180 2
+#define TWBCOR_ROT270 3
+#define TWBCOR_ROTX 4
+
+/* ICAP_BARCODESEARCHMODE values */
+#define TWBD_HORZ 0
+#define TWBD_VERT 1
+#define TWBD_HORZVERT 2
+#define TWBD_VERTHORZ 3
+
+/* ICAP_BITORDER values */
+#define TWBO_LSBFIRST 0
+#define TWBO_MSBFIRST 1
+
+/* ICAP_AUTODISCARDBLANKPAGES values */
+#define TWBP_DISABLE -2
+#define TWBP_AUTO -1
+
+/* ICAP_BITDEPTHREDUCTION values */
+#define TWBR_THRESHOLD 0
+#define TWBR_HALFTONE 1
+#define TWBR_CUSTHALFTONE 2
+#define TWBR_DIFFUSION 3
+#define TWBR_DYNAMICTHRESHOLD 4
+
+/* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values*/
+#define TWBT_3OF9 0
+#define TWBT_2OF5INTERLEAVED 1
+#define TWBT_2OF5NONINTERLEAVED 2
+#define TWBT_CODE93 3
+#define TWBT_CODE128 4
+#define TWBT_UCC128 5
+#define TWBT_CODABAR 6
+#define TWBT_UPCA 7
+#define TWBT_UPCE 8
+#define TWBT_EAN8 9
+#define TWBT_EAN13 10
+#define TWBT_POSTNET 11
+#define TWBT_PDF417 12
+#define TWBT_2OF5INDUSTRIAL 13
+#define TWBT_2OF5MATRIX 14
+#define TWBT_2OF5DATALOGIC 15
+#define TWBT_2OF5IATA 16
+#define TWBT_3OF9FULLASCII 17
+#define TWBT_CODABARWITHSTARTSTOP 18
+#define TWBT_MAXICODE 19
+#define TWBT_QRCODE 20
+
+/* ICAP_COMPRESSION values*/
+#define TWCP_NONE 0
+#define TWCP_PACKBITS 1
+#define TWCP_GROUP31D 2
+#define TWCP_GROUP31DEOL 3
+#define TWCP_GROUP32D 4
+#define TWCP_GROUP4 5
+#define TWCP_JPEG 6
+#define TWCP_LZW 7
+#define TWCP_JBIG 8
+#define TWCP_PNG 9
+#define TWCP_RLE4 10
+#define TWCP_RLE8 11
+#define TWCP_BITFIELDS 12
+#define TWCP_ZIP 13
+#define TWCP_JPEG2000 14
+
+/* CAP_CAMERASIDE and TWEI_PAGESIDE values */
+#define TWCS_BOTH 0
+#define TWCS_TOP 1
+#define TWCS_BOTTOM 2
+
+/* CAP_CLEARBUFFERS values */
+#define TWCB_AUTO 0
+#define TWCB_CLEAR 1
+#define TWCB_NOCLEAR 2
+
+/* CAP_DEVICEEVENT values */
+#define TWDE_CUSTOMEVENTS 0x8000
+#define TWDE_CHECKAUTOMATICCAPTURE 0
+#define TWDE_CHECKBATTERY 1
+#define TWDE_CHECKDEVICEONLINE 2
+#define TWDE_CHECKFLASH 3
+#define TWDE_CHECKPOWERSUPPLY 4
+#define TWDE_CHECKRESOLUTION 5
+#define TWDE_DEVICEADDED 6
+#define TWDE_DEVICEOFFLINE 7
+#define TWDE_DEVICEREADY 8
+#define TWDE_DEVICEREMOVED 9
+#define TWDE_IMAGECAPTURED 10
+#define TWDE_IMAGEDELETED 11
+#define TWDE_PAPERDOUBLEFEED 12
+#define TWDE_PAPERJAM 13
+#define TWDE_LAMPFAILURE 14
+#define TWDE_POWERSAVE 15
+#define TWDE_POWERSAVENOTIFY 16
+
+/* TW_PASSTHRU.Direction values. */
+#define TWDR_GET 1
+#define TWDR_SET 2
+
+/* TWEI_DESKEWSTATUS values. */
+#define TWDSK_SUCCESS 0
+#define TWDSK_REPORTONLY 1
+#define TWDSK_FAIL 2
+#define TWDSK_DISABLED 3
+
+/* CAP_DUPLEX values */
+#define TWDX_NONE 0
+#define TWDX_1PASSDUPLEX 1
+#define TWDX_2PASSDUPLEX 2
+
+/* CAP_FEEDERALIGNMENT values */
+#define TWFA_NONE 0
+#define TWFA_LEFT 1
+#define TWFA_CENTER 2
+#define TWFA_RIGHT 3
+
+/* ICAP_FEEDERTYPE values*/
+#define TWFE_GENERAL 0
+#define TWFE_PHOTO 1
+
+/* ICAP_IMAGEFILEFORMAT values */
+#define TWFF_TIFF 0
+#define TWFF_PICT 1
+#define TWFF_BMP 2
+#define TWFF_XBM 3
+#define TWFF_JFIF 4
+#define TWFF_FPX 5
+#define TWFF_TIFFMULTI 6
+#define TWFF_PNG 7
+#define TWFF_SPIFF 8
+#define TWFF_EXIF 9
+#define TWFF_PDF 10
+#define TWFF_JP2 11
+#define TWFF_JPX 13
+#define TWFF_DEJAVU 14
+#define TWFF_PDFA 15
+#define TWFF_PDFA2 16
+
+/* ICAP_FLASHUSED2 values */
+#define TWFL_NONE 0
+#define TWFL_OFF 1
+#define TWFL_ON 2
+#define TWFL_AUTO 3
+#define TWFL_REDEYE 4
+
+/* CAP_FEEDERORDER values */
+#define TWFO_FIRSTPAGEFIRST 0
+#define TWFO_LASTPAGEFIRST 1
+
+/* CAP_FEEDERPOCKET values*/
+#define TWFP_POCKETERROR 0
+#define TWFP_POCKET1 1
+#define TWFP_POCKET2 2
+#define TWFP_POCKET3 3
+#define TWFP_POCKET4 4
+#define TWFP_POCKET5 5
+#define TWFP_POCKET6 6
+#define TWFP_POCKET7 7
+#define TWFP_POCKET8 8
+#define TWFP_POCKET9 9
+#define TWFP_POCKET10 10
+#define TWFP_POCKET11 11
+#define TWFP_POCKET12 12
+#define TWFP_POCKET13 13
+#define TWFP_POCKET14 14
+#define TWFP_POCKET15 15
+#define TWFP_POCKET16 16
+
+/* ICAP_FLIPROTATION values */
+#define TWFR_BOOK 0
+#define TWFR_FANFOLD 1
+
+/* ICAP_FILTER values */
+#define TWFT_RED 0
+#define TWFT_GREEN 1
+#define TWFT_BLUE 2
+#define TWFT_NONE 3
+#define TWFT_WHITE 4
+#define TWFT_CYAN 5
+#define TWFT_MAGENTA 6
+#define TWFT_YELLOW 7
+#define TWFT_BLACK 8
+
+/* TW_FILESYSTEM.FileType values */
+#define TWFY_CAMERA 0
+#define TWFY_CAMERATOP 1
+#define TWFY_CAMERABOTTOM 2
+#define TWFY_CAMERAPREVIEW 3
+#define TWFY_DOMAIN 4
+#define TWFY_HOST 5
+#define TWFY_DIRECTORY 6
+#define TWFY_IMAGE 7
+#define TWFY_UNKNOWN 8
+
+/* ICAP_ICCPROFILE values */
+#define TWIC_NONE 0
+#define TWIC_LINK 1
+#define TWIC_EMBED 2
+
+/* ICAP_IMAGEFILTER values */
+#define TWIF_NONE 0
+#define TWIF_AUTO 1
+#define TWIF_LOWPASS 2
+#define TWIF_BANDPASS 3
+#define TWIF_HIGHPASS 4
+#define TWIF_TEXT TWIF_BANDPASS
+#define TWIF_FINELINE TWIF_HIGHPASS
+
+/* ICAP_IMAGEMERGE values */
+#define TWIM_NONE 0
+#define TWIM_FRONTONTOP 1
+#define TWIM_FRONTONBOTTOM 2
+#define TWIM_FRONTONLEFT 3
+#define TWIM_FRONTONRIGHT 4
+
+/* CAP_JOBCONTROL values */
+#define TWJC_NONE 0
+#define TWJC_JSIC 1
+#define TWJC_JSIS 2
+#define TWJC_JSXC 3
+#define TWJC_JSXS 4
+
+/* ICAP_JPEGQUALITY values */
+#define TWJQ_UNKNOWN -4
+#define TWJQ_LOW -3
+#define TWJQ_MEDIUM -2
+#define TWJQ_HIGH -1
+
+/* ICAP_LIGHTPATH values */
+#define TWLP_REFLECTIVE 0
+#define TWLP_TRANSMISSIVE 1
+
+/* ICAP_LIGHTSOURCE values */
+#define TWLS_RED 0
+#define TWLS_GREEN 1
+#define TWLS_BLUE 2
+#define TWLS_NONE 3
+#define TWLS_WHITE 4
+#define TWLS_UV 5
+#define TWLS_IR 6
+
+/* TWEI_MAGTYPE values */
+#define TWMD_MICR 0
+#define TWMD_RAW 1
+#define TWMD_INVALID 2
+
+/* ICAP_NOISEFILTER values */
+#define TWNF_NONE 0
+#define TWNF_AUTO 1
+#define TWNF_LONEPIXEL 2
+#define TWNF_MAJORITYRULE 3
+
+/* ICAP_ORIENTATION values */
+#define TWOR_ROT0 0
+#define TWOR_ROT90 1
+#define TWOR_ROT180 2
+#define TWOR_ROT270 3
+#define TWOR_PORTRAIT TWOR_ROT0
+#define TWOR_LANDSCAPE TWOR_ROT270
+#define TWOR_AUTO 4
+#define TWOR_AUTOTEXT 5
+#define TWOR_AUTOPICTURE 6
+
+/* ICAP_OVERSCAN values */
+#define TWOV_NONE 0
+#define TWOV_AUTO 1
+#define TWOV_TOPBOTTOM 2
+#define TWOV_LEFTRIGHT 3
+#define TWOV_ALL 4
+
+/* Palette types for TW_PALETTE8 */
+#define TWPA_RGB 0
+#define TWPA_GRAY 1
+#define TWPA_CMY 2
+
+/* ICAP_PLANARCHUNKY values */
+#define TWPC_CHUNKY 0
+#define TWPC_PLANAR 1
+
+/* TWEI_PATCHCODE values*/
+#define TWPCH_PATCH1 0
+#define TWPCH_PATCH2 1
+#define TWPCH_PATCH3 2
+#define TWPCH_PATCH4 3
+#define TWPCH_PATCH6 4
+#define TWPCH_PATCHT 5
+
+/* ICAP_PIXELFLAVOR values */
+#define TWPF_CHOCOLATE 0
+#define TWPF_VANILLA 1
+
+/* CAP_PRINTERMODE values */
+#define TWPM_SINGLESTRING 0
+#define TWPM_MULTISTRING 1
+#define TWPM_COMPOUNDSTRING 2
+
+/* CAP_PRINTER values */
+#define TWPR_IMPRINTERTOPBEFORE 0
+#define TWPR_IMPRINTERTOPAFTER 1
+#define TWPR_IMPRINTERBOTTOMBEFORE 2
+#define TWPR_IMPRINTERBOTTOMAFTER 3
+#define TWPR_ENDORSERTOPBEFORE 4
+#define TWPR_ENDORSERTOPAFTER 5
+#define TWPR_ENDORSERBOTTOMBEFORE 6
+#define TWPR_ENDORSERBOTTOMAFTER 7
+
+/* CAP_PRINTERFONTSTYLE Added 2.3 */
+#define TWPF_NORMAL 0
+#define TWPF_BOLD 1
+#define TWPF_ITALIC 2
+#define TWPF_LARGESIZE 3
+#define TWPF_SMALLSIZE 4
+
+/* CAP_PRINTERINDEXTRIGGER Added 2.3 */
+#define TWCT_PAGE 0
+#define TWCT_PATCH1 1
+#define TWCT_PATCH2 2
+#define TWCT_PATCH3 3
+#define TWCT_PATCH4 4
+#define TWCT_PATCHT 5
+#define TWCT_PATCH6 6
+
+/* CAP_POWERSUPPLY values */
+#define TWPS_EXTERNAL 0
+#define TWPS_BATTERY 1
+
+/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
+#define TWPT_BW 0
+#define TWPT_GRAY 1
+#define TWPT_RGB 2
+#define TWPT_PALETTE 3
+#define TWPT_CMY 4
+#define TWPT_CMYK 5
+#define TWPT_YUV 6
+#define TWPT_YUVK 7
+#define TWPT_CIEXYZ 8
+#define TWPT_LAB 9
+#define TWPT_SRGB 10
+#define TWPT_SCRGB 11
+#define TWPT_INFRARED 16
+
+/* CAP_SEGMENTED values */
+#define TWSG_NONE 0
+#define TWSG_AUTO 1
+#define TWSG_MANUAL 2
+
+/* ICAP_FILMTYPE values */
+#define TWFM_POSITIVE 0
+#define TWFM_NEGATIVE 1
+
+/* CAP_DOUBLEFEEDDETECTION */
+#define TWDF_ULTRASONIC 0
+#define TWDF_BYLENGTH 1
+#define TWDF_INFRARED 2
+
+/* CAP_DOUBLEFEEDDETECTIONSENSITIVITY */
+#define TWUS_LOW 0
+#define TWUS_MEDIUM 1
+#define TWUS_HIGH 2
+
+/* CAP_DOUBLEFEEDDETECTIONRESPONSE */
+#define TWDP_STOP 0
+#define TWDP_STOPANDWAIT 1
+#define TWDP_SOUND 2
+#define TWDP_DONOTIMPRINT 3
+
+/* ICAP_MIRROR values */
+#define TWMR_NONE 0
+#define TWMR_VERTICAL 1
+#define TWMR_HORIZONTAL 2
+
+/* ICAP_JPEGSUBSAMPLING values */
+#define TWJS_444YCBCR 0
+#define TWJS_444RGB 1
+#define TWJS_422 2
+#define TWJS_421 3
+#define TWJS_411 4
+#define TWJS_420 5
+#define TWJS_410 6
+#define TWJS_311 7
+
+/* CAP_PAPERHANDLING values */
+#define TWPH_NORMAL 0
+#define TWPH_FRAGILE 1
+#define TWPH_THICK 2
+#define TWPH_TRIFOLD 3
+#define TWPH_PHOTOGRAPH 4
+
+/* CAP_INDICATORSMODE values */
+#define TWCI_INFO 0
+#define TWCI_WARNING 1
+#define TWCI_ERROR 2
+#define TWCI_WARMUP 3
+
+/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */
+#define TWSS_NONE 0
+#define TWSS_A4 1
+#define TWSS_JISB5 2
+#define TWSS_USLETTER 3
+#define TWSS_USLEGAL 4
+#define TWSS_A5 5
+#define TWSS_ISOB4 6
+#define TWSS_ISOB6 7
+#define TWSS_USLEDGER 9
+#define TWSS_USEXECUTIVE 10
+#define TWSS_A3 11
+#define TWSS_ISOB3 12
+#define TWSS_A6 13
+#define TWSS_C4 14
+#define TWSS_C5 15
+#define TWSS_C6 16
+#define TWSS_4A0 17
+#define TWSS_2A0 18
+#define TWSS_A0 19
+#define TWSS_A1 20
+#define TWSS_A2 21
+#define TWSS_A7 22
+#define TWSS_A8 23
+#define TWSS_A9 24
+#define TWSS_A10 25
+#define TWSS_ISOB0 26
+#define TWSS_ISOB1 27
+#define TWSS_ISOB2 28
+#define TWSS_ISOB5 29
+#define TWSS_ISOB7 30
+#define TWSS_ISOB8 31
+#define TWSS_ISOB9 32
+#define TWSS_ISOB10 33
+#define TWSS_JISB0 34
+#define TWSS_JISB1 35
+#define TWSS_JISB2 36
+#define TWSS_JISB3 37
+#define TWSS_JISB4 38
+#define TWSS_JISB6 39
+#define TWSS_JISB7 40
+#define TWSS_JISB8 41
+#define TWSS_JISB9 42
+#define TWSS_JISB10 43
+#define TWSS_C0 44
+#define TWSS_C1 45
+#define TWSS_C2 46
+#define TWSS_C3 47
+#define TWSS_C7 48
+#define TWSS_C8 49
+#define TWSS_C9 50
+#define TWSS_C10 51
+#define TWSS_USSTATEMENT 52
+#define TWSS_BUSINESSCARD 53
+#define TWSS_MAXSIZE 54
+
+/* ICAP_XFERMECH values (SX_ means Setup XFer) */
+#define TWSX_NATIVE 0
+#define TWSX_FILE 1
+#define TWSX_MEMORY 2
+#define TWSX_MEMFILE 4
+
+/* ICAP_UNITS values (UN_ means UNits) */
+#define TWUN_INCHES 0
+#define TWUN_CENTIMETERS 1
+#define TWUN_PICAS 2
+#define TWUN_POINTS 3
+#define TWUN_TWIPS 4
+#define TWUN_PIXELS 5
+#define TWUN_MILLIMETERS 6
+
+
+/****************************************************************************
+ * Country Constants *
+ ****************************************************************************/
+
+#define TWCY_AFGHANISTAN 1001
+#define TWCY_ALGERIA 213
+#define TWCY_AMERICANSAMOA 684
+#define TWCY_ANDORRA 033
+#define TWCY_ANGOLA 1002
+#define TWCY_ANGUILLA 8090
+#define TWCY_ANTIGUA 8091
+#define TWCY_ARGENTINA 54
+#define TWCY_ARUBA 297
+#define TWCY_ASCENSIONI 247
+#define TWCY_AUSTRALIA 61
+#define TWCY_AUSTRIA 43
+#define TWCY_BAHAMAS 8092
+#define TWCY_BAHRAIN 973
+#define TWCY_BANGLADESH 880
+#define TWCY_BARBADOS 8093
+#define TWCY_BELGIUM 32
+#define TWCY_BELIZE 501
+#define TWCY_BENIN 229
+#define TWCY_BERMUDA 8094
+#define TWCY_BHUTAN 1003
+#define TWCY_BOLIVIA 591
+#define TWCY_BOTSWANA 267
+#define TWCY_BRITAIN 6
+#define TWCY_BRITVIRGINIS 8095
+#define TWCY_BRAZIL 55
+#define TWCY_BRUNEI 673
+#define TWCY_BULGARIA 359
+#define TWCY_BURKINAFASO 1004
+#define TWCY_BURMA 1005
+#define TWCY_BURUNDI 1006
+#define TWCY_CAMAROON 237
+#define TWCY_CANADA 2
+#define TWCY_CAPEVERDEIS 238
+#define TWCY_CAYMANIS 8096
+#define TWCY_CENTRALAFREP 1007
+#define TWCY_CHAD 1008
+#define TWCY_CHILE 56
+#define TWCY_CHINA 86
+#define TWCY_CHRISTMASIS 1009
+#define TWCY_COCOSIS 1009
+#define TWCY_COLOMBIA 57
+#define TWCY_COMOROS 1010
+#define TWCY_CONGO 1011
+#define TWCY_COOKIS 1012
+#define TWCY_COSTARICA 506
+#define TWCY_CUBA 005
+#define TWCY_CYPRUS 357
+#define TWCY_CZECHOSLOVAKIA 42
+#define TWCY_DENMARK 45
+#define TWCY_DJIBOUTI 1013
+#define TWCY_DOMINICA 8097
+#define TWCY_DOMINCANREP 8098
+#define TWCY_EASTERIS 1014
+#define TWCY_ECUADOR 593
+#define TWCY_EGYPT 20
+#define TWCY_ELSALVADOR 503
+#define TWCY_EQGUINEA 1015
+#define TWCY_ETHIOPIA 251
+#define TWCY_FALKLANDIS 1016
+#define TWCY_FAEROEIS 298
+#define TWCY_FIJIISLANDS 679
+#define TWCY_FINLAND 358
+#define TWCY_FRANCE 33
+#define TWCY_FRANTILLES 596
+#define TWCY_FRGUIANA 594
+#define TWCY_FRPOLYNEISA 689
+#define TWCY_FUTANAIS 1043
+#define TWCY_GABON 241
+#define TWCY_GAMBIA 220
+#define TWCY_GERMANY 49
+#define TWCY_GHANA 233
+#define TWCY_GIBRALTER 350
+#define TWCY_GREECE 30
+#define TWCY_GREENLAND 299
+#define TWCY_GRENADA 8099
+#define TWCY_GRENEDINES 8015
+#define TWCY_GUADELOUPE 590
+#define TWCY_GUAM 671
+#define TWCY_GUANTANAMOBAY 5399
+#define TWCY_GUATEMALA 502
+#define TWCY_GUINEA 224
+#define TWCY_GUINEABISSAU 1017
+#define TWCY_GUYANA 592
+#define TWCY_HAITI 509
+#define TWCY_HONDURAS 504
+#define TWCY_HONGKONG 852
+#define TWCY_HUNGARY 36
+#define TWCY_ICELAND 354
+#define TWCY_INDIA 91
+#define TWCY_INDONESIA 62
+#define TWCY_IRAN 98
+#define TWCY_IRAQ 964
+#define TWCY_IRELAND 353
+#define TWCY_ISRAEL 972
+#define TWCY_ITALY 39
+#define TWCY_IVORYCOAST 225
+#define TWCY_JAMAICA 8010
+#define TWCY_JAPAN 81
+#define TWCY_JORDAN 962
+#define TWCY_KENYA 254
+#define TWCY_KIRIBATI 1018
+#define TWCY_KOREA 82
+#define TWCY_KUWAIT 965
+#define TWCY_LAOS 1019
+#define TWCY_LEBANON 1020
+#define TWCY_LIBERIA 231
+#define TWCY_LIBYA 218
+#define TWCY_LIECHTENSTEIN 41
+#define TWCY_LUXENBOURG 352
+#define TWCY_MACAO 853
+#define TWCY_MADAGASCAR 1021
+#define TWCY_MALAWI 265
+#define TWCY_MALAYSIA 60
+#define TWCY_MALDIVES 960
+#define TWCY_MALI 1022
+#define TWCY_MALTA 356
+#define TWCY_MARSHALLIS 692
+#define TWCY_MAURITANIA 1023
+#define TWCY_MAURITIUS 230
+#define TWCY_MEXICO 3
+#define TWCY_MICRONESIA 691
+#define TWCY_MIQUELON 508
+#define TWCY_MONACO 33
+#define TWCY_MONGOLIA 1024
+#define TWCY_MONTSERRAT 8011
+#define TWCY_MOROCCO 212
+#define TWCY_MOZAMBIQUE 1025
+#define TWCY_NAMIBIA 264
+#define TWCY_NAURU 1026
+#define TWCY_NEPAL 977
+#define TWCY_NETHERLANDS 31
+#define TWCY_NETHANTILLES 599
+#define TWCY_NEVIS 8012
+#define TWCY_NEWCALEDONIA 687
+#define TWCY_NEWZEALAND 64
+#define TWCY_NICARAGUA 505
+#define TWCY_NIGER 227
+#define TWCY_NIGERIA 234
+#define TWCY_NIUE 1027
+#define TWCY_NORFOLKI 1028
+#define TWCY_NORWAY 47
+#define TWCY_OMAN 968
+#define TWCY_PAKISTAN 92
+#define TWCY_PALAU 1029
+#define TWCY_PANAMA 507
+#define TWCY_PARAGUAY 595
+#define TWCY_PERU 51
+#define TWCY_PHILLIPPINES 63
+#define TWCY_PITCAIRNIS 1030
+#define TWCY_PNEWGUINEA 675
+#define TWCY_POLAND 48
+#define TWCY_PORTUGAL 351
+#define TWCY_QATAR 974
+#define TWCY_REUNIONI 1031
+#define TWCY_ROMANIA 40
+#define TWCY_RWANDA 250
+#define TWCY_SAIPAN 670
+#define TWCY_SANMARINO 39
+#define TWCY_SAOTOME 1033
+#define TWCY_SAUDIARABIA 966
+#define TWCY_SENEGAL 221
+#define TWCY_SEYCHELLESIS 1034
+#define TWCY_SIERRALEONE 1035
+#define TWCY_SINGAPORE 65
+#define TWCY_SOLOMONIS 1036
+#define TWCY_SOMALI 1037
+#define TWCY_SOUTHAFRICA 27
+#define TWCY_SPAIN 34
+#define TWCY_SRILANKA 94
+#define TWCY_STHELENA 1032
+#define TWCY_STKITTS 8013
+#define TWCY_STLUCIA 8014
+#define TWCY_STPIERRE 508
+#define TWCY_STVINCENT 8015
+#define TWCY_SUDAN 1038
+#define TWCY_SURINAME 597
+#define TWCY_SWAZILAND 268
+#define TWCY_SWEDEN 46
+#define TWCY_SWITZERLAND 41
+#define TWCY_SYRIA 1039
+#define TWCY_TAIWAN 886
+#define TWCY_TANZANIA 255
+#define TWCY_THAILAND 66
+#define TWCY_TOBAGO 8016
+#define TWCY_TOGO 228
+#define TWCY_TONGAIS 676
+#define TWCY_TRINIDAD 8016
+#define TWCY_TUNISIA 216
+#define TWCY_TURKEY 90
+#define TWCY_TURKSCAICOS 8017
+#define TWCY_TUVALU 1040
+#define TWCY_UGANDA 256
+#define TWCY_USSR 7
+#define TWCY_UAEMIRATES 971
+#define TWCY_UNITEDKINGDOM 44
+#define TWCY_USA 1
+#define TWCY_URUGUAY 598
+#define TWCY_VANUATU 1041
+#define TWCY_VATICANCITY 39
+#define TWCY_VENEZUELA 58
+#define TWCY_WAKE 1042
+#define TWCY_WALLISIS 1043
+#define TWCY_WESTERNSAHARA 1044
+#define TWCY_WESTERNSAMOA 1045
+#define TWCY_YEMEN 1046
+#define TWCY_YUGOSLAVIA 38
+#define TWCY_ZAIRE 243
+#define TWCY_ZAMBIA 260
+#define TWCY_ZIMBABWE 263
+#define TWCY_ALBANIA 355
+#define TWCY_ARMENIA 374
+#define TWCY_AZERBAIJAN 994
+#define TWCY_BELARUS 375
+#define TWCY_BOSNIAHERZGO 387
+#define TWCY_CAMBODIA 855
+#define TWCY_CROATIA 385
+#define TWCY_CZECHREPUBLIC 420
+#define TWCY_DIEGOGARCIA 246
+#define TWCY_ERITREA 291
+#define TWCY_ESTONIA 372
+#define TWCY_GEORGIA 995
+#define TWCY_LATVIA 371
+#define TWCY_LESOTHO 266
+#define TWCY_LITHUANIA 370
+#define TWCY_MACEDONIA 389
+#define TWCY_MAYOTTEIS 269
+#define TWCY_MOLDOVA 373
+#define TWCY_MYANMAR 95
+#define TWCY_NORTHKOREA 850
+#define TWCY_PUERTORICO 787
+#define TWCY_RUSSIA 7
+#define TWCY_SERBIA 381
+#define TWCY_SLOVAKIA 421
+#define TWCY_SLOVENIA 386
+#define TWCY_SOUTHKOREA 82
+#define TWCY_UKRAINE 380
+#define TWCY_USVIRGINIS 340
+#define TWCY_VIETNAM 84
+
+/****************************************************************************
+ * Language Constants *
+ ****************************************************************************/
+#define TWLG_USERLOCALE -1
+#define TWLG_DAN 0
+#define TWLG_DUT 1
+#define TWLG_ENG 2
+#define TWLG_FCF 3
+#define TWLG_FIN 4
+#define TWLG_FRN 5
+#define TWLG_GER 6
+#define TWLG_ICE 7
+#define TWLG_ITN 8
+#define TWLG_NOR 9
+#define TWLG_POR 10
+#define TWLG_SPA 11
+#define TWLG_SWE 12
+#define TWLG_USA 13
+#define TWLG_AFRIKAANS 14
+#define TWLG_ALBANIA 15
+#define TWLG_ARABIC 16
+#define TWLG_ARABIC_ALGERIA 17
+#define TWLG_ARABIC_BAHRAIN 18
+#define TWLG_ARABIC_EGYPT 19
+#define TWLG_ARABIC_IRAQ 20
+#define TWLG_ARABIC_JORDAN 21
+#define TWLG_ARABIC_KUWAIT 22
+#define TWLG_ARABIC_LEBANON 23
+#define TWLG_ARABIC_LIBYA 24
+#define TWLG_ARABIC_MOROCCO 25
+#define TWLG_ARABIC_OMAN 26
+#define TWLG_ARABIC_QATAR 27
+#define TWLG_ARABIC_SAUDIARABIA 28
+#define TWLG_ARABIC_SYRIA 29
+#define TWLG_ARABIC_TUNISIA 30
+#define TWLG_ARABIC_UAE 31
+#define TWLG_ARABIC_YEMEN 32
+#define TWLG_BASQUE 33
+#define TWLG_BYELORUSSIAN 34
+#define TWLG_BULGARIAN 35
+#define TWLG_CATALAN 36
+#define TWLG_CHINESE 37
+#define TWLG_CHINESE_HONGKONG 38
+#define TWLG_CHINESE_PRC 39
+#define TWLG_CHINESE_SINGAPORE 40
+#define TWLG_CHINESE_SIMPLIFIED 41
+#define TWLG_CHINESE_TAIWAN 42
+#define TWLG_CHINESE_TRADITIONAL 43
+#define TWLG_CROATIA 44
+#define TWLG_CZECH 45
+#define TWLG_DANISH TWLG_DAN
+#define TWLG_DUTCH TWLG_DUT
+#define TWLG_DUTCH_BELGIAN 46
+#define TWLG_ENGLISH TWLG_ENG
+#define TWLG_ENGLISH_AUSTRALIAN 47
+#define TWLG_ENGLISH_CANADIAN 48
+#define TWLG_ENGLISH_IRELAND 49
+#define TWLG_ENGLISH_NEWZEALAND 50
+#define TWLG_ENGLISH_SOUTHAFRICA 51
+#define TWLG_ENGLISH_UK 52
+#define TWLG_ENGLISH_USA TWLG_USA
+#define TWLG_ESTONIAN 53
+#define TWLG_FAEROESE 54
+#define TWLG_FARSI 55
+#define TWLG_FINNISH TWLG_FIN
+#define TWLG_FRENCH TWLG_FRN
+#define TWLG_FRENCH_BELGIAN 56
+#define TWLG_FRENCH_CANADIAN TWLG_FCF
+#define TWLG_FRENCH_LUXEMBOURG 57
+#define TWLG_FRENCH_SWISS 58
+#define TWLG_GERMAN TWLG_GER
+#define TWLG_GERMAN_AUSTRIAN 59
+#define TWLG_GERMAN_LUXEMBOURG 60
+#define TWLG_GERMAN_LIECHTENSTEIN 61
+#define TWLG_GERMAN_SWISS 62
+#define TWLG_GREEK 63
+#define TWLG_HEBREW 64
+#define TWLG_HUNGARIAN 65
+#define TWLG_ICELANDIC TWLG_ICE
+#define TWLG_INDONESIAN 66
+#define TWLG_ITALIAN TWLG_ITN
+#define TWLG_ITALIAN_SWISS 67
+#define TWLG_JAPANESE 68
+#define TWLG_KOREAN 69
+#define TWLG_KOREAN_JOHAB 70
+#define TWLG_LATVIAN 71
+#define TWLG_LITHUANIAN 72
+#define TWLG_NORWEGIAN TWLG_NOR
+#define TWLG_NORWEGIAN_BOKMAL 73
+#define TWLG_NORWEGIAN_NYNORSK 74
+#define TWLG_POLISH 75
+#define TWLG_PORTUGUESE TWLG_POR
+#define TWLG_PORTUGUESE_BRAZIL 76
+#define TWLG_ROMANIAN 77
+#define TWLG_RUSSIAN 78
+#define TWLG_SERBIAN_LATIN 79
+#define TWLG_SLOVAK 80
+#define TWLG_SLOVENIAN 81
+#define TWLG_SPANISH TWLG_SPA
+#define TWLG_SPANISH_MEXICAN 82
+#define TWLG_SPANISH_MODERN 83
+#define TWLG_SWEDISH TWLG_SWE
+#define TWLG_THAI 84
+#define TWLG_TURKISH 85
+#define TWLG_UKRANIAN 86
+#define TWLG_ASSAMESE 87
+#define TWLG_BENGALI 88
+#define TWLG_BIHARI 89
+#define TWLG_BODO 90
+#define TWLG_DOGRI 91
+#define TWLG_GUJARATI 92
+#define TWLG_HARYANVI 93
+#define TWLG_HINDI 94
+#define TWLG_KANNADA 95
+#define TWLG_KASHMIRI 96
+#define TWLG_MALAYALAM 97
+#define TWLG_MARATHI 98
+#define TWLG_MARWARI 99
+#define TWLG_MEGHALAYAN 100
+#define TWLG_MIZO 101
+#define TWLG_NAGA 102
+#define TWLG_ORISSI 103
+#define TWLG_PUNJABI 104
+#define TWLG_PUSHTU 105
+#define TWLG_SERBIAN_CYRILLIC 106
+#define TWLG_SIKKIMI 107
+#define TWLG_SWEDISH_FINLAND 108
+#define TWLG_TAMIL 109
+#define TWLG_TELUGU 110
+#define TWLG_TRIPURI 111
+#define TWLG_URDU 112
+#define TWLG_VIETNAMESE 113
+
+
+/****************************************************************************
+ * Data Groups *
+ ****************************************************************************/
+#define DG_CONTROL 0x0001L
+#define DG_IMAGE 0x0002L
+#define DG_AUDIO 0x0004L
+
+/* More Data Functionality may be added in the future.
+ * These are for items that need to be determined before DS is opened.
+ * NOTE: Supported Functionality constants must be powers of 2 as they are
+ * used as bitflags when Application asks DSM to present a list of DSs.
+ * to support backward capability the App and DS will not use the fields
+ */
+#define DF_DSM2 0x10000000L
+#define DF_APP2 0x20000000L
+
+#define DF_DS2 0x40000000L
+
+#define DG_MASK 0xFFFFL
+
+/****************************************************************************
+ * *
+ ****************************************************************************/
+#define DAT_NULL 0x0000
+#define DAT_CUSTOMBASE 0x8000
+
+/* Data Argument Types for the DG_CONTROL Data Group. */
+#define DAT_CAPABILITY 0x0001
+#define DAT_EVENT 0x0002
+#define DAT_IDENTITY 0x0003
+#define DAT_PARENT 0x0004
+#define DAT_PENDINGXFERS 0x0005
+#define DAT_SETUPMEMXFER 0x0006
+#define DAT_SETUPFILEXFER 0x0007
+#define DAT_STATUS 0x0008
+#define DAT_USERINTERFACE 0x0009
+#define DAT_XFERGROUP 0x000a
+#define DAT_CUSTOMDSDATA 0x000c
+#define DAT_DEVICEEVENT 0x000d
+#define DAT_FILESYSTEM 0x000e
+#define DAT_PASSTHRU 0x000f
+#define DAT_CALLBACK 0x0010
+#define DAT_STATUSUTF8 0x0011
+#define DAT_CALLBACK2 0x0012
+
+/* Data Argument Types for the DG_IMAGE Data Group. */
+#define DAT_IMAGEINFO 0x0101
+#define DAT_IMAGELAYOUT 0x0102
+#define DAT_IMAGEMEMXFER 0x0103
+#define DAT_IMAGENATIVEXFER 0x0104
+#define DAT_IMAGEFILEXFER 0x0105
+#define DAT_CIECOLOR 0x0106
+#define DAT_GRAYRESPONSE 0x0107
+#define DAT_RGBRESPONSE 0x0108
+#define DAT_JPEGCOMPRESSION 0x0109
+#define DAT_PALETTE8 0x010a
+#define DAT_EXTIMAGEINFO 0x010b
+#define DAT_FILTER 0x010c
+
+/* Data Argument Types for the DG_AUDIO Data Group. */
+#define DAT_AUDIOFILEXFER 0x0201
+#define DAT_AUDIOINFO 0x0202
+#define DAT_AUDIONATIVEXFER 0x0203
+
+/* misplaced */
+#define DAT_ICCPROFILE 0x0401
+#define DAT_IMAGEMEMFILEXFER 0x0402
+#define DAT_ENTRYPOINT 0x0403
+
+
+/****************************************************************************
+ * Messages *
+ ****************************************************************************/
+
+/* All message constants are unique.
+ * Messages are grouped according to which DATs they are used with.*/
+
+#define MSG_NULL 0x0000
+#define MSG_CUSTOMBASE 0x8000
+
+/* Generic messages may be used with any of several DATs. */
+#define MSG_GET 0x0001
+#define MSG_GETCURRENT 0x0002
+#define MSG_GETDEFAULT 0x0003
+#define MSG_GETFIRST 0x0004
+#define MSG_GETNEXT 0x0005
+#define MSG_SET 0x0006
+#define MSG_RESET 0x0007
+#define MSG_QUERYSUPPORT 0x0008
+#define MSG_GETHELP 0x0009
+#define MSG_GETLABEL 0x000a
+#define MSG_GETLABELENUM 0x000b
+#define MSG_SETCONSTRAINT 0x000c
+
+/* Messages used with DAT_NULL */
+#define MSG_XFERREADY 0x0101
+#define MSG_CLOSEDSREQ 0x0102
+#define MSG_CLOSEDSOK 0x0103
+#define MSG_DEVICEEVENT 0X0104
+
+/* Messages used with a pointer to DAT_PARENT data */
+#define MSG_OPENDSM 0x0301
+#define MSG_CLOSEDSM 0x0302
+
+/* Messages used with a pointer to a DAT_IDENTITY structure */
+#define MSG_OPENDS 0x0401
+#define MSG_CLOSEDS 0x0402
+#define MSG_USERSELECT 0x0403
+
+/* Messages used with a pointer to a DAT_USERINTERFACE structure */
+#define MSG_DISABLEDS 0x0501
+#define MSG_ENABLEDS 0x0502
+#define MSG_ENABLEDSUIONLY 0x0503
+
+/* Messages used with a pointer to a DAT_EVENT structure */
+#define MSG_PROCESSEVENT 0x0601
+
+/* Messages used with a pointer to a DAT_PENDINGXFERS structure */
+#define MSG_ENDXFER 0x0701
+#define MSG_STOPFEEDER 0x0702
+
+/* Messages used with a pointer to a DAT_FILESYSTEM structure */
+#define MSG_CHANGEDIRECTORY 0x0801
+#define MSG_CREATEDIRECTORY 0x0802
+#define MSG_DELETE 0x0803
+#define MSG_FORMATMEDIA 0x0804
+#define MSG_GETCLOSE 0x0805
+#define MSG_GETFIRSTFILE 0x0806
+#define MSG_GETINFO 0x0807
+#define MSG_GETNEXTFILE 0x0808
+#define MSG_RENAME 0x0809
+#define MSG_COPY 0x080A
+#define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B
+
+/* Messages used with a pointer to a DAT_PASSTHRU structure */
+#define MSG_PASSTHRU 0x0901
+
+/* used with DAT_CALLBACK */
+#define MSG_REGISTER_CALLBACK 0x0902
+
+/* used with DAT_CAPABILITY */
+#define MSG_RESETALL 0x0A01
+
+/****************************************************************************
+ * Capabilities *
+ ****************************************************************************/
+
+#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */
+
+/* all data sources are REQUIRED to support these caps */
+#define CAP_XFERCOUNT 0x0001
+
+/* image data sources are REQUIRED to support these caps */
+#define ICAP_COMPRESSION 0x0100
+#define ICAP_PIXELTYPE 0x0101
+#define ICAP_UNITS 0x0102
+#define ICAP_XFERMECH 0x0103
+
+/* all data sources MAY support these caps */
+#define CAP_AUTHOR 0x1000
+#define CAP_CAPTION 0x1001
+#define CAP_FEEDERENABLED 0x1002
+#define CAP_FEEDERLOADED 0x1003
+#define CAP_TIMEDATE 0x1004
+#define CAP_SUPPORTEDCAPS 0x1005
+#define CAP_EXTENDEDCAPS 0x1006
+#define CAP_AUTOFEED 0x1007
+#define CAP_CLEARPAGE 0x1008
+#define CAP_FEEDPAGE 0x1009
+#define CAP_REWINDPAGE 0x100a
+#define CAP_INDICATORS 0x100b
+#define CAP_PAPERDETECTABLE 0x100d
+#define CAP_UICONTROLLABLE 0x100e
+#define CAP_DEVICEONLINE 0x100f
+#define CAP_AUTOSCAN 0x1010
+#define CAP_THUMBNAILSENABLED 0x1011
+#define CAP_DUPLEX 0x1012
+#define CAP_DUPLEXENABLED 0x1013
+#define CAP_ENABLEDSUIONLY 0x1014
+#define CAP_CUSTOMDSDATA 0x1015
+#define CAP_ENDORSER 0x1016
+#define CAP_JOBCONTROL 0x1017
+#define CAP_ALARMS 0x1018
+#define CAP_ALARMVOLUME 0x1019
+#define CAP_AUTOMATICCAPTURE 0x101a
+#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b
+#define CAP_TIMEBETWEENCAPTURES 0x101c
+#define CAP_CLEARBUFFERS 0x101d
+#define CAP_MAXBATCHBUFFERS 0x101e
+#define CAP_DEVICETIMEDATE 0x101f
+#define CAP_POWERSUPPLY 0x1020
+#define CAP_CAMERAPREVIEWUI 0x1021
+#define CAP_DEVICEEVENT 0x1022
+#define CAP_SERIALNUMBER 0x1024
+#define CAP_PRINTER 0x1026
+#define CAP_PRINTERENABLED 0x1027
+#define CAP_PRINTERINDEX 0x1028
+#define CAP_PRINTERMODE 0x1029
+#define CAP_PRINTERSTRING 0x102a
+#define CAP_PRINTERSUFFIX 0x102b
+#define CAP_LANGUAGE 0x102c
+#define CAP_FEEDERALIGNMENT 0x102d
+#define CAP_FEEDERORDER 0x102e
+#define CAP_REACQUIREALLOWED 0x1030
+#define CAP_BATTERYMINUTES 0x1032
+#define CAP_BATTERYPERCENTAGE 0x1033
+#define CAP_CAMERASIDE 0x1034
+#define CAP_SEGMENTED 0x1035
+#define CAP_CAMERAENABLED 0x1036
+#define CAP_CAMERAORDER 0x1037
+#define CAP_MICRENABLED 0x1038
+#define CAP_FEEDERPREP 0x1039
+#define CAP_FEEDERPOCKET 0x103a
+#define CAP_AUTOMATICSENSEMEDIUM 0x103b
+#define CAP_CUSTOMINTERFACEGUID 0x103c
+#define CAP_SUPPORTEDCAPSSEGMENTUNIQUE 0x103d
+#define CAP_SUPPORTEDDATS 0x103e
+#define CAP_DOUBLEFEEDDETECTION 0x103f
+#define CAP_DOUBLEFEEDDETECTIONLENGTH 0x1040
+#define CAP_DOUBLEFEEDDETECTIONSENSITIVITY 0x1041
+#define CAP_DOUBLEFEEDDETECTIONRESPONSE 0x1042
+#define CAP_PAPERHANDLING 0x1043
+#define CAP_INDICATORSMODE 0x1044
+#define CAP_PRINTERVERTICALOFFSET 0x1045
+#define CAP_POWERSAVETIME 0x1046
+#define CAP_PRINTERCHARROTATION 0x1047
+#define CAP_PRINTERFONTSTYLE 0x1048
+#define CAP_PRINTERINDEXLEADCHAR 0x1049
+#define CAP_PRINTERINDEXMAXVALUE 0x104A
+#define CAP_PRINTERINDEXNUMDIGITS 0x104B
+#define CAP_PRINTERINDEXSTEP 0x104C
+#define CAP_PRINTERINDEXTRIGGER 0x104D
+#define CAP_PRINTERSTRINGPREVIEW 0x104E
+
+
+
+/* image data sources MAY support these caps */
+#define ICAP_AUTOBRIGHT 0x1100
+#define ICAP_BRIGHTNESS 0x1101
+#define ICAP_CONTRAST 0x1103
+#define ICAP_CUSTHALFTONE 0x1104
+#define ICAP_EXPOSURETIME 0x1105
+#define ICAP_FILTER 0x1106
+#define ICAP_FLASHUSED 0x1107
+#define ICAP_GAMMA 0x1108
+#define ICAP_HALFTONES 0x1109
+#define ICAP_HIGHLIGHT 0x110a
+#define ICAP_IMAGEFILEFORMAT 0x110c
+#define ICAP_LAMPSTATE 0x110d
+#define ICAP_LIGHTSOURCE 0x110e
+#define ICAP_ORIENTATION 0x1110
+#define ICAP_PHYSICALWIDTH 0x1111
+#define ICAP_PHYSICALHEIGHT 0x1112
+#define ICAP_SHADOW 0x1113
+#define ICAP_FRAMES 0x1114
+#define ICAP_XNATIVERESOLUTION 0x1116
+#define ICAP_YNATIVERESOLUTION 0x1117
+#define ICAP_XRESOLUTION 0x1118
+#define ICAP_YRESOLUTION 0x1119
+#define ICAP_MAXFRAMES 0x111a
+#define ICAP_TILES 0x111b
+#define ICAP_BITORDER 0x111c
+#define ICAP_CCITTKFACTOR 0x111d
+#define ICAP_LIGHTPATH 0x111e
+#define ICAP_PIXELFLAVOR 0x111f
+#define ICAP_PLANARCHUNKY 0x1120
+#define ICAP_ROTATION 0x1121
+#define ICAP_SUPPORTEDSIZES 0x1122
+#define ICAP_THRESHOLD 0x1123
+#define ICAP_XSCALING 0x1124
+#define ICAP_YSCALING 0x1125
+#define ICAP_BITORDERCODES 0x1126
+#define ICAP_PIXELFLAVORCODES 0x1127
+#define ICAP_JPEGPIXELTYPE 0x1128
+#define ICAP_TIMEFILL 0x112a
+#define ICAP_BITDEPTH 0x112b
+#define ICAP_BITDEPTHREDUCTION 0x112c
+#define ICAP_UNDEFINEDIMAGESIZE 0x112d
+#define ICAP_IMAGEDATASET 0x112e
+#define ICAP_EXTIMAGEINFO 0x112f
+#define ICAP_MINIMUMHEIGHT 0x1130
+#define ICAP_MINIMUMWIDTH 0x1131
+#define ICAP_AUTODISCARDBLANKPAGES 0x1134
+#define ICAP_FLIPROTATION 0x1136
+#define ICAP_BARCODEDETECTIONENABLED 0x1137
+#define ICAP_SUPPORTEDBARCODETYPES 0x1138
+#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139
+#define ICAP_BARCODESEARCHPRIORITIES 0x113a
+#define ICAP_BARCODESEARCHMODE 0x113b
+#define ICAP_BARCODEMAXRETRIES 0x113c
+#define ICAP_BARCODETIMEOUT 0x113d
+#define ICAP_ZOOMFACTOR 0x113e
+#define ICAP_PATCHCODEDETECTIONENABLED 0x113f
+#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140
+#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141
+#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142
+#define ICAP_PATCHCODESEARCHMODE 0x1143
+#define ICAP_PATCHCODEMAXRETRIES 0x1144
+#define ICAP_PATCHCODETIMEOUT 0x1145
+#define ICAP_FLASHUSED2 0x1146
+#define ICAP_IMAGEFILTER 0x1147
+#define ICAP_NOISEFILTER 0x1148
+#define ICAP_OVERSCAN 0x1149
+#define ICAP_AUTOMATICBORDERDETECTION 0x1150
+#define ICAP_AUTOMATICDESKEW 0x1151
+#define ICAP_AUTOMATICROTATE 0x1152
+#define ICAP_JPEGQUALITY 0x1153
+#define ICAP_FEEDERTYPE 0x1154
+#define ICAP_ICCPROFILE 0x1155
+#define ICAP_AUTOSIZE 0x1156
+#define ICAP_AUTOMATICCROPUSESFRAME 0x1157
+#define ICAP_AUTOMATICLENGTHDETECTION 0x1158
+#define ICAP_AUTOMATICCOLORENABLED 0x1159
+#define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a
+#define ICAP_COLORMANAGEMENTENABLED 0x115b
+#define ICAP_IMAGEMERGE 0x115c
+#define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d
+#define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e
+#define ICAP_FILMTYPE 0x115f
+#define ICAP_MIRROR 0x1160
+#define ICAP_JPEGSUBSAMPLING 0x1161
+
+/* image data sources MAY support these audio caps */
+#define ACAP_XFERMECH 0x1202
+
+
+/***************************************************************************
+ * Extended Image Info Attributes section Added 1.7 *
+ ***************************************************************************/
+
+#define TWEI_BARCODEX 0x1200
+#define TWEI_BARCODEY 0x1201
+#define TWEI_BARCODETEXT 0x1202
+#define TWEI_BARCODETYPE 0x1203
+#define TWEI_DESHADETOP 0x1204
+#define TWEI_DESHADELEFT 0x1205
+#define TWEI_DESHADEHEIGHT 0x1206
+#define TWEI_DESHADEWIDTH 0x1207
+#define TWEI_DESHADESIZE 0x1208
+#define TWEI_SPECKLESREMOVED 0x1209
+#define TWEI_HORZLINEXCOORD 0x120A
+#define TWEI_HORZLINEYCOORD 0x120B
+#define TWEI_HORZLINELENGTH 0x120C
+#define TWEI_HORZLINETHICKNESS 0x120D
+#define TWEI_VERTLINEXCOORD 0x120E
+#define TWEI_VERTLINEYCOORD 0x120F
+#define TWEI_VERTLINELENGTH 0x1210
+#define TWEI_VERTLINETHICKNESS 0x1211
+#define TWEI_PATCHCODE 0x1212
+#define TWEI_ENDORSEDTEXT 0x1213
+#define TWEI_FORMCONFIDENCE 0x1214
+#define TWEI_FORMTEMPLATEMATCH 0x1215
+#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216
+#define TWEI_FORMHORZDOCOFFSET 0x1217
+#define TWEI_FORMVERTDOCOFFSET 0x1218
+#define TWEI_BARCODECOUNT 0x1219
+#define TWEI_BARCODECONFIDENCE 0x121A
+#define TWEI_BARCODEROTATION 0x121B
+#define TWEI_BARCODETEXTLENGTH 0x121C
+#define TWEI_DESHADECOUNT 0x121D
+#define TWEI_DESHADEBLACKCOUNTOLD 0x121E
+#define TWEI_DESHADEBLACKCOUNTNEW 0x121F
+#define TWEI_DESHADEBLACKRLMIN 0x1220
+#define TWEI_DESHADEBLACKRLMAX 0x1221
+#define TWEI_DESHADEWHITECOUNTOLD 0x1222
+#define TWEI_DESHADEWHITECOUNTNEW 0x1223
+#define TWEI_DESHADEWHITERLMIN 0x1224
+#define TWEI_DESHADEWHITERLAVE 0x1225
+#define TWEI_DESHADEWHITERLMAX 0x1226
+#define TWEI_BLACKSPECKLESREMOVED 0x1227
+#define TWEI_WHITESPECKLESREMOVED 0x1228
+#define TWEI_HORZLINECOUNT 0x1229
+#define TWEI_VERTLINECOUNT 0x122A
+#define TWEI_DESKEWSTATUS 0x122B
+#define TWEI_SKEWORIGINALANGLE 0x122C
+#define TWEI_SKEWFINALANGLE 0x122D
+#define TWEI_SKEWCONFIDENCE 0x122E
+#define TWEI_SKEWWINDOWX1 0x122F
+#define TWEI_SKEWWINDOWY1 0x1230
+#define TWEI_SKEWWINDOWX2 0x1231
+#define TWEI_SKEWWINDOWY2 0x1232
+#define TWEI_SKEWWINDOWX3 0x1233
+#define TWEI_SKEWWINDOWY3 0x1234
+#define TWEI_SKEWWINDOWX4 0x1235
+#define TWEI_SKEWWINDOWY4 0x1236
+#define TWEI_BOOKNAME 0x1238
+#define TWEI_CHAPTERNUMBER 0x1239
+#define TWEI_DOCUMENTNUMBER 0x123A
+#define TWEI_PAGENUMBER 0x123B
+#define TWEI_CAMERA 0x123C
+#define TWEI_FRAMENUMBER 0x123D
+#define TWEI_FRAME 0x123E
+#define TWEI_PIXELFLAVOR 0x123F
+#define TWEI_ICCPROFILE 0x1240
+#define TWEI_LASTSEGMENT 0x1241
+#define TWEI_SEGMENTNUMBER 0x1242
+#define TWEI_MAGDATA 0x1243
+#define TWEI_MAGTYPE 0x1244
+#define TWEI_PAGESIDE 0x1245
+#define TWEI_FILESYSTEMSOURCE 0x1246
+#define TWEI_IMAGEMERGED 0x1247
+#define TWEI_MAGDATALENGTH 0x1248
+#define TWEI_PAPERCOUNT 0x1249
+#define TWEI_PRINTERTEXT 0x124A
+
+#define TWEJ_NONE 0x0000
+#define TWEJ_MIDSEPARATOR 0x0001
+#define TWEJ_PATCH1 0x0002
+#define TWEJ_PATCH2 0x0003
+#define TWEJ_PATCH3 0x0004
+#define TWEJ_PATCH4 0x0005
+#define TWEJ_PATCH6 0x0006
+#define TWEJ_PATCHT 0x0007
+
+
+/***************************************************************************
+ * Return Codes and Condition Codes section *
+ ***************************************************************************/
+
+#define TWRC_CUSTOMBASE 0x8000
+
+#define TWRC_SUCCESS 0
+#define TWRC_FAILURE 1
+#define TWRC_CHECKSTATUS 2
+#define TWRC_CANCEL 3
+#define TWRC_DSEVENT 4
+#define TWRC_NOTDSEVENT 5
+#define TWRC_XFERDONE 6
+#define TWRC_ENDOFLIST 7
+#define TWRC_INFONOTSUPPORTED 8
+#define TWRC_DATANOTAVAILABLE 9
+#define TWRC_BUSY 10
+#define TWRC_SCANNERLOCKED 11
+
+/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */
+#define TWCC_CUSTOMBASE 0x8000
+
+#define TWCC_SUCCESS 0
+#define TWCC_BUMMER 1
+#define TWCC_LOWMEMORY 2
+#define TWCC_NODS 3
+#define TWCC_MAXCONNECTIONS 4
+#define TWCC_OPERATIONERROR 5
+#define TWCC_BADCAP 6
+#define TWCC_BADPROTOCOL 9
+#define TWCC_BADVALUE 10
+#define TWCC_SEQERROR 11
+#define TWCC_BADDEST 12
+#define TWCC_CAPUNSUPPORTED 13
+#define TWCC_CAPBADOPERATION 14
+#define TWCC_CAPSEQERROR 15
+#define TWCC_DENIED 16
+#define TWCC_FILEEXISTS 17
+#define TWCC_FILENOTFOUND 18
+#define TWCC_NOTEMPTY 19
+#define TWCC_PAPERJAM 20
+#define TWCC_PAPERDOUBLEFEED 21
+#define TWCC_FILEWRITEERROR 22
+#define TWCC_CHECKDEVICEONLINE 23
+#define TWCC_INTERLOCK 24
+#define TWCC_DAMAGEDCORNER 25
+#define TWCC_FOCUSERROR 26
+#define TWCC_DOCTOOLIGHT 27
+#define TWCC_DOCTOODARK 28
+#define TWCC_NOMEDIA 29
+
+/* bit patterns: for query the operation that are supported by the data source on a capability */
+/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */
+#define TWQC_GET 0x0001
+#define TWQC_SET 0x0002
+#define TWQC_GETDEFAULT 0x0004
+#define TWQC_GETCURRENT 0x0008
+#define TWQC_RESET 0x0010
+#define TWQC_SETCONSTRAINT 0x0020
+#define TWQC_CONSTRAINABLE 0x0040
+#define TWQC_GETHELP 0x0100
+#define TWQC_GETLABEL 0x0200
+#define TWQC_GETLABELENUM 0x0400
+
+/****************************************************************************
+ * Depreciated Items *
+ ****************************************************************************/
+#if defined(WIN32) || defined(WIN64)
+ #define TW_HUGE
+#elif !defined(TWH_CMP_GNU)
+ #define TW_HUGE huge
+#else
+ #define TW_HUGE
+#endif
+
+
+typedef BYTE TW_HUGE * HPBYTE;
+typedef void TW_HUGE * HPVOID;
+
+typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026, FAR *pTW_STR1024;
+typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512;
+
+#define TWTY_STR1024 0x000d
+#define TWTY_UNI512 0x000e
+
+#define TWFF_JPN 12
+
+#define DAT_TWUNKIDENTITY 0x000b
+#define DAT_SETUPFILEXFER2 0x0301
+
+#define CAP_SUPPORTEDCAPSEXT 0x100c
+#define CAP_FILESYSTEM //0x????
+#define CAP_PAGEMULTIPLEACQUIRE 0x1023
+#define CAP_PAPERBINDING 0x102f
+#define CAP_PASSTHRU 0x1031
+#define CAP_POWERDOWNTIME 0x1034
+#define ACAP_AUDIOFILEFORMAT 0x1201
+
+#define MSG_CHECKSTATUS 0x0201
+
+#define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */
+
+#define TWSX_FILE2 3
+
+/* CAP_FILESYSTEM values (FS_ means file system) */
+#define TWFS_FILESYSTEM 0
+#define TWFS_RECURSIVEDELETE 1
+
+/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */
+#define TWPT_SRGB64 11
+#define TWPT_BGR 12
+#define TWPT_CIELAB 13
+#define TWPT_CIELUV 14
+#define TWPT_YCBCR 15
+
+/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */
+#define TWSS_B 8
+#define TWSS_A4LETTER TWSS_A4
+#define TWSS_B3 TWSS_ISOB3
+#define TWSS_B4 TWSS_ISOB4
+#define TWSS_B6 TWSS_ISOB6
+#define TWSS_B5LETTER TWSS_JISB5
+
+
+/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */
+#define TWAF_WAV 0
+#define TWAF_AIFF 1
+#define TWAF_AU 3
+#define TWAF_SND 4
+
+
+/* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */
+typedef struct {
+ TW_MEMREF FileName;
+ TW_UINT16 FileNameType;
+ TW_UINT16 Format;
+ TW_INT16 VRefNum;
+ TW_UINT32 parID;
+} TW_SETUPFILEXFER2, FAR * pTW_SETUPFILEXFER2;
+
+/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */
+/* across thunk link. */
+typedef struct {
+ TW_IDENTITY identity;
+ TW_STR255 dsPath;
+} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY;
+
+/* Provides DS_Entry parameters over thunk link. */
+typedef struct
+{
+ TW_INT8 destFlag;
+ TW_IDENTITY dest;
+ TW_INT32 dataGroup;
+ TW_INT16 dataArgType;
+ TW_INT16 message;
+ TW_INT32 pDataSize;
+ // TW_MEMREF pData;
+} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS;
+
+/* Provides DS_Entry results over thunk link. */
+typedef struct
+{
+ TW_UINT16 returnCode;
+ TW_UINT16 conditionCode;
+ TW_INT32 pDataSize;
+ // TW_MEMREF pData;
+
+
+
+} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN;
+
+typedef struct
+{
+ TW_UINT16 Cap;
+ TW_UINT16 Properties;
+} TW_CAPEXT, FAR * pTW_CAPEXT;
+
+/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */
+typedef struct {
+ TW_STR255 FileName; /* full path target file */
+ TW_UINT16 Format; /* one of TWAF_xxxx */
+ TW_INT16 VRefNum;
+} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER;
+
+
+/****************************************************************************
+ * Entry Points *
+ ****************************************************************************/
+
+/**********************************************************************
+ * Function: DSM_Entry, the only entry point into the Data Source Manager.
+ ********************************************************************/
+#ifdef TWH_CMP_MSC
+ #define TW_CALLINGSTYLE PASCAL
+#else
+ #define TW_CALLINGSTYLE
+#endif
+
+/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+TW_UINT16 TW_CALLINGSTYLE DSM_Entry( pTW_IDENTITY pOrigin,
+ pTW_IDENTITY pDest,
+ TW_UINT32 DG,
+ TW_UINT16 DAT,
+ TW_UINT16 MSG,
+ TW_MEMREF pData);
+
+typedef TW_UINT16 (TW_CALLINGSTYLE *DSMENTRYPROC)(pTW_IDENTITY pOrigin,
+ pTW_IDENTITY pDest,
+ TW_UINT32 DG,
+ TW_UINT16 DAT,
+ TW_UINT16 MSG,
+ TW_MEMREF pData);
+#ifdef __cplusplus
+}
+#endif /* cplusplus */
+
+
+/**********************************************************************
+ * Function: DS_Entry, the entry point provided by a Data Source.
+ ********************************************************************/
+/* Don't mangle the name "DS_Entry" if we're compiling in C++! */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+TW_UINT16 TW_CALLINGSTYLE DS_Entry(pTW_IDENTITY pOrigin,
+ TW_UINT32 DG,
+ TW_UINT16 DAT,
+ TW_UINT16 MSG,
+ TW_MEMREF pData);
+
+typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin,
+ TW_UINT32 DG,
+ TW_UINT16 DAT,
+ TW_UINT16 MSG,
+ TW_MEMREF pData);
+
+TW_UINT16 TW_CALLINGSTYLE TWAIN_Callback( pTW_IDENTITY pOrigin,
+ pTW_IDENTITY pDest,
+ TW_UINT32 DG,
+ TW_UINT16 DAT,
+ TW_UINT16 MSG,
+ TW_MEMREF pData);
+typedef TW_UINT16 (TW_CALLINGSTYLE *TWAINCALLBACKPROC)(pTW_IDENTITY pOrigin,
+ pTW_IDENTITY pDest,
+ TW_UINT32 DG,
+ TW_UINT16 DAT,
+ TW_UINT16 MSG,
+ TW_MEMREF pData);
+
+TW_HANDLE TW_CALLINGSTYLE DSM_MemAllocate (TW_UINT32);
+typedef TW_HANDLE (TW_CALLINGSTYLE *DSM_MEMALLOCATE)(TW_UINT32 _size);
+
+void TW_CALLINGSTYLE DSM_MemFree (TW_HANDLE);
+typedef void (TW_CALLINGSTYLE *DSM_MEMFREE)(TW_HANDLE _handle);
+
+TW_MEMREF TW_CALLINGSTYLE DSM_MemLock (TW_HANDLE);
+typedef TW_MEMREF (TW_CALLINGSTYLE *DSM_MEMLOCK)(TW_HANDLE _handle);
+
+void TW_CALLINGSTYLE DSM_MemUnlock (TW_HANDLE);
+typedef void (TW_CALLINGSTYLE *DSM_MEMUNLOCK)(TW_HANDLE _handle);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/* DAT_ENTRYPOINT. returns essential entry points. */
+typedef struct {
+ TW_UINT32 Size;
+ DSMENTRYPROC DSM_Entry;
+ DSM_MEMALLOCATE DSM_MemAllocate;
+ DSM_MEMFREE DSM_MemFree;
+ DSM_MEMLOCK DSM_MemLock;
+ DSM_MEMUNLOCK DSM_MemUnlock;
+} TW_ENTRYPOINT, FAR * pTW_ENTRYPOINT;
+
+/* DAT_FILTER*/
+typedef struct {
+ TW_UINT32 Size;
+ TW_UINT32 HueStart;
+ TW_UINT32 HueEnd;
+ TW_UINT32 SaturationStart;
+ TW_UINT32 SaturationEnd;
+ TW_UINT32 ValueStart;
+ TW_UINT32 ValueEnd;
+ TW_UINT32 Replacement;
+} TW_FILTER_DESCRIPTOR, *pTW_FILTER_DESCRIPTOR;
+
+/* DAT_FILTER */
+typedef struct {
+ TW_UINT32 Size;
+ TW_UINT32 DescriptorCount;
+ TW_UINT32 MaxDescriptorCount;
+ TW_UINT32 Condition;
+ TW_HANDLE hDescriptors;
+} TW_FILTER, *pTW_FILTER;
+
+
+/* Restore the previous packing alignment: this occurs after all structures are defined */
+#if defined(TWH_CMP_MING32)
+ #pragma pack (pop)
+#elif defined(TWH_CMP_MSC)
+ #pragma pack (pop, before_twain)
+#elif defined(TWH_CMP_GNU)
+ #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */
+ #pragma options align = reset
+ #else
+ #pragma pack (pop, before_twain)
+ #endif
+#elif defined(TWH_CMP_BORLAND)
+ #pragma option -a.
+#endif
+
+#endif /* TWAIN */
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Executable_Executable,ucpp))
+
+$(eval $(call gb_Executable_set_warnings_not_errors,ucpp))
+
+$(eval $(call gb_Executable_use_unpacked,ucpp,ucpp))
+
+$(eval $(call gb_Executable_add_defs,ucpp,\
+ -DNO_UCPP_BUF \
+ -DUCPP_CONFIG \
+ -DSTAND_ALONE \
+))
+
+# suppress warning spam
+$(eval $(call gb_Executable_add_cflags,ucpp,\
+ -w \
+))
+
+
+$(eval $(call gb_Executable_add_generated_cobjects,ucpp,\
+ UnpackedTarball/ucpp/assert \
+ UnpackedTarball/ucpp/cpp \
+ UnpackedTarball/ucpp/eval \
+ UnpackedTarball/ucpp/hash \
+ UnpackedTarball/ucpp/lexer \
+ UnpackedTarball/ucpp/macro \
+ UnpackedTarball/ucpp/mem \
+ UnpackedTarball/ucpp/nhash \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,ucpp))
+
+# if not cross-compiling or we need ucpp for ODK
+ifneq (,$(if $(CROSS_COMPILING),,T)$(filter ODK,$(BUILD_TYPE)))
+$(eval $(call gb_Module_add_targets,ucpp,\
+ Executable_ucpp \
+ UnpackedTarball_ucpp \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,ucpp))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,ucpp,$(UCPP_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,ucpp,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,ucpp,\
+ external/ucpp/ucpp.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- cpp.c
++++ cpp.c
+@@ -2464,7 +2464,7 @@
+ warning(-1, "unknown option '%s'", argv[i]);
+ } else {
+ if (filename != 0) {
+- error(-1, "spurious filename '%s'", argv[i]);
++ error(-1, "spurious duplicate filename '%s' - vs. '%s' ", argv[i], filename);
+ return 2;
+ }
+ filename = argv[i];
--- /dev/null
+Library and API with which to access Data Sources from [http://www.unixodbc.org/]
--- /dev/null
+/**************************************************
+ * sql.h
+ *
+ * These should be consistent with the MS version.
+ *
+ **************************************************/
+#ifndef __SQL_H
+#define __SQL_H
+
+
+/****************************
+ * default to 3.51 declare something else before here and you get a whole new ball of wax
+ ***************************/
+#ifndef ODBCVER
+#define ODBCVER 0x0351
+#endif
+
+#ifndef __SQLTYPES_H
+#include "odbc/sqltypes.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/****************************
+ * some ret values
+ ***************************/
+#define SQL_NULL_DATA (-1)
+#define SQL_DATA_AT_EXEC (-2)
+#define SQL_SUCCESS 0
+#define SQL_SUCCESS_WITH_INFO 1
+#if (ODBCVER >= 0x0300)
+#define SQL_NO_DATA 100
+#endif
+#define SQL_ERROR (-1)
+#define SQL_INVALID_HANDLE (-2)
+#define SQL_STILL_EXECUTING 2
+#define SQL_NEED_DATA 99
+#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
+
+/****************************
+ * use these to indicate string termination to some function
+ ***************************/
+#define SQL_NTS (-3)
+#define SQL_NTSL (-3L)
+
+/* maximum message length */
+#define SQL_MAX_MESSAGE_LENGTH 512
+
+/* date/time length constants */
+#if (ODBCVER >= 0x0300)
+#define SQL_DATE_LEN 10
+#define SQL_TIME_LEN 8 /* add P+1 if precision is nonzero */
+#define SQL_TIMESTAMP_LEN 19 /* add P+1 if precision is nonzero */
+#endif
+
+/* handle type identifiers */
+#if (ODBCVER >= 0x0300)
+#define SQL_HANDLE_ENV 1
+#define SQL_HANDLE_DBC 2
+#define SQL_HANDLE_STMT 3
+#define SQL_HANDLE_DESC 4
+#endif
+
+/* environment attribute */
+#if (ODBCVER >= 0x0300)
+#define SQL_ATTR_OUTPUT_NTS 10001
+#endif
+
+/* connection attributes */
+#if (ODBCVER >= 0x0300)
+#define SQL_ATTR_AUTO_IPD 10001
+#define SQL_ATTR_METADATA_ID 10014
+#endif /* ODBCVER >= 0x0300 */
+
+/* statement attributes */
+#if (ODBCVER >= 0x0300)
+#define SQL_ATTR_APP_ROW_DESC 10010
+#define SQL_ATTR_APP_PARAM_DESC 10011
+#define SQL_ATTR_IMP_ROW_DESC 10012
+#define SQL_ATTR_IMP_PARAM_DESC 10013
+#define SQL_ATTR_CURSOR_SCROLLABLE (-1)
+#define SQL_ATTR_CURSOR_SENSITIVITY (-2)
+#endif
+
+/* SQL_ATTR_CURSOR_SCROLLABLE values */
+#if (ODBCVER >= 0x0300)
+#define SQL_NONSCROLLABLE 0
+#define SQL_SCROLLABLE 1
+#endif /* ODBCVER >= 0x0300 */
+
+/* identifiers of fields in the SQL descriptor */
+#if (ODBCVER >= 0x0300)
+#define SQL_DESC_COUNT 1001
+#define SQL_DESC_TYPE 1002
+#define SQL_DESC_LENGTH 1003
+#define SQL_DESC_OCTET_LENGTH_PTR 1004
+#define SQL_DESC_PRECISION 1005
+#define SQL_DESC_SCALE 1006
+#define SQL_DESC_DATETIME_INTERVAL_CODE 1007
+#define SQL_DESC_NULLABLE 1008
+#define SQL_DESC_INDICATOR_PTR 1009
+#define SQL_DESC_DATA_PTR 1010
+#define SQL_DESC_NAME 1011
+#define SQL_DESC_UNNAMED 1012
+#define SQL_DESC_OCTET_LENGTH 1013
+#define SQL_DESC_ALLOC_TYPE 1099
+#endif
+
+/* identifiers of fields in the diagnostics area */
+#if (ODBCVER >= 0x0300)
+#define SQL_DIAG_RETURNCODE 1
+#define SQL_DIAG_NUMBER 2
+#define SQL_DIAG_ROW_COUNT 3
+#define SQL_DIAG_SQLSTATE 4
+#define SQL_DIAG_NATIVE 5
+#define SQL_DIAG_MESSAGE_TEXT 6
+#define SQL_DIAG_DYNAMIC_FUNCTION 7
+#define SQL_DIAG_CLASS_ORIGIN 8
+#define SQL_DIAG_SUBCLASS_ORIGIN 9
+#define SQL_DIAG_CONNECTION_NAME 10
+#define SQL_DIAG_SERVER_NAME 11
+#define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
+#endif
+
+/* dynamic function codes */
+#if (ODBCVER >= 0x0300)
+#define SQL_DIAG_ALTER_DOMAIN 3
+#define SQL_DIAG_ALTER_TABLE 4
+#define SQL_DIAG_CALL 7
+#define SQL_DIAG_CREATE_ASSERTION 6
+#define SQL_DIAG_CREATE_CHARACTER_SET 8
+#define SQL_DIAG_CREATE_COLLATION 10
+#define SQL_DIAG_CREATE_DOMAIN 23
+#define SQL_DIAG_CREATE_INDEX (-1)
+#define SQL_DIAG_CREATE_SCHEMA 64
+#define SQL_DIAG_CREATE_TABLE 77
+#define SQL_DIAG_CREATE_TRANSLATION 79
+#define SQL_DIAG_CREATE_VIEW 84
+#define SQL_DIAG_DELETE_WHERE 19
+#define SQL_DIAG_DROP_ASSERTION 24
+#define SQL_DIAG_DROP_CHARACTER_SET 25
+#define SQL_DIAG_DROP_COLLATION 26
+#define SQL_DIAG_DROP_DOMAIN 27
+#define SQL_DIAG_DROP_INDEX (-2)
+#define SQL_DIAG_DROP_SCHEMA 31
+#define SQL_DIAG_DROP_TABLE 32
+#define SQL_DIAG_DROP_TRANSLATION 33
+#define SQL_DIAG_DROP_VIEW 36
+#define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
+#define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
+#define SQL_DIAG_GRANT 48
+#define SQL_DIAG_INSERT 50
+#define SQL_DIAG_REVOKE 59
+#define SQL_DIAG_SELECT_CURSOR 85
+#define SQL_DIAG_UNKNOWN_STATEMENT 0
+#define SQL_DIAG_UPDATE_WHERE 82
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL data type codes */
+#define SQL_UNKNOWN_TYPE 0
+#define SQL_CHAR 1
+#define SQL_NUMERIC 2
+#define SQL_DECIMAL 3
+#define SQL_INTEGER 4
+#define SQL_SMALLINT 5
+#define SQL_FLOAT 6
+#define SQL_REAL 7
+#define SQL_DOUBLE 8
+#if (ODBCVER >= 0x0300)
+#define SQL_DATETIME 9
+#endif
+#define SQL_VARCHAR 12
+
+/* One-parameter shortcuts for date/time data types */
+#if (ODBCVER >= 0x0300)
+#define SQL_TYPE_DATE 91
+#define SQL_TYPE_TIME 92
+#define SQL_TYPE_TIMESTAMP 93
+#endif
+
+/* Statement attribute values for cursor sensitivity */
+#if (ODBCVER >= 0x0300)
+#define SQL_UNSPECIFIED 0
+#define SQL_INSENSITIVE 1
+#define SQL_SENSITIVE 2
+#endif
+
+/* GetTypeInfo() request for all data types */
+#define SQL_ALL_TYPES 0
+
+/* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */
+#if (ODBCVER >= 0x0300)
+#define SQL_DEFAULT 99
+#endif
+
+/* SQLGetData() code indicating that the application row descriptor
+ * specifies the data type
+ */
+#if (ODBCVER >= 0x0300)
+#define SQL_ARD_TYPE (-99)
+#endif
+
+/* SQL date/time type subcodes */
+#if (ODBCVER >= 0x0300)
+#define SQL_CODE_DATE 1
+#define SQL_CODE_TIME 2
+#define SQL_CODE_TIMESTAMP 3
+#endif
+
+/* CLI option values */
+#if (ODBCVER >= 0x0300)
+#define SQL_FALSE 0
+#define SQL_TRUE 1
+#endif
+
+/* values of NULLABLE field in descriptor */
+#define SQL_NO_NULLS 0
+#define SQL_NULLABLE 1
+
+/* Value returned by SQLGetTypeInfo() to denote that it is
+ * not known whether or not a data type supports null values.
+ */
+#define SQL_NULLABLE_UNKNOWN 2
+
+/* Values returned by SQLGetTypeInfo() to show WHERE clause
+ * supported
+ */
+#if (ODBCVER >= 0x0300)
+#define SQL_PRED_NONE 0
+#define SQL_PRED_CHAR 1
+#define SQL_PRED_BASIC 2
+#endif
+
+/* values of UNNAMED field in descriptor */
+#if (ODBCVER >= 0x0300)
+#define SQL_NAMED 0
+#define SQL_UNNAMED 1
+#endif
+
+/* values of ALLOC_TYPE field in descriptor */
+#if (ODBCVER >= 0x0300)
+#define SQL_DESC_ALLOC_AUTO 1
+#define SQL_DESC_ALLOC_USER 2
+#endif
+
+/* FreeStmt() options */
+#define SQL_CLOSE 0
+#define SQL_DROP 1
+#define SQL_UNBIND 2
+#define SQL_RESET_PARAMS 3
+
+/* Codes used for FetchOrientation in SQLFetchScroll(),
+ and in SQLDataSources()
+*/
+#define SQL_FETCH_NEXT 1
+#define SQL_FETCH_FIRST 2
+
+/* Other codes used for FetchOrientation in SQLFetchScroll() */
+#define SQL_FETCH_LAST 3
+#define SQL_FETCH_PRIOR 4
+#define SQL_FETCH_ABSOLUTE 5
+#define SQL_FETCH_RELATIVE 6
+
+/* SQLEndTran() options */
+#define SQL_COMMIT 0
+#define SQL_ROLLBACK 1
+
+/* null handles returned by SQLAllocHandle() */
+#define SQL_NULL_HENV 0
+#define SQL_NULL_HDBC 0
+#define SQL_NULL_HSTMT 0
+#if (ODBCVER >= 0x0300)
+#define SQL_NULL_HDESC 0
+#define SQL_NULL_DESC 0
+#endif
+
+/* null handle used in place of parent handle when allocating HENV */
+#if (ODBCVER >= 0x0300)
+#define SQL_NULL_HANDLE 0L
+#endif
+
+/* Values that may appear in the result set of SQLSpecialColumns() */
+#define SQL_SCOPE_CURROW 0
+#define SQL_SCOPE_TRANSACTION 1
+#define SQL_SCOPE_SESSION 2
+
+#define SQL_PC_UNKNOWN 0
+#if (ODBCVER >= 0x0300)
+#define SQL_PC_NON_PSEUDO 1
+#endif
+#define SQL_PC_PSEUDO 2
+
+/* Reserved value for the IdentifierType argument of SQLSpecialColumns() */
+#if (ODBCVER >= 0x0300)
+#define SQL_ROW_IDENTIFIER 1
+#endif
+
+/* Reserved values for UNIQUE argument of SQLStatistics() */
+#define SQL_INDEX_UNIQUE 0
+#define SQL_INDEX_ALL 1
+
+/* Values that may appear in the result set of SQLStatistics() */
+#define SQL_INDEX_CLUSTERED 1
+#define SQL_INDEX_HASHED 2
+#define SQL_INDEX_OTHER 3
+
+/* SQLGetFunctions() values to identify ODBC APIs */
+#define SQL_API_SQLALLOCCONNECT 1
+#define SQL_API_SQLALLOCENV 2
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLALLOCHANDLE 1001
+#endif
+#define SQL_API_SQLALLOCSTMT 3
+#define SQL_API_SQLBINDCOL 4
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLBINDPARAM 1002
+#endif
+#define SQL_API_SQLCANCEL 5
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLCLOSECURSOR 1003
+#define SQL_API_SQLCOLATTRIBUTE 6
+#endif
+#define SQL_API_SQLCOLUMNS 40
+#define SQL_API_SQLCONNECT 7
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLCOPYDESC 1004
+#endif
+#define SQL_API_SQLDATASOURCES 57
+#define SQL_API_SQLDESCRIBECOL 8
+#define SQL_API_SQLDISCONNECT 9
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLENDTRAN 1005
+#endif
+#define SQL_API_SQLERROR 10
+#define SQL_API_SQLEXECDIRECT 11
+#define SQL_API_SQLEXECUTE 12
+#define SQL_API_SQLFETCH 13
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLFETCHSCROLL 1021
+#endif
+#define SQL_API_SQLFREECONNECT 14
+#define SQL_API_SQLFREEENV 15
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLFREEHANDLE 1006
+#endif
+#define SQL_API_SQLFREESTMT 16
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLGETCONNECTATTR 1007
+#endif
+#define SQL_API_SQLGETCONNECTOPTION 42
+#define SQL_API_SQLGETCURSORNAME 17
+#define SQL_API_SQLGETDATA 43
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLGETDESCFIELD 1008
+#define SQL_API_SQLGETDESCREC 1009
+#define SQL_API_SQLGETDIAGFIELD 1010
+#define SQL_API_SQLGETDIAGREC 1011
+#define SQL_API_SQLGETENVATTR 1012
+#endif
+#define SQL_API_SQLGETFUNCTIONS 44
+#define SQL_API_SQLGETINFO 45
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLGETSTMTATTR 1014
+#endif
+#define SQL_API_SQLGETSTMTOPTION 46
+#define SQL_API_SQLGETTYPEINFO 47
+#define SQL_API_SQLNUMRESULTCOLS 18
+#define SQL_API_SQLPARAMDATA 48
+#define SQL_API_SQLPREPARE 19
+#define SQL_API_SQLPUTDATA 49
+#define SQL_API_SQLROWCOUNT 20
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLSETCONNECTATTR 1016
+#endif
+#define SQL_API_SQLSETCONNECTOPTION 50
+#define SQL_API_SQLSETCURSORNAME 21
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLSETDESCFIELD 1017
+#define SQL_API_SQLSETDESCREC 1018
+#define SQL_API_SQLSETENVATTR 1019
+#endif
+#define SQL_API_SQLSETPARAM 22
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLSETSTMTATTR 1020
+#endif
+#define SQL_API_SQLSETSTMTOPTION 51
+#define SQL_API_SQLSPECIALCOLUMNS 52
+#define SQL_API_SQLSTATISTICS 53
+#define SQL_API_SQLTABLES 54
+#define SQL_API_SQLTRANSACT 23
+
+/* Information requested by SQLGetInfo() */
+#if (ODBCVER >= 0x0300)
+#define SQL_MAX_DRIVER_CONNECTIONS 0
+#define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS
+#define SQL_MAX_CONCURRENT_ACTIVITIES 1
+#define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES
+#endif
+#define SQL_DATA_SOURCE_NAME 2
+#define SQL_FETCH_DIRECTION 8
+#define SQL_SERVER_NAME 13
+#define SQL_SEARCH_PATTERN_ESCAPE 14
+#define SQL_DBMS_NAME 17
+#define SQL_DBMS_VER 18
+#define SQL_ACCESSIBLE_TABLES 19
+#define SQL_ACCESSIBLE_PROCEDURES 20
+#define SQL_CURSOR_COMMIT_BEHAVIOR 23
+#define SQL_DATA_SOURCE_READ_ONLY 25
+#define SQL_DEFAULT_TXN_ISOLATION 26
+#define SQL_IDENTIFIER_CASE 28
+#define SQL_IDENTIFIER_QUOTE_CHAR 29
+#define SQL_MAX_COLUMN_NAME_LEN 30
+#define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN
+#define SQL_MAX_CURSOR_NAME_LEN 31
+#define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN
+#define SQL_MAX_SCHEMA_NAME_LEN 32
+#define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN
+#define SQL_MAX_CATALOG_NAME_LEN 34
+#define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN
+#define SQL_MAX_TABLE_NAME_LEN 35
+#define SQL_SCROLL_CONCURRENCY 43
+#define SQL_TXN_CAPABLE 46
+#define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE
+#define SQL_USER_NAME 47
+#define SQL_TXN_ISOLATION_OPTION 72
+#define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION
+#define SQL_INTEGRITY 73
+#define SQL_GETDATA_EXTENSIONS 81
+#define SQL_NULL_COLLATION 85
+#define SQL_ALTER_TABLE 86
+#define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
+#define SQL_SPECIAL_CHARACTERS 94
+#define SQL_MAX_COLUMNS_IN_GROUP_BY 97
+#define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY
+#define SQL_MAX_COLUMNS_IN_INDEX 98
+#define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX
+#define SQL_MAX_COLUMNS_IN_ORDER_BY 99
+#define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY
+#define SQL_MAX_COLUMNS_IN_SELECT 100
+#define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT
+#define SQL_MAX_COLUMNS_IN_TABLE 101
+#define SQL_MAX_INDEX_SIZE 102
+#define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE
+#define SQL_MAX_ROW_SIZE 104
+#define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE
+#define SQL_MAX_STATEMENT_LEN 105
+#define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN
+#define SQL_MAX_TABLES_IN_SELECT 106
+#define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT
+#define SQL_MAX_USER_NAME_LEN 107
+#define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN
+#if (ODBCVER >= 0x0300)
+#define SQL_OJ_CAPABILITIES 115
+#define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES
+#endif /* ODBCVER >= 0x0300 */
+
+#if (ODBCVER >= 0x0300)
+#define SQL_XOPEN_CLI_YEAR 10000
+#define SQL_CURSOR_SENSITIVITY 10001
+#define SQL_DESCRIBE_PARAMETER 10002
+#define SQL_CATALOG_NAME 10003
+#define SQL_COLLATION_SEQ 10004
+#define SQL_MAX_IDENTIFIER_LEN 10005
+#define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_ALTER_TABLE bitmasks */
+#if (ODBCVER >= 0x0200)
+#define SQL_AT_ADD_COLUMN 0x00000001L
+#define SQL_AT_DROP_COLUMN 0x00000002L
+#endif /* ODBCVER >= 0x0200 */
+
+#if (ODBCVER >= 0x0300)
+#define SQL_AT_ADD_CONSTRAINT 0x00000008L
+
+/* The following bitmasks are ODBC extensions and defined in sqlext.h
+*#define SQL_AT_COLUMN_SINGLE 0x00000020L
+*#define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
+*#define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
+*#define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
+*#define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
+*#define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
+*#define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
+*#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
+*#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
+*#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
+*#define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
+*#define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
+*#define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
+*#define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
+*#define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
+*/
+#endif /* ODBCVER >= 0x0300 */
+
+
+/* SQL_ASYNC_MODE values */
+#if (ODBCVER >= 0x0300)
+#define SQL_AM_NONE 0
+#define SQL_AM_CONNECTION 1
+#define SQL_AM_STATEMENT 2
+#endif
+
+/* SQL_CURSOR_COMMIT_BEHAVIOR values */
+#define SQL_CB_DELETE 0
+#define SQL_CB_CLOSE 1
+#define SQL_CB_PRESERVE 2
+
+/* SQL_FETCH_DIRECTION bitmasks */
+#define SQL_FD_FETCH_NEXT 0x00000001L
+#define SQL_FD_FETCH_FIRST 0x00000002L
+#define SQL_FD_FETCH_LAST 0x00000004L
+#define SQL_FD_FETCH_PRIOR 0x00000008L
+#define SQL_FD_FETCH_ABSOLUTE 0x00000010L
+#define SQL_FD_FETCH_RELATIVE 0x00000020L
+
+/* SQL_GETDATA_EXTENSIONS bitmasks */
+#define SQL_GD_ANY_COLUMN 0x00000001L
+#define SQL_GD_ANY_ORDER 0x00000002L
+
+/* SQL_IDENTIFIER_CASE values */
+#define SQL_IC_UPPER 1
+#define SQL_IC_LOWER 2
+#define SQL_IC_SENSITIVE 3
+#define SQL_IC_MIXED 4
+
+/* SQL_OJ_CAPABILITIES bitmasks */
+/* NB: this means 'outer join', not what you may be thinking */
+
+
+#if (ODBCVER >= 0x0201)
+#define SQL_OJ_LEFT 0x00000001L
+#define SQL_OJ_RIGHT 0x00000002L
+#define SQL_OJ_FULL 0x00000004L
+#define SQL_OJ_NESTED 0x00000008L
+#define SQL_OJ_NOT_ORDERED 0x00000010L
+#define SQL_OJ_INNER 0x00000020L
+#define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L
+#endif
+
+/* SQL_SCROLL_CONCURRENCY bitmasks */
+#define SQL_SCCO_READ_ONLY 0x00000001L
+#define SQL_SCCO_LOCK 0x00000002L
+#define SQL_SCCO_OPT_ROWVER 0x00000004L
+#define SQL_SCCO_OPT_VALUES 0x00000008L
+
+/* SQL_TXN_CAPABLE values */
+#define SQL_TC_NONE 0
+#define SQL_TC_DML 1
+#define SQL_TC_ALL 2
+#define SQL_TC_DDL_COMMIT 3
+#define SQL_TC_DDL_IGNORE 4
+
+/* SQL_TXN_ISOLATION_OPTION bitmasks */
+#define SQL_TXN_READ_UNCOMMITTED 0x00000001L
+#define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED
+#define SQL_TXN_READ_COMMITTED 0x00000002L
+#define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED
+#define SQL_TXN_REPEATABLE_READ 0x00000004L
+#define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ
+#define SQL_TXN_SERIALIZABLE 0x00000008L
+#define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE
+
+/* SQL_NULL_COLLATION values */
+#define SQL_NC_HIGH 0
+#define SQL_NC_LOW 1
+
+ SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle,
+ SQLHDBC *ConnectionHandle);
+
+ SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType,
+ SQLHANDLE InputHandle, SQLHANDLE *OutputHandle);
+#endif
+
+ SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle,
+ SQLHSTMT *StatementHandle);
+
+ SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
+ SQLPOINTER TargetValue, SQLLEN BufferLength,
+ SQLLEN *StrLen_or_Ind);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
+ SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
+ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
+ SQLLEN *StrLen_or_Ind);
+#endif
+
+ SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle);
+
+ SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
+ SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
+ SQLSMALLINT *StringLength, SQLLEN *NumericAttribute
+ /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ );
+ /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */
+
+#endif
+
+
+ SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle,
+ SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
+ SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
+ SQLCHAR *TableName, SQLSMALLINT NameLength3,
+ SQLCHAR *ColumnName, SQLSMALLINT NameLength4);
+
+
+ SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle,
+ SQLCHAR *ServerName, SQLSMALLINT NameLength1,
+ SQLCHAR *UserName, SQLSMALLINT NameLength2,
+ SQLCHAR *Authentication, SQLSMALLINT NameLength3);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle,
+ SQLHDESC TargetDescHandle);
+#endif
+
+ SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle,
+ SQLUSMALLINT Direction, SQLCHAR *ServerName,
+ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
+ SQLCHAR *Description, SQLSMALLINT BufferLength2,
+ SQLSMALLINT *NameLength2);
+
+ SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
+ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
+ SQLSMALLINT *DataType, SQLULEN *ColumnSize,
+ SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable);
+
+ SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle,
+ SQLSMALLINT CompletionType);
+#endif
+
+ SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle,
+ SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
+ SQLCHAR *Sqlstate, SQLINTEGER *NativeError,
+ SQLCHAR *MessageText, SQLSMALLINT BufferLength,
+ SQLSMALLINT *TextLength);
+
+ SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle,
+ SQLCHAR *StatementText, SQLINTEGER TextLength);
+
+ SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle);
+
+ SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle,
+ SQLSMALLINT FetchOrientation, SQLLEN FetchOffset);
+#endif
+
+ SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle);
+
+ SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle);
+#endif
+
+ SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle,
+ SQLUSMALLINT Option);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER BufferLength, SQLINTEGER *StringLength);
+#endif
+
+ SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle,
+ SQLUSMALLINT Option, SQLPOINTER Value);
+
+ SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle,
+ SQLCHAR *CursorName, SQLSMALLINT BufferLength,
+ SQLSMALLINT *NameLength);
+
+ SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
+ SQLPOINTER TargetValue, SQLLEN BufferLength,
+ SQLLEN *StrLen_or_Ind);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
+ SQLPOINTER Value, SQLINTEGER BufferLength,
+ SQLINTEGER *StringLength);
+
+ SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLCHAR *Name,
+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
+ SQLSMALLINT *Type, SQLSMALLINT *SubType,
+ SQLLEN *Length, SQLSMALLINT *Precision,
+ SQLSMALLINT *Scale, SQLSMALLINT *Nullable);
+
+ SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle,
+ SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
+ SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
+ SQLSMALLINT *StringLength);
+
+ SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle,
+ SQLSMALLINT RecNumber, SQLCHAR *Sqlstate,
+ SQLINTEGER *NativeError, SQLCHAR *MessageText,
+ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength);
+
+ SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER BufferLength, SQLINTEGER *StringLength);
+#endif /* ODBCVER >= 0x0300 */
+
+ SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle,
+ SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported);
+
+ SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle,
+ SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER BufferLength, SQLINTEGER *StringLength);
+#endif /* ODBCVER >= 0x0300 */
+
+ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle,
+ SQLUSMALLINT Option, SQLPOINTER Value);
+
+ SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle,
+ SQLSMALLINT DataType);
+
+ SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle,
+ SQLSMALLINT *ColumnCount);
+
+ SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle,
+ SQLPOINTER *Value);
+
+ SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle,
+ SQLCHAR *StatementText, SQLINTEGER TextLength);
+
+ SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle,
+ SQLPOINTER Data, SQLLEN StrLen_or_Ind);
+
+ SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle,
+ SQLLEN *RowCount);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER StringLength);
+#endif /* ODBCVER >= 0x0300 */
+
+ SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle,
+ SQLUSMALLINT Option, SQLULEN Value);
+
+ SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle,
+ SQLCHAR *CursorName, SQLSMALLINT NameLength);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
+ SQLPOINTER Value, SQLINTEGER BufferLength);
+
+ SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLSMALLINT Type,
+ SQLSMALLINT SubType, SQLLEN Length,
+ SQLSMALLINT Precision, SQLSMALLINT Scale,
+ SQLPOINTER Data, SQLLEN *StringLength,
+ SQLLEN *Indicator);
+
+ SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER StringLength);
+#endif /* ODBCVER >= 0x0300 */
+
+ SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
+ SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
+ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
+ SQLLEN *StrLen_or_Ind);
+
+#if (ODBCVER >= 0x0300)
+ SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER StringLength);
+#endif
+
+ SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle,
+ SQLUSMALLINT Option, SQLULEN Value);
+
+ SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle,
+ SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
+ SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
+ SQLSMALLINT NameLength2, SQLCHAR *TableName,
+ SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
+ SQLUSMALLINT Nullable);
+
+ SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle,
+ SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
+ SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
+ SQLCHAR *TableName, SQLSMALLINT NameLength3,
+ SQLUSMALLINT Unique, SQLUSMALLINT Reserved);
+
+ SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle,
+ SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
+ SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
+ SQLCHAR *TableName, SQLSMALLINT NameLength3,
+ SQLCHAR *TableType, SQLSMALLINT NameLength4);
+
+ SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle,
+ SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/*****************************************************
+ * sqlext.h
+ *
+ * These should be consistent with the MS version.
+ *
+ *****************************************************/
+#ifndef __SQLEXT_H
+#define __SQLEXT_H
+
+
+/* BEGIN - unixODBC ONLY (programs like ODBCConfig and DataManager use these) */
+
+/* COLUMNS IN SQLTables() RESULT SET */
+#define SQLTables_TABLE_CATALOG 1
+#define SQLTables_TABLE_SCHEM 2
+#define SQLTables_TABLE_NAME 3
+#define SQLTables_TABLE_TYPE 4
+#define SQLTables_REMARKS 5
+
+/* COLUMNS IN SQLColumns() RESULT SET */
+#define SQLColumns_TABLE_CAT 1
+#define SQLColumns_TABLE_SCHEM 2
+#define SQLColumns_TABLE_NAME 3
+#define SQLColumns_COLUMN_NAME 4
+#define SQLColumns_DATA_TYPE 5
+#define SQLColumns_TYPE_NAME 6
+#define SQLColumns_COLUMN_SIZE 7
+#define SQLColumns_BUFFER_LENGTH 8
+#define SQLColumns_DECIMAL_DIGITS 9
+#define SQLColumns_NUM_PREC_RADIX 10
+#define SQLColumns_NULLABLE 11
+#define SQLColumns_REMARKS 12
+#define SQLColumns_COLUMN_DEF 13
+#define SQLColumns_SQL_DATA_TYPE 14
+#define SQLColumns_SQL_DATETIME_SUB 15
+#define SQLColumns_CHAR_OCTET_LENGTH 16
+#define SQLColumns_ORDINAL_POSITION 17
+#define SQLColumns_IS_NULLABLE 18
+
+/* END - unixODBC ONLY */
+
+#ifndef __SQL_H
+#include "odbc/sql.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif
+
+/* generally useful constants */
+#define SQL_SPEC_MAJOR 3 /* Major version of specification */
+#define SQL_SPEC_MINOR 52 /* Minor version of specification */
+#define SQL_SPEC_STRING "03.52" /* String constant for version */
+
+#define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */
+#define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */
+
+#define SQL_MAX_OPTION_STRING_LENGTH 256
+
+/* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */
+#if (ODBCVER < 0x0300)
+#define SQL_NO_DATA_FOUND 100
+#else
+#define SQL_NO_DATA_FOUND SQL_NO_DATA
+#endif
+
+/* an end handle type */
+#if (ODBCVER >= 0x0300)
+#define SQL_HANDLE_SENV 5
+#endif /* ODBCVER >= 0x0300 */
+
+/* env attribute */
+#if (ODBCVER >= 0x0300)
+#define SQL_ATTR_ODBC_VERSION 200
+#define SQL_ATTR_CONNECTION_POOLING 201
+#define SQL_ATTR_CP_MATCH 202
+
+/* unixODBC additions */
+#define SQL_ATTR_UNIXODBC_SYSPATH 65001
+#define SQL_ATTR_UNIXODBC_VERSION 65002
+#define SQL_ATTR_UNIXODBC_ENVATTR 65003
+#endif /* ODBCVER >= 0x0300 */
+
+#if (ODBCVER >= 0x0300)
+/* values for SQL_ATTR_CONNECTION_POOLING */
+#define SQL_CP_OFF 0UL
+#define SQL_CP_ONE_PER_DRIVER 1UL
+#define SQL_CP_ONE_PER_HENV 2UL
+#define SQL_CP_DEFAULT SQL_CP_OFF
+
+/* values for SQL_ATTR_CP_MATCH */
+#define SQL_CP_STRICT_MATCH 0UL
+#define SQL_CP_RELAXED_MATCH 1UL
+#define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH
+
+/* values for SQL_ATTR_ODBC_VERSION */
+#define SQL_OV_ODBC2 2UL
+#define SQL_OV_ODBC3 3UL
+#endif /* ODBCVER >= 0x0300 */
+
+/* connection attributes */
+#define SQL_ACCESS_MODE 101
+#define SQL_AUTOCOMMIT 102
+#define SQL_LOGIN_TIMEOUT 103
+#define SQL_OPT_TRACE 104
+#define SQL_OPT_TRACEFILE 105
+#define SQL_TRANSLATE_DLL 106
+#define SQL_TRANSLATE_OPTION 107
+#define SQL_TXN_ISOLATION 108
+#define SQL_CURRENT_QUALIFIER 109
+#define SQL_ODBC_CURSORS 110
+#define SQL_QUIET_MODE 111
+#define SQL_PACKET_SIZE 112
+
+/* connection attributes with new names */
+#if (ODBCVER >= 0x0300)
+#define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
+#define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
+#define SQL_ATTR_CONNECTION_TIMEOUT 113
+#define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
+#define SQL_ATTR_DISCONNECT_BEHAVIOR 114
+#define SQL_ATTR_ENLIST_IN_DTC 1207
+#define SQL_ATTR_ENLIST_IN_XA 1208
+#define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
+#define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
+#define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
+#define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
+#define SQL_ATTR_TRACE SQL_OPT_TRACE
+#define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
+#define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
+#define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
+#define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
+#endif /* ODBCVER >= 0x0300 */
+
+#define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */
+
+#define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */
+
+#if (ODBCVER >= 0x0351)
+/* ODBC Driver Manager sets this connection attribute to a unicode driver
+ (which supports SQLConnectW) when the application is an ANSI application
+ (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect).
+ This is SetConnectAttr only and application does not set this attribute
+ This attribute was introduced because some unicode driver's some APIs may
+ need to behave differently on ANSI or Unicode applications. A unicode
+ driver, which has same behavior for both ANSI or Unicode applications,
+ should return SQL_ERROR when the driver manager sets this connection
+ attribute. When a unicode driver returns SQL_SUCCESS on this attribute,
+ the driver manager treates ANSI and Unicode connections differently in
+ connection pooling.
+*/
+#define SQL_ATTR_ANSI_APP 115
+#endif
+
+/* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */
+#if (ODBCVER < 0x0300)
+#define SQL_CONNECT_OPT_DRVR_START 1000
+#endif /* ODBCVER < 0x0300 */
+
+#if (ODBCVER < 0x0300)
+#define SQL_CONN_OPT_MAX SQL_PACKET_SIZE
+#define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
+#endif /* ODBCVER < 0x0300 */
+
+/* SQL_ACCESS_MODE options */
+#define SQL_MODE_READ_WRITE 0UL
+#define SQL_MODE_READ_ONLY 1UL
+#define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE
+
+/* SQL_AUTOCOMMIT options */
+#define SQL_AUTOCOMMIT_OFF 0UL
+#define SQL_AUTOCOMMIT_ON 1UL
+#define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
+
+/* SQL_LOGIN_TIMEOUT options */
+#define SQL_LOGIN_TIMEOUT_DEFAULT 15UL
+
+/* SQL_OPT_TRACE options */
+#define SQL_OPT_TRACE_OFF 0UL
+#define SQL_OPT_TRACE_ON 1UL
+#define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
+#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG"
+
+/* SQL_ODBC_CURSORS options */
+#define SQL_CUR_USE_IF_NEEDED 0UL
+#define SQL_CUR_USE_ODBC 1UL
+#define SQL_CUR_USE_DRIVER 2UL
+#define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER
+
+#if (ODBCVER >= 0x0300)
+/* values for SQL_ATTR_DISCONNECT_BEHAVIOR */
+#define SQL_DB_RETURN_TO_POOL 0UL
+#define SQL_DB_DISCONNECT 1UL
+#define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL
+
+/* values for SQL_ATTR_ENLIST_IN_DTC */
+#define SQL_DTC_DONE 0L
+#endif /* ODBCVER >= 0x0300 */
+
+/* values for SQL_ATTR_CONNECTION_DEAD */
+#define SQL_CD_TRUE 1L /* Connection is closed/dead */
+#define SQL_CD_FALSE 0L /* Connection is open/available */
+
+/* values for SQL_ATTR_ANSI_APP */
+#if (ODBCVER >= 0x0351)
+#define SQL_AA_TRUE 1L /* the application is an ANSI app */
+#define SQL_AA_FALSE 0L /* the application is a Unicode app */
+#endif
+
+/* statement attributes */
+#define SQL_QUERY_TIMEOUT 0
+#define SQL_MAX_ROWS 1
+#define SQL_NOSCAN 2
+#define SQL_MAX_LENGTH 3
+#define SQL_ASYNC_ENABLE 4 /* same as SQL_ATTR_ASYNC_ENABLE */
+#define SQL_BIND_TYPE 5
+#define SQL_CURSOR_TYPE 6
+#define SQL_CONCURRENCY 7
+#define SQL_KEYSET_SIZE 8
+#define SQL_ROWSET_SIZE 9
+#define SQL_SIMULATE_CURSOR 10
+#define SQL_RETRIEVE_DATA 11
+#define SQL_USE_BOOKMARKS 12
+#define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */
+#define SQL_ROW_NUMBER 14 /* GetStmtOption Only */
+
+/* statement attributes for ODBC 3.0 */
+#if (ODBCVER >= 0x0300)
+#define SQL_ATTR_ASYNC_ENABLE 4
+#define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY
+#define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE
+#define SQL_ATTR_ENABLE_AUTO_IPD 15
+#define SQL_ATTR_FETCH_BOOKMARK_PTR 16
+#define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE
+#define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH
+#define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS
+#define SQL_ATTR_NOSCAN SQL_NOSCAN
+#define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17
+#define SQL_ATTR_PARAM_BIND_TYPE 18
+#define SQL_ATTR_PARAM_OPERATION_PTR 19
+#define SQL_ATTR_PARAM_STATUS_PTR 20
+#define SQL_ATTR_PARAMS_PROCESSED_PTR 21
+#define SQL_ATTR_PARAMSET_SIZE 22
+#define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT
+#define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA
+#define SQL_ATTR_ROW_BIND_OFFSET_PTR 23
+#define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE
+#define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER /*GetStmtAttr*/
+#define SQL_ATTR_ROW_OPERATION_PTR 24
+#define SQL_ATTR_ROW_STATUS_PTR 25
+#define SQL_ATTR_ROWS_FETCHED_PTR 26
+#define SQL_ATTR_ROW_ARRAY_SIZE 27
+#define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR
+#define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS
+
+#endif /* ODBCVER >= 0x0300 */
+
+#if (ODBCVER < 0x0300)
+#define SQL_STMT_OPT_MAX SQL_ROW_NUMBER
+#define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
+#endif /* ODBCVER < 0x0300 */
+
+/* New defines for SEARCHABLE column in SQLGetTypeInfo */
+
+#if (ODBCVER >= 0x0300)
+#define SQL_COL_PRED_CHAR SQL_LIKE_ONLY
+#define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE
+#endif /* ODBCVER >= 0x0300 */
+
+
+
+/* whether an attribute is a pointer or not */
+#if (ODBCVER >= 0x0300)
+#define SQL_IS_POINTER (-4)
+#define SQL_IS_UINTEGER (-5)
+#define SQL_IS_INTEGER (-6)
+#define SQL_IS_USMALLINT (-7)
+#define SQL_IS_SMALLINT (-8)
+#endif /* ODBCVER >= 0x0300 */
+
+/* the value of SQL_ATTR_PARAM_BIND_TYPE */
+#if (ODBCVER >= 0x0300)
+#define SQL_PARAM_BIND_BY_COLUMN 0UL
+#define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_QUERY_TIMEOUT options */
+#define SQL_QUERY_TIMEOUT_DEFAULT 0UL
+
+/* SQL_MAX_ROWS options */
+#define SQL_MAX_ROWS_DEFAULT 0UL
+
+/* SQL_NOSCAN options */
+#define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */
+#define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */
+#define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
+
+/* SQL_MAX_LENGTH options */
+#define SQL_MAX_LENGTH_DEFAULT 0UL
+
+/* values for SQL_ATTR_ASYNC_ENABLE */
+#define SQL_ASYNC_ENABLE_OFF 0UL
+#define SQL_ASYNC_ENABLE_ON 1UL
+#define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
+
+/* SQL_BIND_TYPE options */
+#define SQL_BIND_BY_COLUMN 0UL
+#define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN /* Default value */
+
+/* SQL_CONCURRENCY options */
+#define SQL_CONCUR_READ_ONLY 1
+#define SQL_CONCUR_LOCK 2
+#define SQL_CONCUR_ROWVER 3
+#define SQL_CONCUR_VALUES 4
+#define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY /* Default value */
+
+/* SQL_CURSOR_TYPE options */
+#define SQL_CURSOR_FORWARD_ONLY 0UL
+#define SQL_CURSOR_KEYSET_DRIVEN 1UL
+#define SQL_CURSOR_DYNAMIC 2UL
+#define SQL_CURSOR_STATIC 3UL
+#define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /* Default value */
+
+/* SQL_ROWSET_SIZE options */
+#define SQL_ROWSET_SIZE_DEFAULT 1UL
+
+/* SQL_KEYSET_SIZE options */
+#define SQL_KEYSET_SIZE_DEFAULT 0UL
+
+/* SQL_SIMULATE_CURSOR options */
+#define SQL_SC_NON_UNIQUE 0UL
+#define SQL_SC_TRY_UNIQUE 1UL
+#define SQL_SC_UNIQUE 2UL
+
+/* SQL_RETRIEVE_DATA options */
+#define SQL_RD_OFF 0UL
+#define SQL_RD_ON 1UL
+#define SQL_RD_DEFAULT SQL_RD_ON
+
+/* SQL_USE_BOOKMARKS options */
+#define SQL_UB_OFF 0UL
+#define SQL_UB_ON 01UL
+#define SQL_UB_DEFAULT SQL_UB_OFF
+
+/* New values for SQL_USE_BOOKMARKS attribute */
+#if (ODBCVER >= 0x0300)
+#define SQL_UB_FIXED SQL_UB_ON
+#define SQL_UB_VARIABLE 2UL
+#endif /* ODBCVER >= 0x0300 */
+
+/* extended descriptor field */
+#if (ODBCVER >= 0x0300)
+#define SQL_DESC_ARRAY_SIZE 20
+#define SQL_DESC_ARRAY_STATUS_PTR 21
+#define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT
+#define SQL_DESC_BASE_COLUMN_NAME 22
+#define SQL_DESC_BASE_TABLE_NAME 23
+#define SQL_DESC_BIND_OFFSET_PTR 24
+#define SQL_DESC_BIND_TYPE 25
+#define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE
+#define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME
+#define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
+#define SQL_DESC_DATETIME_INTERVAL_PRECISION 26
+#define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
+#define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY
+#define SQL_DESC_LABEL SQL_COLUMN_LABEL
+#define SQL_DESC_LITERAL_PREFIX 27
+#define SQL_DESC_LITERAL_SUFFIX 28
+#define SQL_DESC_LOCAL_TYPE_NAME 29
+#define SQL_DESC_MAXIMUM_SCALE 30
+#define SQL_DESC_MINIMUM_SCALE 31
+#define SQL_DESC_NUM_PREC_RADIX 32
+#define SQL_DESC_PARAMETER_TYPE 33
+#define SQL_DESC_ROWS_PROCESSED_PTR 34
+#if (ODBCVER >= 0x0350)
+#define SQL_DESC_ROWVER 35
+#endif /* ODBCVER >= 0x0350 */
+#define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME
+#define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE
+#define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME
+#define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME
+#define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
+#define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE
+#endif /* ODBCVER >= 0x0300 */
+
+
+/* defines for diagnostics fields */
+#if (ODBCVER >= 0x0300)
+#define SQL_DIAG_CURSOR_ROW_COUNT (-1249)
+#define SQL_DIAG_ROW_NUMBER (-1248)
+#define SQL_DIAG_COLUMN_NUMBER (-1247)
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL extended datatypes */
+#define SQL_DATE 9
+#if (ODBCVER >= 0x0300)
+#define SQL_INTERVAL 10
+#endif /* ODBCVER >= 0x0300 */
+#define SQL_TIME 10
+#define SQL_TIMESTAMP 11
+#define SQL_LONGVARCHAR (-1)
+#define SQL_BINARY (-2)
+#define SQL_VARBINARY (-3)
+#define SQL_LONGVARBINARY (-4)
+#define SQL_BIGINT (-5)
+#define SQL_TINYINT (-6)
+#define SQL_BIT (-7)
+#if (ODBCVER >= 0x0350)
+#define SQL_GUID (-11)
+#endif /* ODBCVER >= 0x0350 */
+
+#if (ODBCVER >= 0x0300)
+/* interval code */
+#define SQL_CODE_YEAR 1
+#define SQL_CODE_MONTH 2
+#define SQL_CODE_DAY 3
+#define SQL_CODE_HOUR 4
+#define SQL_CODE_MINUTE 5
+#define SQL_CODE_SECOND 6
+#define SQL_CODE_YEAR_TO_MONTH 7
+#define SQL_CODE_DAY_TO_HOUR 8
+#define SQL_CODE_DAY_TO_MINUTE 9
+#define SQL_CODE_DAY_TO_SECOND 10
+#define SQL_CODE_HOUR_TO_MINUTE 11
+#define SQL_CODE_HOUR_TO_SECOND 12
+#define SQL_CODE_MINUTE_TO_SECOND 13
+
+#define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR)
+#define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH)
+#define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY)
+#define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR)
+#define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE)
+#define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND)
+#define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH)
+#define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR)
+#define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE)
+#define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND)
+#define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE)
+#define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND)
+#define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND)
+
+#else
+#define SQL_INTERVAL_YEAR (-80)
+#define SQL_INTERVAL_MONTH (-81)
+#define SQL_INTERVAL_YEAR_TO_MONTH (-82)
+#define SQL_INTERVAL_DAY (-83)
+#define SQL_INTERVAL_HOUR (-84)
+#define SQL_INTERVAL_MINUTE (-85)
+#define SQL_INTERVAL_SECOND (-86)
+#define SQL_INTERVAL_DAY_TO_HOUR (-87)
+#define SQL_INTERVAL_DAY_TO_MINUTE (-88)
+#define SQL_INTERVAL_DAY_TO_SECOND (-89)
+#define SQL_INTERVAL_HOUR_TO_MINUTE (-90)
+#define SQL_INTERVAL_HOUR_TO_SECOND (-91)
+#define SQL_INTERVAL_MINUTE_TO_SECOND (-92)
+#endif /* ODBCVER >= 0x0300 */
+
+
+#if (ODBCVER <= 0x0300)
+#define SQL_UNICODE (-95)
+#define SQL_UNICODE_VARCHAR (-96)
+#define SQL_UNICODE_LONGVARCHAR (-97)
+#define SQL_UNICODE_CHAR SQL_UNICODE
+#else
+/* The previous definitions for SQL_UNICODE_ are historical and obsolete */
+
+#define SQL_UNICODE SQL_WCHAR
+#define SQL_UNICODE_VARCHAR SQL_WVARCHAR
+#define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR
+#define SQL_UNICODE_CHAR SQL_WCHAR
+#endif
+
+#if (ODBCVER < 0x0300)
+#define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR
+#define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR
+#endif /* ODBCVER < 0x0300 */
+
+/* C datatype to SQL datatype mapping SQL types
+ ------------------- */
+#define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */
+#define SQL_C_LONG SQL_INTEGER /* INTEGER */
+#define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */
+#define SQL_C_FLOAT SQL_REAL /* REAL */
+#define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */
+#if (ODBCVER >= 0x0300)
+#define SQL_C_NUMERIC SQL_NUMERIC
+#endif /* ODBCVER >= 0x0300 */
+#define SQL_C_DEFAULT 99
+
+#define SQL_SIGNED_OFFSET (-20)
+#define SQL_UNSIGNED_OFFSET (-22)
+
+/* C datatype to SQL datatype mapping */
+#define SQL_C_DATE SQL_DATE
+#define SQL_C_TIME SQL_TIME
+#define SQL_C_TIMESTAMP SQL_TIMESTAMP
+#if (ODBCVER >= 0x0300)
+#define SQL_C_TYPE_DATE SQL_TYPE_DATE
+#define SQL_C_TYPE_TIME SQL_TYPE_TIME
+#define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP
+#define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR
+#define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH
+#define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY
+#define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR
+#define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE
+#define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND
+#define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH
+#define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR
+#define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE
+#define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND
+#define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE
+#define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND
+#define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND
+#endif /* ODBCVER >= 0x0300 */
+#define SQL_C_BINARY SQL_BINARY
+#define SQL_C_BIT SQL_BIT
+#if (ODBCVER >= 0x0300)
+#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
+#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
+#endif /* ODBCVER >= 0x0300 */
+#define SQL_C_TINYINT SQL_TINYINT
+#define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */
+#define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */
+#define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */
+#define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/
+#define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
+#define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
+
+#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE)
+#define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */
+#else
+#define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
+#endif
+
+#if (ODBCVER >= 0x0350)
+#define SQL_C_GUID SQL_GUID
+#endif /* ODBCVER >= 0x0350 */
+
+#define SQL_TYPE_NULL 0
+#if (ODBCVER < 0x0300)
+#define SQL_TYPE_MIN SQL_BIT
+#define SQL_TYPE_MAX SQL_VARCHAR
+#endif
+
+#if (ODBCVER >= 0x0300)
+#define SQL_C_VARBOOKMARK SQL_C_BINARY
+#endif /* ODBCVER >= 0x0300 */
+
+/* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */
+#if (ODBCVER >= 0x0300)
+#define SQL_NO_ROW_NUMBER (-1)
+#define SQL_NO_COLUMN_NUMBER (-1)
+#define SQL_ROW_NUMBER_UNKNOWN (-2)
+#define SQL_COLUMN_NUMBER_UNKNOWN (-2)
+#endif
+
+/* SQLBindParameter extensions */
+#define SQL_DEFAULT_PARAM (-5)
+#define SQL_IGNORE (-6)
+#if (ODBCVER >= 0x0300)
+#define SQL_COLUMN_IGNORE SQL_IGNORE
+#endif /* ODBCVER >= 0x0300 */
+#define SQL_LEN_DATA_AT_EXEC_OFFSET (-100)
+#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
+
+/* binary length for driver specific attributes */
+#define SQL_LEN_BINARY_ATTR_OFFSET (-100)
+#define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
+
+/* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
+*/
+#define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT
+#define SQL_SETPARAM_VALUE_MAX (-1L)
+
+/* SQLColAttributes defines */
+#define SQL_COLUMN_COUNT 0
+#define SQL_COLUMN_NAME 1
+#define SQL_COLUMN_TYPE 2
+#define SQL_COLUMN_LENGTH 3
+#define SQL_COLUMN_PRECISION 4
+#define SQL_COLUMN_SCALE 5
+#define SQL_COLUMN_DISPLAY_SIZE 6
+#define SQL_COLUMN_NULLABLE 7
+#define SQL_COLUMN_UNSIGNED 8
+#define SQL_COLUMN_MONEY 9
+#define SQL_COLUMN_UPDATABLE 10
+#define SQL_COLUMN_AUTO_INCREMENT 11
+#define SQL_COLUMN_CASE_SENSITIVE 12
+#define SQL_COLUMN_SEARCHABLE 13
+#define SQL_COLUMN_TYPE_NAME 14
+#define SQL_COLUMN_TABLE_NAME 15
+#define SQL_COLUMN_OWNER_NAME 16
+#define SQL_COLUMN_QUALIFIER_NAME 17
+#define SQL_COLUMN_LABEL 18
+#define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL
+#if (ODBCVER < 0x0300)
+#define SQL_COLUMN_DRIVER_START 1000
+#endif /* ODBCVER < 0x0300 */
+
+#define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT
+
+/* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
+#define SQL_ATTR_READONLY 0
+#define SQL_ATTR_WRITE 1
+#define SQL_ATTR_READWRITE_UNKNOWN 2
+
+/* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
+/* These are also used by SQLGetInfo */
+#define SQL_UNSEARCHABLE 0
+#define SQL_LIKE_ONLY 1
+#define SQL_ALL_EXCEPT_LIKE 2
+#define SQL_SEARCHABLE 3
+#define SQL_PRED_SEARCHABLE SQL_SEARCHABLE
+
+
+/* Special return values for SQLGetData */
+#define SQL_NO_TOTAL (-4)
+
+/********************************************/
+/* SQLGetFunctions: additional values for */
+/* fFunction to represent functions that */
+/* are not in the X/Open spec. */
+/********************************************/
+
+#if (ODBCVER >= 0x0300)
+#define SQL_API_SQLALLOCHANDLESTD 73
+#define SQL_API_SQLBULKOPERATIONS 24
+#endif /* ODBCVER >= 0x0300 */
+#define SQL_API_SQLBINDPARAMETER 72
+#define SQL_API_SQLBROWSECONNECT 55
+#define SQL_API_SQLCOLATTRIBUTES 6
+#define SQL_API_SQLCOLUMNPRIVILEGES 56
+#define SQL_API_SQLDESCRIBEPARAM 58
+#define SQL_API_SQLDRIVERCONNECT 41
+#define SQL_API_SQLDRIVERS 71
+#define SQL_API_SQLEXTENDEDFETCH 59
+#define SQL_API_SQLFOREIGNKEYS 60
+#define SQL_API_SQLMORERESULTS 61
+#define SQL_API_SQLNATIVESQL 62
+#define SQL_API_SQLNUMPARAMS 63
+#define SQL_API_SQLPARAMOPTIONS 64
+#define SQL_API_SQLPRIMARYKEYS 65
+#define SQL_API_SQLPROCEDURECOLUMNS 66
+#define SQL_API_SQLPROCEDURES 67
+#define SQL_API_SQLSETPOS 68
+#define SQL_API_SQLSETSCROLLOPTIONS 69
+#define SQL_API_SQLTABLEPRIVILEGES 70
+
+/*-------------------------------------------*/
+/* SQL_EXT_API_LAST is not useful with ODBC */
+/* version 3.0 because some of the values */
+/* from X/Open are in the 10000 range. */
+/*-------------------------------------------*/
+
+#if (ODBCVER < 0x0300)
+#define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
+#define SQL_NUM_FUNCTIONS 23
+#define SQL_EXT_API_START 40
+#define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)
+#endif
+
+/*--------------------------------------------*/
+/* SQL_API_ALL_FUNCTIONS returns an array */
+/* of 'booleans' representing whether a */
+/* function is implemented by the driver. */
+/* */
+/* CAUTION: Only functions defined in ODBC */
+/* version 2.0 and earlier are returned, the */
+/* new high-range function numbers defined by */
+/* X/Open break this scheme. See the new */
+/* method -- SQL_API_ODBC3_ALL_FUNCTIONS */
+/*--------------------------------------------*/
+
+#define SQL_API_ALL_FUNCTIONS 0 /* See CAUTION above */
+
+/*----------------------------------------------*/
+/* 2.X drivers export a dummy function with */
+/* ordinal number SQL_API_LOADBYORDINAL to speed*/
+/* loading under the windows operating system. */
+/* */
+/* CAUTION: Loading by ordinal is not supported */
+/* for 3.0 and above drivers. */
+/*----------------------------------------------*/
+
+#define SQL_API_LOADBYORDINAL 199 /* See CAUTION above */
+
+/*----------------------------------------------*/
+/* SQL_API_ODBC3_ALL_FUNCTIONS */
+/* This returns a bitmap, which allows us to */
+/* handle the higher-valued function numbers. */
+/* Use SQL_FUNC_EXISTS(bitmap,function_number) */
+/* to determine if the function exists. */
+/*----------------------------------------------*/
+
+
+#if (ODBCVER >= 0x0300)
+#define SQL_API_ODBC3_ALL_FUNCTIONS 999
+#define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250 /* array of 250 words */
+
+
+#define SQL_FUNC_EXISTS(pfExists, uwAPI) ((*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) & (1 << ((uwAPI) & 0x000F)) ) ? SQL_TRUE : SQL_FALSE )
+
+#endif /* ODBCVER >= 0x0300 */
+
+
+/************************************************/
+/* Extended definitions for SQLGetInfo */
+/************************************************/
+
+/*---------------------------------*/
+/* Values in ODBC 2.0 that are not */
+/* in the X/Open spec */
+/*---------------------------------*/
+
+#define SQL_INFO_FIRST 0
+#define SQL_ACTIVE_CONNECTIONS 0 /* MAX_DRIVER_CONNECTIONS */
+#define SQL_ACTIVE_STATEMENTS 1 /* MAX_CONCURRENT_ACTIVITIES */
+#define SQL_DRIVER_HDBC 3
+#define SQL_DRIVER_HENV 4
+#define SQL_DRIVER_HSTMT 5
+#define SQL_DRIVER_NAME 6
+#define SQL_DRIVER_VER 7
+#define SQL_ODBC_API_CONFORMANCE 9
+#define SQL_ODBC_VER 10
+#define SQL_ROW_UPDATES 11
+#define SQL_ODBC_SAG_CLI_CONFORMANCE 12
+#define SQL_ODBC_SQL_CONFORMANCE 15
+#define SQL_PROCEDURES 21
+#define SQL_CONCAT_NULL_BEHAVIOR 22
+#define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
+#define SQL_EXPRESSIONS_IN_ORDERBY 27
+#define SQL_MAX_OWNER_NAME_LEN 32 /* MAX_SCHEMA_NAME_LEN */
+#define SQL_MAX_PROCEDURE_NAME_LEN 33
+#define SQL_MAX_QUALIFIER_NAME_LEN 34 /* MAX_CATALOG_NAME_LEN */
+#define SQL_MULT_RESULT_SETS 36
+#define SQL_MULTIPLE_ACTIVE_TXN 37
+#define SQL_OUTER_JOINS 38
+#define SQL_OWNER_TERM 39
+#define SQL_PROCEDURE_TERM 40
+#define SQL_QUALIFIER_NAME_SEPARATOR 41
+#define SQL_QUALIFIER_TERM 42
+#define SQL_SCROLL_OPTIONS 44
+#define SQL_TABLE_TERM 45
+#define SQL_CONVERT_FUNCTIONS 48
+#define SQL_NUMERIC_FUNCTIONS 49
+#define SQL_STRING_FUNCTIONS 50
+#define SQL_SYSTEM_FUNCTIONS 51
+#define SQL_TIMEDATE_FUNCTIONS 52
+#define SQL_CONVERT_BIGINT 53
+#define SQL_CONVERT_BINARY 54
+#define SQL_CONVERT_BIT 55
+#define SQL_CONVERT_CHAR 56
+#define SQL_CONVERT_DATE 57
+#define SQL_CONVERT_DECIMAL 58
+#define SQL_CONVERT_DOUBLE 59
+#define SQL_CONVERT_FLOAT 60
+#define SQL_CONVERT_INTEGER 61
+#define SQL_CONVERT_LONGVARCHAR 62
+#define SQL_CONVERT_NUMERIC 63
+#define SQL_CONVERT_REAL 64
+#define SQL_CONVERT_SMALLINT 65
+#define SQL_CONVERT_TIME 66
+#define SQL_CONVERT_TIMESTAMP 67
+#define SQL_CONVERT_TINYINT 68
+#define SQL_CONVERT_VARBINARY 69
+#define SQL_CONVERT_VARCHAR 70
+#define SQL_CONVERT_LONGVARBINARY 71
+#define SQL_CONVERT_GUID 173
+#define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */
+#define SQL_CORRELATION_NAME 74
+#define SQL_NON_NULLABLE_COLUMNS 75
+#define SQL_DRIVER_HLIB 76
+#define SQL_DRIVER_ODBC_VER 77
+#define SQL_LOCK_TYPES 78
+#define SQL_POS_OPERATIONS 79
+#define SQL_POSITIONED_STATEMENTS 80
+#define SQL_BOOKMARK_PERSISTENCE 82
+#define SQL_STATIC_SENSITIVITY 83
+#define SQL_FILE_USAGE 84
+#define SQL_COLUMN_ALIAS 87
+#define SQL_GROUP_BY 88
+#define SQL_KEYWORDS 89
+#define SQL_OWNER_USAGE 91
+#define SQL_QUALIFIER_USAGE 92
+#define SQL_QUOTED_IDENTIFIER_CASE 93
+#define SQL_SUBQUERIES 95
+#define SQL_UNION 96
+#define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
+#define SQL_MAX_CHAR_LITERAL_LEN 108
+#define SQL_TIMEDATE_ADD_INTERVALS 109
+#define SQL_TIMEDATE_DIFF_INTERVALS 110
+#define SQL_NEED_LONG_DATA_LEN 111
+#define SQL_MAX_BINARY_LITERAL_LEN 112
+#define SQL_LIKE_ESCAPE_CLAUSE 113
+#define SQL_QUALIFIER_LOCATION 114
+
+#if (ODBCVER >= 0x0201 && ODBCVER < 0x0300)
+#ifndef SQL_OJ_CAPABILITIES
+#define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */
+#endif
+#endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */
+
+/*----------------------------------------------*/
+/* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */
+/* not useful anymore, because X/Open has */
+/* values in the 10000 range. You */
+/* must contact X/Open directly to get a range */
+/* of numbers for driver-specific values. */
+/*----------------------------------------------*/
+
+#if (ODBCVER < 0x0300)
+#define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
+#define SQL_INFO_DRIVER_START 1000
+#endif /* ODBCVER < 0x0300 */
+
+/*-----------------------------------------------*/
+/* ODBC 3.0 SQLGetInfo values that are not part */
+/* of the X/Open standard at this time. X/Open */
+/* standard values are in sql.h. */
+/*-----------------------------------------------*/
+
+#if (ODBCVER >= 0x0300)
+#define SQL_ACTIVE_ENVIRONMENTS 116
+#define SQL_ALTER_DOMAIN 117
+
+#define SQL_SQL_CONFORMANCE 118
+#define SQL_DATETIME_LITERALS 119
+
+#define SQL_ASYNC_MODE 10021 /* new X/Open spec */
+#define SQL_BATCH_ROW_COUNT 120
+#define SQL_BATCH_SUPPORT 121
+#define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION
+#define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR
+#define SQL_CATALOG_TERM SQL_QUALIFIER_TERM
+#define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE
+#define SQL_CONVERT_WCHAR 122
+#define SQL_CONVERT_INTERVAL_DAY_TIME 123
+#define SQL_CONVERT_INTERVAL_YEAR_MONTH 124
+#define SQL_CONVERT_WLONGVARCHAR 125
+#define SQL_CONVERT_WVARCHAR 126
+#define SQL_CREATE_ASSERTION 127
+#define SQL_CREATE_CHARACTER_SET 128
+#define SQL_CREATE_COLLATION 129
+#define SQL_CREATE_DOMAIN 130
+#define SQL_CREATE_SCHEMA 131
+#define SQL_CREATE_TABLE 132
+#define SQL_CREATE_TRANSLATION 133
+#define SQL_CREATE_VIEW 134
+#define SQL_DRIVER_HDESC 135
+#define SQL_DROP_ASSERTION 136
+#define SQL_DROP_CHARACTER_SET 137
+#define SQL_DROP_COLLATION 138
+#define SQL_DROP_DOMAIN 139
+#define SQL_DROP_SCHEMA 140
+#define SQL_DROP_TABLE 141
+#define SQL_DROP_TRANSLATION 142
+#define SQL_DROP_VIEW 143
+#define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144
+#define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145
+#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146
+#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147
+#define SQL_INDEX_KEYWORDS 148
+#define SQL_INFO_SCHEMA_VIEWS 149
+#define SQL_KEYSET_CURSOR_ATTRIBUTES1 150
+#define SQL_KEYSET_CURSOR_ATTRIBUTES2 151
+#define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022 /* new X/Open spec */
+#define SQL_ODBC_INTERFACE_CONFORMANCE 152
+#define SQL_PARAM_ARRAY_ROW_COUNTS 153
+#define SQL_PARAM_ARRAY_SELECTS 154
+#define SQL_SCHEMA_TERM SQL_OWNER_TERM
+#define SQL_SCHEMA_USAGE SQL_OWNER_USAGE
+#define SQL_SQL92_DATETIME_FUNCTIONS 155
+#define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156
+#define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157
+#define SQL_SQL92_GRANT 158
+#define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159
+#define SQL_SQL92_PREDICATES 160
+#define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161
+#define SQL_SQL92_REVOKE 162
+#define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163
+#define SQL_SQL92_STRING_FUNCTIONS 164
+#define SQL_SQL92_VALUE_EXPRESSIONS 165
+#define SQL_STANDARD_CLI_CONFORMANCE 166
+#define SQL_STATIC_CURSOR_ATTRIBUTES1 167
+#define SQL_STATIC_CURSOR_ATTRIBUTES2 168
+
+#define SQL_AGGREGATE_FUNCTIONS 169
+#define SQL_DDL_INDEX 170
+#define SQL_DM_VER 171
+#define SQL_INSERT_STATEMENT 172
+#define SQL_UNION_STATEMENT SQL_UNION
+#endif /* ODBCVER >= 0x0300 */
+
+#define SQL_DTC_TRANSITION_COST 1750
+
+/* SQL_ALTER_TABLE bitmasks */
+#if (ODBCVER >= 0x0300)
+/* the following 5 bitmasks are defined in sql.h
+*#define SQL_AT_ADD_COLUMN 0x00000001L
+*#define SQL_AT_DROP_COLUMN 0x00000002L
+*#define SQL_AT_ADD_CONSTRAINT 0x00000008L
+*/
+#define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L
+#define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
+#define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
+#define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
+#define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
+#define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
+#define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
+#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
+#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
+#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
+#define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
+#define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
+#define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
+#define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
+#define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_CONVERT_* return value bitmasks */
+
+#define SQL_CVT_CHAR 0x00000001L
+#define SQL_CVT_NUMERIC 0x00000002L
+#define SQL_CVT_DECIMAL 0x00000004L
+#define SQL_CVT_INTEGER 0x00000008L
+#define SQL_CVT_SMALLINT 0x00000010L
+#define SQL_CVT_FLOAT 0x00000020L
+#define SQL_CVT_REAL 0x00000040L
+#define SQL_CVT_DOUBLE 0x00000080L
+#define SQL_CVT_VARCHAR 0x00000100L
+#define SQL_CVT_LONGVARCHAR 0x00000200L
+#define SQL_CVT_BINARY 0x00000400L
+#define SQL_CVT_VARBINARY 0x00000800L
+#define SQL_CVT_BIT 0x00001000L
+#define SQL_CVT_TINYINT 0x00002000L
+#define SQL_CVT_BIGINT 0x00004000L
+#define SQL_CVT_DATE 0x00008000L
+#define SQL_CVT_TIME 0x00010000L
+#define SQL_CVT_TIMESTAMP 0x00020000L
+#define SQL_CVT_LONGVARBINARY 0x00040000L
+#if (ODBCVER >= 0x0300)
+#define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L
+#define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L
+#define SQL_CVT_WCHAR 0x00200000L
+#define SQL_CVT_WLONGVARCHAR 0x00400000L
+#define SQL_CVT_WVARCHAR 0x00800000L
+#define SQL_CVT_GUID 0x01000000L
+
+#endif /* ODBCVER >= 0x0300 */
+
+
+/* SQL_CONVERT_FUNCTIONS functions */
+#define SQL_FN_CVT_CONVERT 0x00000001L
+#if (ODBCVER >= 0x0300)
+#define SQL_FN_CVT_CAST 0x00000002L
+#endif /* ODBCVER >= 0x0300 */
+
+
+/* SQL_STRING_FUNCTIONS functions */
+
+#define SQL_FN_STR_CONCAT 0x00000001L
+#define SQL_FN_STR_INSERT 0x00000002L
+#define SQL_FN_STR_LEFT 0x00000004L
+#define SQL_FN_STR_LTRIM 0x00000008L
+#define SQL_FN_STR_LENGTH 0x00000010L
+#define SQL_FN_STR_LOCATE 0x00000020L
+#define SQL_FN_STR_LCASE 0x00000040L
+#define SQL_FN_STR_REPEAT 0x00000080L
+#define SQL_FN_STR_REPLACE 0x00000100L
+#define SQL_FN_STR_RIGHT 0x00000200L
+#define SQL_FN_STR_RTRIM 0x00000400L
+#define SQL_FN_STR_SUBSTRING 0x00000800L
+#define SQL_FN_STR_UCASE 0x00001000L
+#define SQL_FN_STR_ASCII 0x00002000L
+#define SQL_FN_STR_CHAR 0x00004000L
+#define SQL_FN_STR_DIFFERENCE 0x00008000L
+#define SQL_FN_STR_LOCATE_2 0x00010000L
+#define SQL_FN_STR_SOUNDEX 0x00020000L
+#define SQL_FN_STR_SPACE 0x00040000L
+#if (ODBCVER >= 0x0300)
+#define SQL_FN_STR_BIT_LENGTH 0x00080000L
+#define SQL_FN_STR_CHAR_LENGTH 0x00100000L
+#define SQL_FN_STR_CHARACTER_LENGTH 0x00200000L
+#define SQL_FN_STR_OCTET_LENGTH 0x00400000L
+#define SQL_FN_STR_POSITION 0x00800000L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_SQL92_STRING_FUNCTIONS */
+#if (ODBCVER >= 0x0300)
+#define SQL_SSF_CONVERT 0x00000001L
+#define SQL_SSF_LOWER 0x00000002L
+#define SQL_SSF_UPPER 0x00000004L
+#define SQL_SSF_SUBSTRING 0x00000008L
+#define SQL_SSF_TRANSLATE 0x00000010L
+#define SQL_SSF_TRIM_BOTH 0x00000020L
+#define SQL_SSF_TRIM_LEADING 0x00000040L
+#define SQL_SSF_TRIM_TRAILING 0x00000080L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_NUMERIC_FUNCTIONS functions */
+
+#define SQL_FN_NUM_ABS 0x00000001L
+#define SQL_FN_NUM_ACOS 0x00000002L
+#define SQL_FN_NUM_ASIN 0x00000004L
+#define SQL_FN_NUM_ATAN 0x00000008L
+#define SQL_FN_NUM_ATAN2 0x00000010L
+#define SQL_FN_NUM_CEILING 0x00000020L
+#define SQL_FN_NUM_COS 0x00000040L
+#define SQL_FN_NUM_COT 0x00000080L
+#define SQL_FN_NUM_EXP 0x00000100L
+#define SQL_FN_NUM_FLOOR 0x00000200L
+#define SQL_FN_NUM_LOG 0x00000400L
+#define SQL_FN_NUM_MOD 0x00000800L
+#define SQL_FN_NUM_SIGN 0x00001000L
+#define SQL_FN_NUM_SIN 0x00002000L
+#define SQL_FN_NUM_SQRT 0x00004000L
+#define SQL_FN_NUM_TAN 0x00008000L
+#define SQL_FN_NUM_PI 0x00010000L
+#define SQL_FN_NUM_RAND 0x00020000L
+#define SQL_FN_NUM_DEGREES 0x00040000L
+#define SQL_FN_NUM_LOG10 0x00080000L
+#define SQL_FN_NUM_POWER 0x00100000L
+#define SQL_FN_NUM_RADIANS 0x00200000L
+#define SQL_FN_NUM_ROUND 0x00400000L
+#define SQL_FN_NUM_TRUNCATE 0x00800000L
+
+/* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */
+#if (ODBCVER >= 0x0300)
+#define SQL_SNVF_BIT_LENGTH 0x00000001L
+#define SQL_SNVF_CHAR_LENGTH 0x00000002L
+#define SQL_SNVF_CHARACTER_LENGTH 0x00000004L
+#define SQL_SNVF_EXTRACT 0x00000008L
+#define SQL_SNVF_OCTET_LENGTH 0x00000010L
+#define SQL_SNVF_POSITION 0x00000020L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_TIMEDATE_FUNCTIONS functions */
+
+#define SQL_FN_TD_NOW 0x00000001L
+#define SQL_FN_TD_CURDATE 0x00000002L
+#define SQL_FN_TD_DAYOFMONTH 0x00000004L
+#define SQL_FN_TD_DAYOFWEEK 0x00000008L
+#define SQL_FN_TD_DAYOFYEAR 0x00000010L
+#define SQL_FN_TD_MONTH 0x00000020L
+#define SQL_FN_TD_QUARTER 0x00000040L
+#define SQL_FN_TD_WEEK 0x00000080L
+#define SQL_FN_TD_YEAR 0x00000100L
+#define SQL_FN_TD_CURTIME 0x00000200L
+#define SQL_FN_TD_HOUR 0x00000400L
+#define SQL_FN_TD_MINUTE 0x00000800L
+#define SQL_FN_TD_SECOND 0x00001000L
+#define SQL_FN_TD_TIMESTAMPADD 0x00002000L
+#define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L
+#define SQL_FN_TD_DAYNAME 0x00008000L
+#define SQL_FN_TD_MONTHNAME 0x00010000L
+#if (ODBCVER >= 0x0300)
+#define SQL_FN_TD_CURRENT_DATE 0x00020000L
+#define SQL_FN_TD_CURRENT_TIME 0x00040000L
+#define SQL_FN_TD_CURRENT_TIMESTAMP 0x00080000L
+#define SQL_FN_TD_EXTRACT 0x00100000L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_SQL92_DATETIME_FUNCTIONS */
+#if (ODBCVER >= 0x0300)
+#define SQL_SDF_CURRENT_DATE 0x00000001L
+#define SQL_SDF_CURRENT_TIME 0x00000002L
+#define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_SYSTEM_FUNCTIONS functions */
+
+#define SQL_FN_SYS_USERNAME 0x00000001L
+#define SQL_FN_SYS_DBNAME 0x00000002L
+#define SQL_FN_SYS_IFNULL 0x00000004L
+
+/* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */
+
+#define SQL_FN_TSI_FRAC_SECOND 0x00000001L
+#define SQL_FN_TSI_SECOND 0x00000002L
+#define SQL_FN_TSI_MINUTE 0x00000004L
+#define SQL_FN_TSI_HOUR 0x00000008L
+#define SQL_FN_TSI_DAY 0x00000010L
+#define SQL_FN_TSI_WEEK 0x00000020L
+#define SQL_FN_TSI_MONTH 0x00000040L
+#define SQL_FN_TSI_QUARTER 0x00000080L
+#define SQL_FN_TSI_YEAR 0x00000100L
+
+/* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1,
+ * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1,
+ * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1
+ */
+#if (ODBCVER >= 0x0300)
+/* supported SQLFetchScroll FetchOrientation's */
+#define SQL_CA1_NEXT 0x00000001L
+#define SQL_CA1_ABSOLUTE 0x00000002L
+#define SQL_CA1_RELATIVE 0x00000004L
+#define SQL_CA1_BOOKMARK 0x00000008L
+
+/* supported SQLSetPos LockType's */
+#define SQL_CA1_LOCK_NO_CHANGE 0x00000040L
+#define SQL_CA1_LOCK_EXCLUSIVE 0x00000080L
+#define SQL_CA1_LOCK_UNLOCK 0x00000100L
+
+/* supported SQLSetPos Operations */
+#define SQL_CA1_POS_POSITION 0x00000200L
+#define SQL_CA1_POS_UPDATE 0x00000400L
+#define SQL_CA1_POS_DELETE 0x00000800L
+#define SQL_CA1_POS_REFRESH 0x00001000L
+
+/* positioned updates and deletes */
+#define SQL_CA1_POSITIONED_UPDATE 0x00002000L
+#define SQL_CA1_POSITIONED_DELETE 0x00004000L
+#define SQL_CA1_SELECT_FOR_UPDATE 0x00008000L
+
+/* supported SQLBulkOperations operations */
+#define SQL_CA1_BULK_ADD 0x00010000L
+#define SQL_CA1_BULK_UPDATE_BY_BOOKMARK 0x00020000L
+#define SQL_CA1_BULK_DELETE_BY_BOOKMARK 0x00040000L
+#define SQL_CA1_BULK_FETCH_BY_BOOKMARK 0x00080000L
+#endif /* ODBCVER >= 0x0300 */
+
+/* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2,
+ * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2,
+ * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2
+ */
+#if (ODBCVER >= 0x0300)
+/* supported values for SQL_ATTR_SCROLL_CONCURRENCY */
+#define SQL_CA2_READ_ONLY_CONCURRENCY 0x00000001L
+#define SQL_CA2_LOCK_CONCURRENCY 0x00000002L
+#define SQL_CA2_OPT_ROWVER_CONCURRENCY 0x00000004L
+#define SQL_CA2_OPT_VALUES_CONCURRENCY 0x00000008L
+
+/* sensitivity of the cursor to its own inserts, deletes, and updates */
+#define SQL_CA2_SENSITIVITY_ADDITIONS 0x00000010L
+#define SQL_CA2_SENSITIVITY_DELETIONS 0x00000020L
+#define SQL_CA2_SENSITIVITY_UPDATES 0x00000040L
+
+/* semantics of SQL_ATTR_MAX_ROWS */
+#define SQL_CA2_MAX_ROWS_SELECT 0x00000080L
+#define SQL_CA2_MAX_ROWS_INSERT 0x00000100L
+#define SQL_CA2_MAX_ROWS_DELETE 0x00000200L
+#define SQL_CA2_MAX_ROWS_UPDATE 0x00000400L
+#define SQL_CA2_MAX_ROWS_CATALOG 0x00000800L
+#define SQL_CA2_MAX_ROWS_AFFECTS_ALL (SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG)
+
+/* semantics of SQL_DIAG_CURSOR_ROW_COUNT */
+#define SQL_CA2_CRC_EXACT 0x00001000L
+#define SQL_CA2_CRC_APPROXIMATE 0x00002000L
+
+/* the kinds of positioned statements that can be simulated */
+#define SQL_CA2_SIMULATE_NON_UNIQUE 0x00004000L
+#define SQL_CA2_SIMULATE_TRY_UNIQUE 0x00008000L
+#define SQL_CA2_SIMULATE_UNIQUE 0x00010000L
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_ODBC_API_CONFORMANCE values */
+
+#define SQL_OAC_NONE 0x0000
+#define SQL_OAC_LEVEL1 0x0001
+#define SQL_OAC_LEVEL2 0x0002
+
+/* SQL_ODBC_SAG_CLI_CONFORMANCE values */
+
+#define SQL_OSCC_NOT_COMPLIANT 0x0000
+#define SQL_OSCC_COMPLIANT 0x0001
+
+/* SQL_ODBC_SQL_CONFORMANCE values */
+
+#define SQL_OSC_MINIMUM 0x0000
+#define SQL_OSC_CORE 0x0001
+#define SQL_OSC_EXTENDED 0x0002
+
+
+/* SQL_CONCAT_NULL_BEHAVIOR values */
+
+#define SQL_CB_NULL 0x0000
+#define SQL_CB_NON_NULL 0x0001
+
+/* SQL_SCROLL_OPTIONS masks */
+
+#define SQL_SO_FORWARD_ONLY 0x00000001L
+#define SQL_SO_KEYSET_DRIVEN 0x00000002L
+#define SQL_SO_DYNAMIC 0x00000004L
+#define SQL_SO_MIXED 0x00000008L
+#define SQL_SO_STATIC 0x00000010L
+
+/* SQL_FETCH_DIRECTION masks */
+
+/* SQL_FETCH_RESUME is no longer supported
+#define SQL_FD_FETCH_RESUME 0x00000040L
+*/
+#define SQL_FD_FETCH_BOOKMARK 0x00000080L
+
+/* SQL_TXN_ISOLATION_OPTION masks */
+/* SQL_TXN_VERSIONING is no longer supported
+#define SQL_TXN_VERSIONING 0x00000010L
+*/
+
+/* SQL_CORRELATION_NAME values */
+
+#define SQL_CN_NONE 0x0000
+#define SQL_CN_DIFFERENT 0x0001
+#define SQL_CN_ANY 0x0002
+
+/* SQL_NON_NULLABLE_COLUMNS values */
+
+#define SQL_NNC_NULL 0x0000
+#define SQL_NNC_NON_NULL 0x0001
+
+/* SQL_NULL_COLLATION values */
+
+#define SQL_NC_START 0x0002
+#define SQL_NC_END 0x0004
+
+/* SQL_FILE_USAGE values */
+
+#define SQL_FILE_NOT_SUPPORTED 0x0000
+#define SQL_FILE_TABLE 0x0001
+#define SQL_FILE_QUALIFIER 0x0002
+#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */
+
+
+/* SQL_GETDATA_EXTENSIONS values */
+
+#define SQL_GD_BLOCK 0x00000004L
+#define SQL_GD_BOUND 0x00000008L
+
+/* SQL_POSITIONED_STATEMENTS masks */
+
+#define SQL_PS_POSITIONED_DELETE 0x00000001L
+#define SQL_PS_POSITIONED_UPDATE 0x00000002L
+#define SQL_PS_SELECT_FOR_UPDATE 0x00000004L
+
+/* SQL_GROUP_BY values */
+
+#define SQL_GB_NOT_SUPPORTED 0x0000
+#define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001
+#define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002
+#define SQL_GB_NO_RELATION 0x0003
+#if (ODBCVER >= 0x0300)
+#define SQL_GB_COLLATE 0x0004
+
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_OWNER_USAGE masks */
+
+#define SQL_OU_DML_STATEMENTS 0x00000001L
+#define SQL_OU_PROCEDURE_INVOCATION 0x00000002L
+#define SQL_OU_TABLE_DEFINITION 0x00000004L
+#define SQL_OU_INDEX_DEFINITION 0x00000008L
+#define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L
+
+/* SQL_SCHEMA_USAGE masks */
+#if (ODBCVER >= 0x0300)
+#define SQL_SU_DML_STATEMENTS SQL_OU_DML_STATEMENTS
+#define SQL_SU_PROCEDURE_INVOCATION SQL_OU_PROCEDURE_INVOCATION
+#define SQL_SU_TABLE_DEFINITION SQL_OU_TABLE_DEFINITION
+#define SQL_SU_INDEX_DEFINITION SQL_OU_INDEX_DEFINITION
+#define SQL_SU_PRIVILEGE_DEFINITION SQL_OU_PRIVILEGE_DEFINITION
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_QUALIFIER_USAGE masks */
+
+#define SQL_QU_DML_STATEMENTS 0x00000001L
+#define SQL_QU_PROCEDURE_INVOCATION 0x00000002L
+#define SQL_QU_TABLE_DEFINITION 0x00000004L
+#define SQL_QU_INDEX_DEFINITION 0x00000008L
+#define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L
+
+#if (ODBCVER >= 0x0300)
+/* SQL_CATALOG_USAGE masks */
+#define SQL_CU_DML_STATEMENTS SQL_QU_DML_STATEMENTS
+#define SQL_CU_PROCEDURE_INVOCATION SQL_QU_PROCEDURE_INVOCATION
+#define SQL_CU_TABLE_DEFINITION SQL_QU_TABLE_DEFINITION
+#define SQL_CU_INDEX_DEFINITION SQL_QU_INDEX_DEFINITION
+#define SQL_CU_PRIVILEGE_DEFINITION SQL_QU_PRIVILEGE_DEFINITION
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_SUBQUERIES masks */
+
+#define SQL_SQ_COMPARISON 0x00000001L
+#define SQL_SQ_EXISTS 0x00000002L
+#define SQL_SQ_IN 0x00000004L
+#define SQL_SQ_QUANTIFIED 0x00000008L
+#define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L
+
+/* SQL_UNION masks */
+
+#define SQL_U_UNION 0x00000001L
+#define SQL_U_UNION_ALL 0x00000002L
+
+/* SQL_BOOKMARK_PERSISTENCE values */
+
+#define SQL_BP_CLOSE 0x00000001L
+#define SQL_BP_DELETE 0x00000002L
+#define SQL_BP_DROP 0x00000004L
+#define SQL_BP_TRANSACTION 0x00000008L
+#define SQL_BP_UPDATE 0x00000010L
+#define SQL_BP_OTHER_HSTMT 0x00000020L
+#define SQL_BP_SCROLL 0x00000040L
+
+/* SQL_STATIC_SENSITIVITY values */
+
+#define SQL_SS_ADDITIONS 0x00000001L
+#define SQL_SS_DELETIONS 0x00000002L
+#define SQL_SS_UPDATES 0x00000004L
+
+/* SQL_VIEW values */
+#define SQL_CV_CREATE_VIEW 0x00000001L
+#define SQL_CV_CHECK_OPTION 0x00000002L
+#define SQL_CV_CASCADED 0x00000004L
+#define SQL_CV_LOCAL 0x00000008L
+
+/* SQL_LOCK_TYPES masks */
+
+#define SQL_LCK_NO_CHANGE 0x00000001L
+#define SQL_LCK_EXCLUSIVE 0x00000002L
+#define SQL_LCK_UNLOCK 0x00000004L
+
+/* SQL_POS_OPERATIONS masks */
+
+#define SQL_POS_POSITION 0x00000001L
+#define SQL_POS_REFRESH 0x00000002L
+#define SQL_POS_UPDATE 0x00000004L
+#define SQL_POS_DELETE 0x00000008L
+#define SQL_POS_ADD 0x00000010L
+
+/* SQL_QUALIFIER_LOCATION values */
+
+#define SQL_QL_START 0x0001
+#define SQL_QL_END 0x0002
+
+/* Here start return values for ODBC 3.0 SQLGetInfo */
+
+#if (ODBCVER >= 0x0300)
+/* SQL_AGGREGATE_FUNCTIONS bitmasks */
+#define SQL_AF_AVG 0x00000001L
+#define SQL_AF_COUNT 0x00000002L
+#define SQL_AF_MAX 0x00000004L
+#define SQL_AF_MIN 0x00000008L
+#define SQL_AF_SUM 0x00000010L
+#define SQL_AF_DISTINCT 0x00000020L
+#define SQL_AF_ALL 0x00000040L
+
+/* SQL_SQL_CONFORMANCE bit masks */
+#define SQL_SC_SQL92_ENTRY 0x00000001L
+#define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L
+#define SQL_SC_SQL92_INTERMEDIATE 0x00000004L
+#define SQL_SC_SQL92_FULL 0x00000008L
+
+/* SQL_DATETIME_LITERALS masks */
+#define SQL_DL_SQL92_DATE 0x00000001L
+#define SQL_DL_SQL92_TIME 0x00000002L
+#define SQL_DL_SQL92_TIMESTAMP 0x00000004L
+#define SQL_DL_SQL92_INTERVAL_YEAR 0x00000008L
+#define SQL_DL_SQL92_INTERVAL_MONTH 0x00000010L
+#define SQL_DL_SQL92_INTERVAL_DAY 0x00000020L
+#define SQL_DL_SQL92_INTERVAL_HOUR 0x00000040L
+#define SQL_DL_SQL92_INTERVAL_MINUTE 0x00000080L
+#define SQL_DL_SQL92_INTERVAL_SECOND 0x00000100L
+#define SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH 0x00000200L
+#define SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR 0x00000400L
+#define SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE 0x00000800L
+#define SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND 0x00001000L
+#define SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE 0x00002000L
+#define SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND 0x00004000L
+#define SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND 0x00008000L
+
+/* SQL_CATALOG_LOCATION values */
+#define SQL_CL_START SQL_QL_START
+#define SQL_CL_END SQL_QL_END
+
+/* values for SQL_BATCH_ROW_COUNT */
+#define SQL_BRC_PROCEDURES 0x0000001
+#define SQL_BRC_EXPLICIT 0x0000002
+#define SQL_BRC_ROLLED_UP 0x0000004
+
+/* bitmasks for SQL_BATCH_SUPPORT */
+#define SQL_BS_SELECT_EXPLICIT 0x00000001L
+#define SQL_BS_ROW_COUNT_EXPLICIT 0x00000002L
+#define SQL_BS_SELECT_PROC 0x00000004L
+#define SQL_BS_ROW_COUNT_PROC 0x00000008L
+
+/* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */
+#define SQL_PARC_BATCH 1
+#define SQL_PARC_NO_BATCH 2
+
+/* values for SQL_PARAM_ARRAY_SELECTS */
+#define SQL_PAS_BATCH 1
+#define SQL_PAS_NO_BATCH 2
+#define SQL_PAS_NO_SELECT 3
+
+/* Bitmasks for SQL_INDEX_KEYWORDS */
+#define SQL_IK_NONE 0x00000000L
+#define SQL_IK_ASC 0x00000001L
+#define SQL_IK_DESC 0x00000002L
+#define SQL_IK_ALL (SQL_IK_ASC | SQL_IK_DESC)
+
+/* Bitmasks for SQL_INFO_SCHEMA_VIEWS */
+
+#define SQL_ISV_ASSERTIONS 0x00000001L
+#define SQL_ISV_CHARACTER_SETS 0x00000002L
+#define SQL_ISV_CHECK_CONSTRAINTS 0x00000004L
+#define SQL_ISV_COLLATIONS 0x00000008L
+#define SQL_ISV_COLUMN_DOMAIN_USAGE 0x00000010L
+#define SQL_ISV_COLUMN_PRIVILEGES 0x00000020L
+#define SQL_ISV_COLUMNS 0x00000040L
+#define SQL_ISV_CONSTRAINT_COLUMN_USAGE 0x00000080L
+#define SQL_ISV_CONSTRAINT_TABLE_USAGE 0x00000100L
+#define SQL_ISV_DOMAIN_CONSTRAINTS 0x00000200L
+#define SQL_ISV_DOMAINS 0x00000400L
+#define SQL_ISV_KEY_COLUMN_USAGE 0x00000800L
+#define SQL_ISV_REFERENTIAL_CONSTRAINTS 0x00001000L
+#define SQL_ISV_SCHEMATA 0x00002000L
+#define SQL_ISV_SQL_LANGUAGES 0x00004000L
+#define SQL_ISV_TABLE_CONSTRAINTS 0x00008000L
+#define SQL_ISV_TABLE_PRIVILEGES 0x00010000L
+#define SQL_ISV_TABLES 0x00020000L
+#define SQL_ISV_TRANSLATIONS 0x00040000L
+#define SQL_ISV_USAGE_PRIVILEGES 0x00080000L
+#define SQL_ISV_VIEW_COLUMN_USAGE 0x00100000L
+#define SQL_ISV_VIEW_TABLE_USAGE 0x00200000L
+#define SQL_ISV_VIEWS 0x00400000L
+
+/* Bitmasks for SQL_ASYNC_MODE */
+
+#define SQL_AM_NONE 0
+#define SQL_AM_CONNECTION 1
+#define SQL_AM_STATEMENT 2
+
+/* Bitmasks for SQL_ALTER_DOMAIN */
+#define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L
+#define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L
+#define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L
+#define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L
+#define SQL_AD_DROP_DOMAIN_DEFAULT 0x00000010L
+#define SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
+#define SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
+#define SQL_AD_ADD_CONSTRAINT_DEFERRABLE 0x00000080L
+#define SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE 0x00000100L
+
+
+/* SQL_CREATE_SCHEMA bitmasks */
+#define SQL_CS_CREATE_SCHEMA 0x00000001L
+#define SQL_CS_AUTHORIZATION 0x00000002L
+#define SQL_CS_DEFAULT_CHARACTER_SET 0x00000004L
+
+/* SQL_CREATE_TRANSLATION bitmasks */
+#define SQL_CTR_CREATE_TRANSLATION 0x00000001L
+
+/* SQL_CREATE_ASSERTION bitmasks */
+#define SQL_CA_CREATE_ASSERTION 0x00000001L
+#define SQL_CA_CONSTRAINT_INITIALLY_DEFERRED 0x00000010L
+#define SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000020L
+#define SQL_CA_CONSTRAINT_DEFERRABLE 0x00000040L
+#define SQL_CA_CONSTRAINT_NON_DEFERRABLE 0x00000080L
+
+/* SQL_CREATE_CHARACTER_SET bitmasks */
+#define SQL_CCS_CREATE_CHARACTER_SET 0x00000001L
+#define SQL_CCS_COLLATE_CLAUSE 0x00000002L
+#define SQL_CCS_LIMITED_COLLATION 0x00000004L
+
+/* SQL_CREATE_COLLATION bitmasks */
+#define SQL_CCOL_CREATE_COLLATION 0x00000001L
+
+/* SQL_CREATE_DOMAIN bitmasks */
+#define SQL_CDO_CREATE_DOMAIN 0x00000001L
+#define SQL_CDO_DEFAULT 0x00000002L
+#define SQL_CDO_CONSTRAINT 0x00000004L
+#define SQL_CDO_COLLATION 0x00000008L
+#define SQL_CDO_CONSTRAINT_NAME_DEFINITION 0x00000010L
+#define SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
+#define SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
+#define SQL_CDO_CONSTRAINT_DEFERRABLE 0x00000080L
+#define SQL_CDO_CONSTRAINT_NON_DEFERRABLE 0x00000100L
+
+/* SQL_CREATE_TABLE bitmasks */
+#define SQL_CT_CREATE_TABLE 0x00000001L
+#define SQL_CT_COMMIT_PRESERVE 0x00000002L
+#define SQL_CT_COMMIT_DELETE 0x00000004L
+#define SQL_CT_GLOBAL_TEMPORARY 0x00000008L
+#define SQL_CT_LOCAL_TEMPORARY 0x00000010L
+#define SQL_CT_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
+#define SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
+#define SQL_CT_CONSTRAINT_DEFERRABLE 0x00000080L
+#define SQL_CT_CONSTRAINT_NON_DEFERRABLE 0x00000100L
+#define SQL_CT_COLUMN_CONSTRAINT 0x00000200L
+#define SQL_CT_COLUMN_DEFAULT 0x00000400L
+#define SQL_CT_COLUMN_COLLATION 0x00000800L
+#define SQL_CT_TABLE_CONSTRAINT 0x00001000L
+#define SQL_CT_CONSTRAINT_NAME_DEFINITION 0x00002000L
+
+/* SQL_DDL_INDEX bitmasks */
+#define SQL_DI_CREATE_INDEX 0x00000001L
+#define SQL_DI_DROP_INDEX 0x00000002L
+
+/* SQL_DROP_COLLATION bitmasks */
+#define SQL_DC_DROP_COLLATION 0x00000001L
+
+/* SQL_DROP_DOMAIN bitmasks */
+#define SQL_DD_DROP_DOMAIN 0x00000001L
+#define SQL_DD_RESTRICT 0x00000002L
+#define SQL_DD_CASCADE 0x00000004L
+
+/* SQL_DROP_SCHEMA bitmasks */
+#define SQL_DS_DROP_SCHEMA 0x00000001L
+#define SQL_DS_RESTRICT 0x00000002L
+#define SQL_DS_CASCADE 0x00000004L
+
+/* SQL_DROP_CHARACTER_SET bitmasks */
+#define SQL_DCS_DROP_CHARACTER_SET 0x00000001L
+
+/* SQL_DROP_ASSERTION bitmasks */
+#define SQL_DA_DROP_ASSERTION 0x00000001L
+
+/* SQL_DROP_TABLE bitmasks */
+#define SQL_DT_DROP_TABLE 0x00000001L
+#define SQL_DT_RESTRICT 0x00000002L
+#define SQL_DT_CASCADE 0x00000004L
+
+/* SQL_DROP_TRANSLATION bitmasks */
+#define SQL_DTR_DROP_TRANSLATION 0x00000001L
+
+/* SQL_DROP_VIEW bitmasks */
+#define SQL_DV_DROP_VIEW 0x00000001L
+#define SQL_DV_RESTRICT 0x00000002L
+#define SQL_DV_CASCADE 0x00000004L
+
+/* SQL_INSERT_STATEMENT bitmasks */
+#define SQL_IS_INSERT_LITERALS 0x00000001L
+#define SQL_IS_INSERT_SEARCHED 0x00000002L
+#define SQL_IS_SELECT_INTO 0x00000004L
+
+/* SQL_ODBC_INTERFACE_CONFORMANCE values */
+#define SQL_OIC_CORE 1UL
+#define SQL_OIC_LEVEL1 2UL
+#define SQL_OIC_LEVEL2 3UL
+
+/* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */
+#define SQL_SFKD_CASCADE 0x00000001L
+#define SQL_SFKD_NO_ACTION 0x00000002L
+#define SQL_SFKD_SET_DEFAULT 0x00000004L
+#define SQL_SFKD_SET_NULL 0x00000008L
+
+/* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */
+#define SQL_SFKU_CASCADE 0x00000001L
+#define SQL_SFKU_NO_ACTION 0x00000002L
+#define SQL_SFKU_SET_DEFAULT 0x00000004L
+#define SQL_SFKU_SET_NULL 0x00000008L
+
+/* SQL_SQL92_GRANT bitmasks */
+#define SQL_SG_USAGE_ON_DOMAIN 0x00000001L
+#define SQL_SG_USAGE_ON_CHARACTER_SET 0x00000002L
+#define SQL_SG_USAGE_ON_COLLATION 0x00000004L
+#define SQL_SG_USAGE_ON_TRANSLATION 0x00000008L
+#define SQL_SG_WITH_GRANT_OPTION 0x00000010L
+#define SQL_SG_DELETE_TABLE 0x00000020L
+#define SQL_SG_INSERT_TABLE 0x00000040L
+#define SQL_SG_INSERT_COLUMN 0x00000080L
+#define SQL_SG_REFERENCES_TABLE 0x00000100L
+#define SQL_SG_REFERENCES_COLUMN 0x00000200L
+#define SQL_SG_SELECT_TABLE 0x00000400L
+#define SQL_SG_UPDATE_TABLE 0x00000800L
+#define SQL_SG_UPDATE_COLUMN 0x00001000L
+
+/* SQL_SQL92_PREDICATES bitmasks */
+#define SQL_SP_EXISTS 0x00000001L
+#define SQL_SP_ISNOTNULL 0x00000002L
+#define SQL_SP_ISNULL 0x00000004L
+#define SQL_SP_MATCH_FULL 0x00000008L
+#define SQL_SP_MATCH_PARTIAL 0x00000010L
+#define SQL_SP_MATCH_UNIQUE_FULL 0x00000020L
+#define SQL_SP_MATCH_UNIQUE_PARTIAL 0x00000040L
+#define SQL_SP_OVERLAPS 0x00000080L
+#define SQL_SP_UNIQUE 0x00000100L
+#define SQL_SP_LIKE 0x00000200L
+#define SQL_SP_IN 0x00000400L
+#define SQL_SP_BETWEEN 0x00000800L
+#define SQL_SP_COMPARISON 0x00001000L
+#define SQL_SP_QUANTIFIED_COMPARISON 0x00002000L
+
+/* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */
+#define SQL_SRJO_CORRESPONDING_CLAUSE 0x00000001L
+#define SQL_SRJO_CROSS_JOIN 0x00000002L
+#define SQL_SRJO_EXCEPT_JOIN 0x00000004L
+#define SQL_SRJO_FULL_OUTER_JOIN 0x00000008L
+#define SQL_SRJO_INNER_JOIN 0x00000010L
+#define SQL_SRJO_INTERSECT_JOIN 0x00000020L
+#define SQL_SRJO_LEFT_OUTER_JOIN 0x00000040L
+#define SQL_SRJO_NATURAL_JOIN 0x00000080L
+#define SQL_SRJO_RIGHT_OUTER_JOIN 0x00000100L
+#define SQL_SRJO_UNION_JOIN 0x00000200L
+
+/* SQL_SQL92_REVOKE bitmasks */
+#define SQL_SR_USAGE_ON_DOMAIN 0x00000001L
+#define SQL_SR_USAGE_ON_CHARACTER_SET 0x00000002L
+#define SQL_SR_USAGE_ON_COLLATION 0x00000004L
+#define SQL_SR_USAGE_ON_TRANSLATION 0x00000008L
+#define SQL_SR_GRANT_OPTION_FOR 0x00000010L
+#define SQL_SR_CASCADE 0x00000020L
+#define SQL_SR_RESTRICT 0x00000040L
+#define SQL_SR_DELETE_TABLE 0x00000080L
+#define SQL_SR_INSERT_TABLE 0x00000100L
+#define SQL_SR_INSERT_COLUMN 0x00000200L
+#define SQL_SR_REFERENCES_TABLE 0x00000400L
+#define SQL_SR_REFERENCES_COLUMN 0x00000800L
+#define SQL_SR_SELECT_TABLE 0x00001000L
+#define SQL_SR_UPDATE_TABLE 0x00002000L
+#define SQL_SR_UPDATE_COLUMN 0x00004000L
+
+/* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */
+#define SQL_SRVC_VALUE_EXPRESSION 0x00000001L
+#define SQL_SRVC_NULL 0x00000002L
+#define SQL_SRVC_DEFAULT 0x00000004L
+#define SQL_SRVC_ROW_SUBQUERY 0x00000008L
+
+/* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */
+#define SQL_SVE_CASE 0x00000001L
+#define SQL_SVE_CAST 0x00000002L
+#define SQL_SVE_COALESCE 0x00000004L
+#define SQL_SVE_NULLIF 0x00000008L
+
+/* SQL_STANDARD_CLI_CONFORMANCE bitmasks */
+#define SQL_SCC_XOPEN_CLI_VERSION1 0x00000001L
+#define SQL_SCC_ISO92_CLI 0x00000002L
+
+/* SQL_UNION_STATEMENT bitmasks */
+#define SQL_US_UNION SQL_U_UNION
+#define SQL_US_UNION_ALL SQL_U_UNION_ALL
+
+#endif /* ODBCVER >= 0x0300 */
+
+/* SQL_DTC_TRANSITION_COST bitmasks */
+#define SQL_DTC_ENLIST_EXPENSIVE 0x00000001L
+#define SQL_DTC_UNENLIST_EXPENSIVE 0x00000002L
+
+/* additional SQLDataSources fetch directions */
+#if (ODBCVER >= 0x0300)
+#define SQL_FETCH_FIRST_USER 31
+#define SQL_FETCH_FIRST_SYSTEM 32
+#endif /* ODBCVER >= 0x0300 */
+
+
+/* Defines for SQLSetPos */
+#define SQL_ENTIRE_ROWSET 0
+
+/* Operations in SQLSetPos */
+#define SQL_POSITION 0 /* 1.0 FALSE */
+#define SQL_REFRESH 1 /* 1.0 TRUE */
+#define SQL_UPDATE 2
+#define SQL_DELETE 3
+
+/* Operations in SQLBulkOperations */
+#define SQL_ADD 4
+#define SQL_SETPOS_MAX_OPTION_VALUE SQL_ADD
+#if (ODBCVER >= 0x0300)
+#define SQL_UPDATE_BY_BOOKMARK 5
+#define SQL_DELETE_BY_BOOKMARK 6
+#define SQL_FETCH_BY_BOOKMARK 7
+
+#endif /* ODBCVER >= 0x0300 */
+
+/* Lock options in SQLSetPos */
+#define SQL_LOCK_NO_CHANGE 0 /* 1.0 FALSE */
+#define SQL_LOCK_EXCLUSIVE 1 /* 1.0 TRUE */
+#define SQL_LOCK_UNLOCK 2
+
+#define SQL_SETPOS_MAX_LOCK_VALUE SQL_LOCK_UNLOCK
+
+/* Macros for SQLSetPos */
+#define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE)
+#define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock)
+#define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock)
+#define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
+#define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE)
+#define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)
+
+/* Column types and scopes in SQLSpecialColumns. */
+#define SQL_BEST_ROWID 1
+#define SQL_ROWVER 2
+
+/* Defines for SQLSpecialColumns (returned in the result set)
+ SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */
+#define SQL_PC_NOT_PSEUDO 1
+
+/* Defines for SQLStatistics */
+#define SQL_QUICK 0
+#define SQL_ENSURE 1
+
+/* Defines for SQLStatistics (returned in the result set)
+ SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are
+ defined in sql.h */
+#define SQL_TABLE_STAT 0
+
+
+/* Defines for SQLTables */
+#if (ODBCVER >= 0x0300)
+#define SQL_ALL_CATALOGS "%"
+#define SQL_ALL_SCHEMAS "%"
+#define SQL_ALL_TABLE_TYPES "%"
+#endif /* ODBCVER >= 0x0300 */
+
+/* Options for SQLDriverConnect */
+#define SQL_DRIVER_NOPROMPT 0
+#define SQL_DRIVER_COMPLETE 1
+#define SQL_DRIVER_PROMPT 2
+#define SQL_DRIVER_COMPLETE_REQUIRED 3
+
+SQLRETURN SQL_API SQLDriverConnect(
+ SQLHDBC hdbc,
+ SQLHWND hwnd,
+ SQLCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut,
+ SQLUSMALLINT fDriverCompletion);
+
+/* Level 2 Functions */
+
+/* SQLExtendedFetch "fFetchType" values */
+#define SQL_FETCH_BOOKMARK 8
+
+/* SQLExtendedFetch "rgfRowStatus" element values */
+#define SQL_ROW_SUCCESS 0
+#define SQL_ROW_DELETED 1
+#define SQL_ROW_UPDATED 2
+#define SQL_ROW_NOROW 3
+#define SQL_ROW_ADDED 4
+#define SQL_ROW_ERROR 5
+#if (ODBCVER >= 0x0300)
+#define SQL_ROW_SUCCESS_WITH_INFO 6
+#define SQL_ROW_PROCEED 0
+#define SQL_ROW_IGNORE 1
+#endif
+
+/* value for SQL_DESC_ARRAY_STATUS_PTR */
+#if (ODBCVER >= 0x0300)
+#define SQL_PARAM_SUCCESS 0
+#define SQL_PARAM_SUCCESS_WITH_INFO 6
+#define SQL_PARAM_ERROR 5
+#define SQL_PARAM_UNUSED 7
+#define SQL_PARAM_DIAG_UNAVAILABLE 1
+
+#define SQL_PARAM_PROCEED 0
+#define SQL_PARAM_IGNORE 1
+#endif /* ODBCVER >= 0x0300 */
+
+/* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */
+#define SQL_CASCADE 0
+#define SQL_RESTRICT 1
+#define SQL_SET_NULL 2
+#if (ODBCVER >= 0x0250)
+#define SQL_NO_ACTION 3
+#define SQL_SET_DEFAULT 4
+#endif /* ODBCVER >= 0x0250 */
+
+#if (ODBCVER >= 0x0300)
+/* Note that the following are in a different column of SQLForeignKeys than */
+/* the previous #defines. These are for DEFERRABILITY. */
+
+#define SQL_INITIALLY_DEFERRED 5
+#define SQL_INITIALLY_IMMEDIATE 6
+#define SQL_NOT_DEFERRABLE 7
+
+#endif /* ODBCVER >= 0x0300 */
+
+/* Defines for SQLBindParameter and
+ SQLProcedureColumns (returned in the result set) */
+#define SQL_PARAM_TYPE_UNKNOWN 0
+#define SQL_PARAM_INPUT 1
+#define SQL_PARAM_INPUT_OUTPUT 2
+#define SQL_RESULT_COL 3
+#define SQL_PARAM_OUTPUT 4
+#define SQL_RETURN_VALUE 5
+
+/* Defines for SQLProcedures (returned in the result set) */
+#define SQL_PT_UNKNOWN 0
+#define SQL_PT_PROCEDURE 1
+#define SQL_PT_FUNCTION 2
+
+/* This define is too large for RC */
+#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
+"ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
+"BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
+"CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
+"COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
+"CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
+"CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
+"DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
+"DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
+"DISTINCT,DOMAIN,DOUBLE,DROP,"\
+"ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
+"EXISTS,EXTERNAL,EXTRACT,"\
+"FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
+"GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
+"IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
+"INPUT,INSENSITIVE,INSERT,INT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
+"JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
+"MATCH,MAX,MIN,MINUTE,MODULE,MONTH,"\
+"NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
+"OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
+"PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
+"PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
+"READ,REAL,REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS"\
+"SCHEMA,SCROLL,SECOND,SECTION,SELECT,SESSION,SESSION_USER,SET,SIZE,"\
+"SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
+"SUBSTRING,SUM,SYSTEM_USER,"\
+"TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
+"TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
+"UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
+"VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\
+"YEAR,ZONE"
+
+SQLRETURN SQL_API SQLBrowseConnect(
+ SQLHDBC hdbc,
+ SQLCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut);
+
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLBulkOperations(
+ SQLHSTMT StatementHandle,
+ SQLSMALLINT Operation);
+#endif /* ODBCVER >= 0x0300 */
+
+SQLRETURN SQL_API SQLColAttributes(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT icol,
+ SQLUSMALLINT fDescType,
+ SQLPOINTER rgbDesc,
+ SQLSMALLINT cbDescMax,
+ SQLSMALLINT *pcbDesc,
+ SQLLEN *pfDesc);
+
+SQLRETURN SQL_API SQLColumnPrivileges(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLDescribeParam(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT ipar,
+ SQLSMALLINT *pfSqlType,
+ SQLULEN *pcbParamDef,
+ SQLSMALLINT *pibScale,
+ SQLSMALLINT *pfNullable);
+
+SQLRETURN SQL_API SQLExtendedFetch(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT fFetchType,
+ SQLLEN irow,
+ SQLULEN *pcrow,
+ SQLUSMALLINT *rgfRowStatus);
+
+SQLRETURN SQL_API SQLForeignKeys(
+ SQLHSTMT hstmt,
+ SQLCHAR *szPkCatalogName,
+ SQLSMALLINT cbPkCatalogName,
+ SQLCHAR *szPkSchemaName,
+ SQLSMALLINT cbPkSchemaName,
+ SQLCHAR *szPkTableName,
+ SQLSMALLINT cbPkTableName,
+ SQLCHAR *szFkCatalogName,
+ SQLSMALLINT cbFkCatalogName,
+ SQLCHAR *szFkSchemaName,
+ SQLSMALLINT cbFkSchemaName,
+ SQLCHAR *szFkTableName,
+ SQLSMALLINT cbFkTableName);
+
+SQLRETURN SQL_API SQLMoreResults(
+ SQLHSTMT hstmt);
+
+SQLRETURN SQL_API SQLNativeSql(
+ SQLHDBC hdbc,
+ SQLCHAR *szSqlStrIn,
+ SQLINTEGER cbSqlStrIn,
+ SQLCHAR *szSqlStr,
+ SQLINTEGER cbSqlStrMax,
+ SQLINTEGER *pcbSqlStr);
+
+SQLRETURN SQL_API SQLNumParams(
+ SQLHSTMT hstmt,
+ SQLSMALLINT *pcpar);
+
+SQLRETURN SQL_API SQLParamOptions(
+ SQLHSTMT hstmt,
+ SQLULEN crow,
+ SQLULEN *pirow);
+
+SQLRETURN SQL_API SQLPrimaryKeys(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName);
+
+SQLRETURN SQL_API SQLProcedureColumns(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szProcName,
+ SQLSMALLINT cbProcName,
+ SQLCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLProcedures(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szProcName,
+ SQLSMALLINT cbProcName);
+
+SQLRETURN SQL_API SQLSetPos(
+ SQLHSTMT hstmt,
+ SQLSETPOSIROW irow,
+ SQLUSMALLINT fOption,
+ SQLUSMALLINT fLock);
+
+SQLRETURN SQL_API SQLTablePrivileges(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName);
+
+SQLRETURN SQL_API SQLDrivers(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+ SQLCHAR *szDriverDesc,
+ SQLSMALLINT cbDriverDescMax,
+ SQLSMALLINT *pcbDriverDesc,
+ SQLCHAR *szDriverAttributes,
+ SQLSMALLINT cbDrvrAttrMax,
+ SQLSMALLINT *pcbDrvrAttr);
+
+SQLRETURN SQL_API SQLBindParameter(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT ipar,
+ SQLSMALLINT fParamType,
+ SQLSMALLINT fCType,
+ SQLSMALLINT fSqlType,
+ SQLULEN cbColDef,
+ SQLSMALLINT ibScale,
+ SQLPOINTER rgbValue,
+ SQLLEN cbValueMax,
+ SQLLEN *pcbValue);
+
+/*---------------------------------------------------------*/
+/* SQLAllocHandleStd is implemented to make SQLAllocHandle */
+/* compatible with X/Open standard. an application should */
+/* not call SQLAllocHandleStd directly */
+/*---------------------------------------------------------*/
+#ifdef ODBC_STD
+#define SQLAllocHandle SQLAllocHandleStd
+#define SQLAllocEnv(phenv) SQLAllocHandleStd(SQL_HANDLE_ENV, SQL_NULL_HANDLE, phenv)
+
+/* Internal type subcodes */
+#define SQL_YEAR SQL_CODE_YEAR
+#define SQL_MONTH SQL_CODE_MONTH
+#define SQL_DAY SQL_CODE_DAY
+#define SQL_HOUR SQL_CODE_HOUR
+#define SQL_MINUTE SQL_CODE_MINUTE
+#define SQL_SECOND SQL_CODE_SECOND
+#define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH
+#define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR
+#define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE
+#define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND
+#define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE
+#define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND
+#define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND
+#endif /* ODBC_STD */
+
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLAllocHandleStd(
+ SQLSMALLINT fHandleType,
+ SQLHANDLE hInput,
+ SQLHANDLE *phOutput);
+#endif
+
+/* Deprecated defines from prior versions of ODBC */
+#define SQL_DATABASE_NAME 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */
+#define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR
+#define SQL_FETCH_PREV SQL_FETCH_PRIOR
+#define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER
+#define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER
+#define SQL_CC_DELETE SQL_CB_DELETE
+#define SQL_CR_DELETE SQL_CB_DELETE
+#define SQL_CC_CLOSE SQL_CB_CLOSE
+#define SQL_CR_CLOSE SQL_CB_CLOSE
+#define SQL_CC_PRESERVE SQL_CB_PRESERVE
+#define SQL_CR_PRESERVE SQL_CB_PRESERVE
+/* SQL_FETCH_RESUME is not supported by 2.0+ drivers
+#define SQL_FETCH_RESUME 7
+*/
+#define SQL_SCROLL_FORWARD_ONLY 0L /*-SQL_CURSOR_FORWARD_ONLY */
+#define SQL_SCROLL_KEYSET_DRIVEN (-1L) /*-SQL_CURSOR_KEYSET_DRIVEN */
+#define SQL_SCROLL_DYNAMIC (-2L) /*-SQL_CURSOR_DYNAMIC */
+#define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */
+
+/* Deprecated functions from prior versions of ODBC */
+SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */
+ SQLHSTMT hstmt,
+ SQLUSMALLINT fConcurrency,
+ SQLLEN crowKeyset,
+ SQLUSMALLINT crowRowset);
+
+/*!
+ * \defgroup Tracing.
+ *
+ * unixODBC implements a slight variation of the tracing mechanism used
+ * on MS platforms. The unixODBC method loses the ability to produce trace
+ * output for invalid handles but gains the following;
+ *
+ * - better concurrency
+ * - allows tracing to be turned on/off and configured at finer granularity
+ * - hopefully; better performance
+ *
+ * unixODBC provides a cross-platform helper library called 'trace' and an
+ * example/default trace plugin called 'odbctrac'. Those writing an ODBC
+ * driver can use the 'trace' helper library (a static library). Those wanting
+ * to create custom trace output can implement a different version of the
+ * 'odbctrac' plugin.
+ *
+ * The text file driver (odbctxt) included with unixODBC is an example of a
+ * driver using the 'trace' helper library.
+ *
+ * The 'trace' library and the example plugin 'odbctrac' are designed to be
+ * portable on all platforms where unixODBC is available and on MS platforms.
+ * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly
+ * portable. On MS platforms - this compliments traditional tracing (mostly
+ * just used by the Driver Manager).
+ *
+ * \sa trace
+ * odbctxt
+ * odbctrac
+ */
+/*@{*/
+#define TRACE_VERSION 1000 /*!< Version of trace API */
+#ifdef UNICODE
+RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */
+#else
+RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */
+#endif
+RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */
+SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */
+#ifdef __cplusplus
+DWORD TraceVersion(); /*!< Returns trace API version */
+#else
+DWORD TraceVersion(VOID); /*!< Returns trace API version */
+#endif
+
+/* Functions for Visual Studio Analyzer*/
+/* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */
+#define TRACE_ON 0x00000001L
+#define TRACE_VS_EVENT_ON 0x00000002L
+
+RETCODE TraceVSControl(DWORD);
+
+/* the flags in ODBC_VS_ARGS */
+#define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L /* the argument is unicode */
+#define ODBC_VS_FLAG_UNICODE_COR 0x00000002L /* the correlation is unicode */
+#define ODBC_VS_FLAG_RETCODE 0x00000004L /* RetCode field is set */
+#define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */
+
+typedef struct tagODBC_VS_ARGS {
+#ifdef GUID_DEFINED
+ const GUID *pguidEvent; /* the GUID for event */
+#else
+ const void *pguidEvent; /* the GUID for event */
+#endif
+ DWORD dwFlags; /* flags for the call */
+ union {
+ WCHAR *wszArg;
+ CHAR *szArg;
+ }u1;
+ union {
+ WCHAR *wszCorrelation;
+ CHAR *szCorrelation;
+ }u2;
+ RETCODE RetCode;
+} ODBC_VS_ARGS, *PODBC_VS_ARGS;
+
+VOID FireVSDebugEvent(PODBC_VS_ARGS);
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+/*
+ * connection pooling retry times
+ */
+
+int ODBCSetTryWaitValue ( DWORD dwValue );
+#ifdef __cplusplus
+DWORD ODBCGetTryWaitValue ( );
+#else
+DWORD ODBCGetTryWaitValue ( VOID );
+#endif
+
+#ifndef __SQLUCODE_H
+#include "odbc/sqlucode.h"
+#endif
+
+#endif
--- /dev/null
+/*************************************************************
+ * sqltypes.h
+ *
+ * This is the lowest level include in unixODBC. It defines
+ * the basic types required by unixODBC and is heavily based
+ * upon the MS include of the same name (it has to be for
+ * binary compatability between drivers developed under different
+ * packages).
+ *
+ * You can include this file directly but it is almost always
+ * included indirectly, by including.. for example sqlext.h
+ *
+ * This include makes no effort to be useful on any platforms other
+ * than Linux (with some exceptions for UNIX in general).
+ *
+ * !!!DO NOT CONTAMINATE THIS FILE WITH NON-Linux CODE!!!
+ *
+ *************************************************************/
+#ifndef __SQLTYPES_H
+#define __SQLTYPES_H
+
+/****************************
+ * default to the 3.51 definitions. should define ODBCVER before here if you want an older set of defines
+ ***************************/
+#ifndef ODBCVER
+#define ODBCVER 0x0351
+#endif
+
+/*
+ * if thi sis set, then use a 4 byte unicode definition, insteead of the 2 bye that MS use
+ */
+
+#ifdef SQL_WCHART_CONVERT
+/*
+ * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t
+ * Microsoft hardcoded a definition of unsigned short which may not be compatible with
+ * your platform specific wide char definition.
+ */
+#include <wchar.h>
+#endif
+
+#include <sal/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef SIZEOF_LONG_INT
+# define SIZEOF_LONG_INT SAL_TYPES_SIZEOFLONG
+#endif
+#ifndef ODBCINT64
+# define ODBCINT64 sal_Int64
+#endif
+#ifndef UODBCINT64
+# define UODBCINT64 sal_uInt64
+#endif
+
+/*
+ * this is defined by configure, but will not be on a normal application build
+ * the install creates a unixodbc_conf.h file that contains the current build settings
+ */
+
+#ifndef SIZEOF_LONG_INT
+#include <unixodbc_conf.h>
+#endif
+
+#ifndef SIZEOF_LONG_INT
+#error "Needs to know how big a long int is to continue!!!"
+#endif
+
+/****************************
+ * These make up for having no windows.h
+ ***************************/
+#ifndef ALLREADY_HAVE_WINDOWS_TYPE
+
+#define FAR
+#define CALLBACK
+#define SQL_API
+#define BOOL int
+typedef void* HWND;
+typedef char CHAR;
+#ifdef UNICODE
+
+/*
+ * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and
+ * be able to compile for both unicode and non-unicode with the same source.
+ * This is not recommended for linux applications and is not supported
+ * by the standard linux string header files.
+ */
+#ifdef SQL_WCHART_CONVERT
+typedef wchar_t TCHAR;
+#else
+typedef signed short TCHAR;
+#endif
+
+#else
+typedef char TCHAR;
+#endif
+
+#ifndef DONT_TD_VOID
+typedef void VOID;
+#endif
+
+typedef unsigned short WORD;
+#if (SIZEOF_LONG_INT == 4)
+typedef unsigned long DWORD;
+#else
+typedef unsigned int DWORD;
+#endif
+typedef unsigned char BYTE;
+
+#ifdef SQL_WCHART_CONVERT
+typedef wchar_t WCHAR;
+#else
+typedef unsigned short WCHAR;
+#endif
+
+typedef WCHAR* LPWSTR;
+typedef const char* LPCSTR;
+typedef const WCHAR* LPCWSTR;
+typedef TCHAR* LPTSTR;
+typedef char* LPSTR;
+typedef DWORD* LPDWORD;
+
+typedef void* HINSTANCE;
+
+#endif
+
+
+/****************************
+ * standard SQL* data types. use these as much as possible when using ODBC calls/vars
+ ***************************/
+typedef unsigned char SQLCHAR;
+
+#if (ODBCVER >= 0x0300)
+typedef unsigned char SQLDATE;
+typedef unsigned char SQLDECIMAL;
+typedef double SQLDOUBLE;
+typedef double SQLFLOAT;
+#endif
+
+/*
+ * can't use a long it fails on 64 platforms
+ */
+
+/*
+ * Hopefully by now it should be safe to assume most drivers know about SQLLEN now
+ * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms
+ *
+ */
+
+#if (SIZEOF_LONG_INT == 8)
+#ifdef BUILD_LEGACY_64_BIT_MODE
+typedef int SQLINTEGER;
+typedef unsigned int SQLUINTEGER;
+#define SQLLEN SQLINTEGER
+#define SQLULEN SQLUINTEGER
+#define SQLSETPOSIROW SQLUSMALLINT
+/*
+ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril
+ *
+ typedef SQLULEN SQLROWCOUNT;
+ typedef SQLULEN SQLROWSETSIZE;
+ typedef SQLULEN SQLTRANSID;
+ typedef SQLLEN SQLROWOFFSET;
+*/
+#else
+typedef int SQLINTEGER;
+typedef unsigned int SQLUINTEGER;
+typedef long SQLLEN;
+typedef unsigned long SQLULEN;
+typedef unsigned long SQLSETPOSIROW;
+/*
+ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril
+ *
+ typedef SQLULEN SQLTRANSID;
+ typedef SQLULEN SQLROWCOUNT;
+ typedef SQLUINTEGER SQLROWSETSIZE;
+ typedef SQLLEN SQLROWOFFSET;
+ */
+typedef SQLULEN SQLROWCOUNT;
+typedef SQLULEN SQLROWSETSIZE;
+typedef SQLULEN SQLTRANSID;
+typedef SQLLEN SQLROWOFFSET;
+#endif
+#else
+typedef long SQLINTEGER;
+typedef unsigned long SQLUINTEGER;
+#define SQLLEN SQLINTEGER
+#define SQLULEN SQLUINTEGER
+#define SQLSETPOSIROW SQLUSMALLINT
+typedef SQLULEN SQLROWCOUNT;
+typedef SQLULEN SQLROWSETSIZE;
+typedef SQLULEN SQLTRANSID;
+typedef SQLLEN SQLROWOFFSET;
+#endif
+
+#if (ODBCVER >= 0x0300)
+typedef unsigned char SQLNUMERIC;
+#endif
+
+typedef void * SQLPOINTER;
+
+#if (ODBCVER >= 0x0300)
+typedef float SQLREAL;
+#endif
+
+typedef signed short int SQLSMALLINT;
+typedef unsigned short SQLUSMALLINT;
+
+#if (ODBCVER >= 0x0300)
+typedef unsigned char SQLTIME;
+typedef unsigned char SQLTIMESTAMP;
+typedef unsigned char SQLVARCHAR;
+#endif
+
+typedef SQLSMALLINT SQLRETURN;
+
+#if (ODBCVER >= 0x0300)
+typedef void * SQLHANDLE;
+typedef SQLHANDLE SQLHENV;
+typedef SQLHANDLE SQLHDBC;
+typedef SQLHANDLE SQLHSTMT;
+typedef SQLHANDLE SQLHDESC;
+#else
+typedef void * SQLHENV;
+typedef void * SQLHDBC;
+typedef void * SQLHSTMT;
+/*
+ * some things like PHP won't build without this
+ */
+typedef void * SQLHANDLE;
+#endif
+
+/****************************
+ * These are cast into the actual struct that is being passed around. The
+ * DriverManager knows what its structs look like and the Driver knows about its
+ * structs... the app knows nothing about them... just void*
+ * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT
+ ***************************/
+
+#if (ODBCVER >= 0x0300)
+typedef SQLHANDLE HENV;
+typedef SQLHANDLE HDBC;
+typedef SQLHANDLE HSTMT;
+#else
+typedef void * HENV;
+typedef void * HDBC;
+typedef void * HSTMT;
+#endif
+
+
+/****************************
+ * more basic data types to augment what windows.h provides
+ ***************************/
+#ifndef ALLREADY_HAVE_WINDOWS_TYPE
+
+typedef unsigned char UCHAR;
+typedef signed char SCHAR;
+typedef SCHAR SQLSCHAR;
+#if (SIZEOF_LONG_INT == 4)
+typedef long int SDWORD;
+typedef unsigned long int UDWORD;
+#else
+typedef int SDWORD;
+typedef unsigned int UDWORD;
+#endif
+typedef signed short int SWORD;
+typedef unsigned short int UWORD;
+typedef unsigned int UINT;
+typedef signed long SLONG;
+typedef signed short SSHORT;
+typedef unsigned long ULONG;
+typedef unsigned short USHORT;
+typedef double SDOUBLE;
+typedef double LDOUBLE;
+typedef float SFLOAT;
+typedef void* PTR;
+typedef signed short RETCODE;
+typedef void* SQLHWND;
+
+#endif
+
+/****************************
+ * standard structs for working with date/times
+ ***************************/
+#ifndef __SQLDATE
+#define __SQLDATE
+typedef struct tagDATE_STRUCT
+{
+ SQLSMALLINT year;
+ SQLUSMALLINT month;
+ SQLUSMALLINT day;
+} DATE_STRUCT;
+
+#if (ODBCVER >= 0x0300)
+typedef DATE_STRUCT SQL_DATE_STRUCT;
+#endif
+
+typedef struct tagTIME_STRUCT
+{
+ SQLUSMALLINT hour;
+ SQLUSMALLINT minute;
+ SQLUSMALLINT second;
+} TIME_STRUCT;
+
+#if (ODBCVER >= 0x0300)
+typedef TIME_STRUCT SQL_TIME_STRUCT;
+#endif
+
+typedef struct tagTIMESTAMP_STRUCT
+{
+ SQLSMALLINT year;
+ SQLUSMALLINT month;
+ SQLUSMALLINT day;
+ SQLUSMALLINT hour;
+ SQLUSMALLINT minute;
+ SQLUSMALLINT second;
+ SQLUINTEGER fraction;
+} TIMESTAMP_STRUCT;
+
+#if (ODBCVER >= 0x0300)
+typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT;
+#endif
+
+
+#if (ODBCVER >= 0x0300)
+typedef enum
+{
+ SQL_IS_YEAR = 1,
+ SQL_IS_MONTH = 2,
+ SQL_IS_DAY = 3,
+ SQL_IS_HOUR = 4,
+ SQL_IS_MINUTE = 5,
+ SQL_IS_SECOND = 6,
+ SQL_IS_YEAR_TO_MONTH = 7,
+ SQL_IS_DAY_TO_HOUR = 8,
+ SQL_IS_DAY_TO_MINUTE = 9,
+ SQL_IS_DAY_TO_SECOND = 10,
+ SQL_IS_HOUR_TO_MINUTE = 11,
+ SQL_IS_HOUR_TO_SECOND = 12,
+ SQL_IS_MINUTE_TO_SECOND = 13
+} SQLINTERVAL;
+
+#endif
+
+#if (ODBCVER >= 0x0300)
+typedef struct tagSQL_YEAR_MONTH
+{
+ SQLUINTEGER year;
+ SQLUINTEGER month;
+} SQL_YEAR_MONTH_STRUCT;
+
+typedef struct tagSQL_DAY_SECOND
+{
+ SQLUINTEGER day;
+ SQLUINTEGER hour;
+ SQLUINTEGER minute;
+ SQLUINTEGER second;
+ SQLUINTEGER fraction;
+} SQL_DAY_SECOND_STRUCT;
+
+typedef struct tagSQL_INTERVAL_STRUCT
+{
+ SQLINTERVAL interval_type;
+ SQLSMALLINT interval_sign;
+ union {
+ SQL_YEAR_MONTH_STRUCT year_month;
+ SQL_DAY_SECOND_STRUCT day_second;
+ } intval;
+
+} SQL_INTERVAL_STRUCT;
+
+#endif
+
+#endif
+
+#ifndef ODBCINT64
+# if (ODBCVER >= 0x0300)
+# if (SIZEOF_LONG_INT == 8)
+# define ODBCINT64 long
+# define UODBCINT64 unsigned long
+# else
+# ifdef HAVE_LONG_LONG
+# define ODBCINT64 long long
+# define UODBCINT64 unsigned long long
+# else
+/*
+ * may fail in some cases, but what else can we do ?
+ */
+struct __bigint_struct
+{
+ int hiword;
+ unsigned int loword;
+};
+struct __bigint_struct_u
+{
+ unsigned int hiword;
+ unsigned int loword;
+};
+# define ODBCINT64 struct __bigint_struct
+# define UODBCINT64 struct __bigint_struct_u
+# endif
+# endif
+#endif
+#endif
+
+#ifdef ODBCINT64
+typedef ODBCINT64 SQLBIGINT;
+#endif
+#ifdef UODBCINT64
+typedef UODBCINT64 SQLUBIGINT;
+#endif
+
+
+/****************************
+ * cursor and bookmark
+ ***************************/
+#if (ODBCVER >= 0x0300)
+#define SQL_MAX_NUMERIC_LEN 16
+typedef struct tagSQL_NUMERIC_STRUCT
+{
+ SQLCHAR precision;
+ SQLSCHAR scale;
+ SQLCHAR sign; /* 1=pos 0=neg */
+ SQLCHAR val[SQL_MAX_NUMERIC_LEN];
+} SQL_NUMERIC_STRUCT;
+#endif
+
+#if (ODBCVER >= 0x0350)
+#ifdef GUID_DEFINED
+#ifndef ALLREADY_HAVE_WINDOWS_TYPE
+typedef GUID SQLGUID;
+#else
+typedef struct tagSQLGUID
+{
+ DWORD Data1;
+ WORD Data2;
+ WORD Data3;
+ BYTE Data4[ 8 ];
+} SQLGUID;
+#endif
+#else
+typedef struct tagSQLGUID
+{
+ DWORD Data1;
+ WORD Data2;
+ WORD Data3;
+ BYTE Data4[ 8 ];
+} SQLGUID;
+#endif
+#endif
+
+typedef SQLULEN BOOKMARK;
+
+typedef WCHAR SQLWCHAR;
+
+#ifdef UNICODE
+typedef SQLWCHAR SQLTCHAR;
+#else
+typedef SQLCHAR SQLTCHAR;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
+
--- /dev/null
+/**************************************************
+ * sqlucode.h
+ *
+ * These should be consistent with the MS version.
+ *
+ **************************************************/
+#ifndef __SQLUCODE_H
+#define __SQLUCODE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SQL_WCHAR (-8)
+#define SQL_WVARCHAR (-9)
+#define SQL_WLONGVARCHAR (-10)
+#define SQL_C_WCHAR SQL_WCHAR
+
+#ifdef UNICODE
+#define SQL_C_TCHAR SQL_C_WCHAR
+#else
+#define SQL_C_TCHAR SQL_C_CHAR
+#endif
+
+#define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */
+
+/* UNICODE versions */
+
+SQLRETURN SQL_API SQLColAttributeW(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT iCol,
+ SQLUSMALLINT iField,
+ SQLPOINTER pCharAttr,
+ SQLSMALLINT cbCharAttrMax,
+ SQLSMALLINT *pcbCharAttr,
+ SQLLEN *pNumAttr);
+
+SQLRETURN SQL_API SQLColAttributesW(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT icol,
+ SQLUSMALLINT fDescType,
+ SQLPOINTER rgbDesc,
+ SQLSMALLINT cbDescMax,
+ SQLSMALLINT *pcbDesc,
+ SQLLEN *pfDesc);
+
+SQLRETURN SQL_API SQLConnectW(
+ SQLHDBC hdbc,
+ SQLWCHAR *szDSN,
+ SQLSMALLINT cbDSN,
+ SQLWCHAR *szUID,
+ SQLSMALLINT cbUID,
+ SQLWCHAR *szAuthStr,
+ SQLSMALLINT cbAuthStr);
+
+
+SQLRETURN SQL_API SQLDescribeColW(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT icol,
+ SQLWCHAR *szColName,
+ SQLSMALLINT cbColNameMax,
+ SQLSMALLINT *pcbColName,
+ SQLSMALLINT *pfSqlType,
+ SQLULEN *pcbColDef,
+ SQLSMALLINT *pibScale,
+ SQLSMALLINT *pfNullable);
+
+
+SQLRETURN SQL_API SQLErrorW(
+ SQLHENV henv,
+ SQLHDBC hdbc,
+ SQLHSTMT hstmt,
+ SQLWCHAR *szSqlState,
+ SQLINTEGER *pfNativeError,
+ SQLWCHAR *szErrorMsg,
+ SQLSMALLINT cbErrorMsgMax,
+ SQLSMALLINT *pcbErrorMsg);
+
+SQLRETURN SQL_API SQLExecDirectW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szSqlStr,
+ SQLINTEGER cbSqlStr);
+
+SQLRETURN SQL_API SQLGetConnectAttrW(
+ SQLHDBC hdbc,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax,
+ SQLINTEGER *pcbValue);
+
+SQLRETURN SQL_API SQLGetCursorNameW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCursor,
+ SQLSMALLINT cbCursorMax,
+ SQLSMALLINT *pcbCursor);
+
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLSetDescFieldW(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber,
+ SQLSMALLINT FieldIdentifier,
+ SQLPOINTER Value,
+ SQLINTEGER BufferLength);
+
+
+
+SQLRETURN SQL_API SQLGetDescFieldW(
+ SQLHDESC hdesc,
+ SQLSMALLINT iRecord,
+ SQLSMALLINT iField,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax,
+ SQLINTEGER *pcbValue);
+
+SQLRETURN SQL_API SQLGetDescRecW(
+ SQLHDESC hdesc,
+ SQLSMALLINT iRecord,
+ SQLWCHAR *szName,
+ SQLSMALLINT cbNameMax,
+ SQLSMALLINT *pcbName,
+ SQLSMALLINT *pfType,
+ SQLSMALLINT *pfSubType,
+ SQLLEN *pLength,
+ SQLSMALLINT *pPrecision,
+ SQLSMALLINT *pScale,
+ SQLSMALLINT *pNullable);
+
+SQLRETURN SQL_API SQLGetDiagFieldW(
+ SQLSMALLINT fHandleType,
+ SQLHANDLE handle,
+ SQLSMALLINT iRecord,
+ SQLSMALLINT fDiagField,
+ SQLPOINTER rgbDiagInfo,
+ SQLSMALLINT cbDiagInfoMax,
+ SQLSMALLINT *pcbDiagInfo);
+
+SQLRETURN SQL_API SQLGetDiagRecW(
+ SQLSMALLINT fHandleType,
+ SQLHANDLE handle,
+ SQLSMALLINT iRecord,
+ SQLWCHAR *szSqlState,
+ SQLINTEGER *pfNativeError,
+ SQLWCHAR *szErrorMsg,
+ SQLSMALLINT cbErrorMsgMax,
+ SQLSMALLINT *pcbErrorMsg);
+
+
+#endif
+
+
+SQLRETURN SQL_API SQLPrepareW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szSqlStr,
+ SQLINTEGER cbSqlStr);
+
+SQLRETURN SQL_API SQLSetConnectAttrW(
+ SQLHDBC hdbc,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValue);
+
+SQLRETURN SQL_API SQLSetCursorNameW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCursor,
+ SQLSMALLINT cbCursor);
+
+
+
+
+
+
+
+SQLRETURN SQL_API SQLColumnsW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLGetConnectOptionW(
+ SQLHDBC hdbc,
+ SQLUSMALLINT fOption,
+ SQLPOINTER pvParam);
+
+
+
+SQLRETURN SQL_API SQLGetInfoW(
+ SQLHDBC hdbc,
+ SQLUSMALLINT fInfoType,
+ SQLPOINTER rgbInfoValue,
+ SQLSMALLINT cbInfoValueMax,
+ SQLSMALLINT *pcbInfoValue);
+
+SQLRETURN SQL_API SQLGetTypeInfoW(
+ SQLHSTMT StatementHandle,
+ SQLSMALLINT DataType);
+
+
+SQLRETURN SQL_API SQLSetConnectOptionW(
+ SQLHDBC hdbc,
+ SQLUSMALLINT fOption,
+ SQLULEN vParam);
+
+
+SQLRETURN SQL_API SQLSpecialColumnsW(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT fColType,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLUSMALLINT fScope,
+ SQLUSMALLINT fNullable);
+
+SQLRETURN SQL_API SQLStatisticsW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLUSMALLINT fUnique,
+ SQLUSMALLINT fAccuracy);
+
+SQLRETURN SQL_API SQLTablesW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLWCHAR *szTableType,
+ SQLSMALLINT cbTableType);
+
+
+
+SQLRETURN SQL_API SQLDataSourcesW(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+ SQLWCHAR *szDSN,
+ SQLSMALLINT cbDSNMax,
+ SQLSMALLINT *pcbDSN,
+ SQLWCHAR *szDescription,
+ SQLSMALLINT cbDescriptionMax,
+ SQLSMALLINT *pcbDescription);
+
+
+
+
+SQLRETURN SQL_API SQLDriverConnectW(
+ SQLHDBC hdbc,
+ SQLHWND hwnd,
+ SQLWCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLWCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut,
+ SQLUSMALLINT fDriverCompletion);
+
+
+SQLRETURN SQL_API SQLBrowseConnectW(
+ SQLHDBC hdbc,
+ SQLWCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLWCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut);
+
+SQLRETURN SQL_API SQLColumnPrivilegesW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLGetStmtAttrW(
+ SQLHSTMT hstmt,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax,
+ SQLINTEGER *pcbValue);
+
+SQLRETURN SQL_API SQLSetStmtAttrW(
+ SQLHSTMT hstmt,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax);
+
+SQLRETURN SQL_API SQLForeignKeysW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szPkCatalogName,
+ SQLSMALLINT cbPkCatalogName,
+ SQLWCHAR *szPkSchemaName,
+ SQLSMALLINT cbPkSchemaName,
+ SQLWCHAR *szPkTableName,
+ SQLSMALLINT cbPkTableName,
+ SQLWCHAR *szFkCatalogName,
+ SQLSMALLINT cbFkCatalogName,
+ SQLWCHAR *szFkSchemaName,
+ SQLSMALLINT cbFkSchemaName,
+ SQLWCHAR *szFkTableName,
+ SQLSMALLINT cbFkTableName);
+
+
+SQLRETURN SQL_API SQLNativeSqlW(
+ SQLHDBC hdbc,
+ SQLWCHAR *szSqlStrIn,
+ SQLINTEGER cbSqlStrIn,
+ SQLWCHAR *szSqlStr,
+ SQLINTEGER cbSqlStrMax,
+ SQLINTEGER *pcbSqlStr);
+
+
+SQLRETURN SQL_API SQLPrimaryKeysW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName);
+
+SQLRETURN SQL_API SQLProcedureColumnsW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szProcName,
+ SQLSMALLINT cbProcName,
+ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLProceduresW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szProcName,
+ SQLSMALLINT cbProcName);
+
+
+SQLRETURN SQL_API SQLTablePrivilegesW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName);
+
+SQLRETURN SQL_API SQLDriversW(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+ SQLWCHAR *szDriverDesc,
+ SQLSMALLINT cbDriverDescMax,
+ SQLSMALLINT *pcbDriverDesc,
+ SQLWCHAR *szDriverAttributes,
+ SQLSMALLINT cbDrvrAttrMax,
+ SQLSMALLINT *pcbDrvrAttr);
+
+
+/* ANSI versions */
+
+SQLRETURN SQL_API SQLColAttributeA(
+ SQLHSTMT hstmt,
+ SQLSMALLINT iCol,
+ SQLSMALLINT iField,
+ SQLPOINTER pCharAttr,
+ SQLSMALLINT cbCharAttrMax,
+ SQLSMALLINT *pcbCharAttr,
+ SQLLEN *pNumAttr);
+
+SQLRETURN SQL_API SQLColAttributesA(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT icol,
+ SQLUSMALLINT fDescType,
+ SQLPOINTER rgbDesc,
+ SQLSMALLINT cbDescMax,
+ SQLSMALLINT *pcbDesc,
+ SQLLEN *pfDesc);
+
+SQLRETURN SQL_API SQLConnectA(
+ SQLHDBC hdbc,
+ SQLCHAR *szDSN,
+ SQLSMALLINT cbDSN,
+ SQLCHAR *szUID,
+ SQLSMALLINT cbUID,
+ SQLCHAR *szAuthStr,
+ SQLSMALLINT cbAuthStr);
+
+
+SQLRETURN SQL_API SQLDescribeColA(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT icol,
+ SQLCHAR *szColName,
+ SQLSMALLINT cbColNameMax,
+ SQLSMALLINT *pcbColName,
+ SQLSMALLINT *pfSqlType,
+ SQLULEN *pcbColDef,
+ SQLSMALLINT *pibScale,
+ SQLSMALLINT *pfNullable);
+
+
+SQLRETURN SQL_API SQLErrorA(
+ SQLHENV henv,
+ SQLHDBC hdbc,
+ SQLHSTMT hstmt,
+ SQLCHAR *szSqlState,
+ SQLINTEGER *pfNativeError,
+ SQLCHAR *szErrorMsg,
+ SQLSMALLINT cbErrorMsgMax,
+ SQLSMALLINT *pcbErrorMsg);
+
+SQLRETURN SQL_API SQLExecDirectA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szSqlStr,
+ SQLINTEGER cbSqlStr);
+
+SQLRETURN SQL_API SQLGetConnectAttrA(
+ SQLHDBC hdbc,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax,
+ SQLINTEGER *pcbValue);
+
+SQLRETURN SQL_API SQLGetCursorNameA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCursor,
+ SQLSMALLINT cbCursorMax,
+ SQLSMALLINT *pcbCursor);
+
+#if (ODBCVER >= 0x0300)
+SQLRETURN SQL_API SQLGetDescFieldA(
+ SQLHDESC hdesc,
+ SQLSMALLINT iRecord,
+ SQLSMALLINT iField,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax,
+ SQLINTEGER *pcbValue);
+
+SQLRETURN SQL_API SQLGetDescRecA(
+ SQLHDESC hdesc,
+ SQLSMALLINT iRecord,
+ SQLCHAR *szName,
+ SQLSMALLINT cbNameMax,
+ SQLSMALLINT *pcbName,
+ SQLSMALLINT *pfType,
+ SQLSMALLINT *pfSubType,
+ SQLLEN *pLength,
+ SQLSMALLINT *pPrecision,
+ SQLSMALLINT *pScale,
+ SQLSMALLINT *pNullable);
+
+SQLRETURN SQL_API SQLGetDiagFieldA(
+ SQLSMALLINT fHandleType,
+ SQLHANDLE handle,
+ SQLSMALLINT iRecord,
+ SQLSMALLINT fDiagField,
+ SQLPOINTER rgbDiagInfo,
+ SQLSMALLINT cbDiagInfoMax,
+ SQLSMALLINT *pcbDiagInfo);
+
+SQLRETURN SQL_API SQLGetDiagRecA(
+ SQLSMALLINT fHandleType,
+ SQLHANDLE handle,
+ SQLSMALLINT iRecord,
+ SQLCHAR *szSqlState,
+ SQLINTEGER *pfNativeError,
+ SQLCHAR *szErrorMsg,
+ SQLSMALLINT cbErrorMsgMax,
+ SQLSMALLINT *pcbErrorMsg);
+
+
+SQLRETURN SQL_API SQLGetStmtAttrA(
+ SQLHSTMT hstmt,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValueMax,
+ SQLINTEGER *pcbValue);
+
+#endif
+
+SQLRETURN SQL_API SQLGetTypeInfoA(
+ SQLHSTMT StatementHandle,
+ SQLSMALLINT DataTyoe);
+
+SQLRETURN SQL_API SQLPrepareA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szSqlStr,
+ SQLINTEGER cbSqlStr);
+
+SQLRETURN SQL_API SQLSetConnectAttrA(
+ SQLHDBC hdbc,
+ SQLINTEGER fAttribute,
+ SQLPOINTER rgbValue,
+ SQLINTEGER cbValue);
+
+SQLRETURN SQL_API SQLSetCursorNameA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCursor,
+ SQLSMALLINT cbCursor);
+
+
+
+
+
+
+
+SQLRETURN SQL_API SQLColumnsA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLGetConnectOptionA(
+ SQLHDBC hdbc,
+ SQLUSMALLINT fOption,
+ SQLPOINTER pvParam);
+
+
+
+SQLRETURN SQL_API SQLGetInfoA(
+ SQLHDBC hdbc,
+ SQLUSMALLINT fInfoType,
+ SQLPOINTER rgbInfoValue,
+ SQLSMALLINT cbInfoValueMax,
+ SQLSMALLINT* pcbInfoValue);
+
+SQLRETURN SQL_API SQLGetStmtOptionA(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT fOption,
+ SQLPOINTER pvParam);
+
+SQLRETURN SQL_API SQLSetConnectOptionA(
+ SQLHDBC hdbc,
+ SQLUSMALLINT fOption,
+ SQLULEN vParam);
+
+SQLRETURN SQL_API SQLSetStmtOptionA(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT fOption,
+ SQLULEN vParam);
+
+SQLRETURN SQL_API SQLSpecialColumnsA(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT fColType,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLUSMALLINT fScope,
+ SQLUSMALLINT fNullable);
+
+SQLRETURN SQL_API SQLStatisticsA(
+ SQLHSTMT hstmt,
+
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLUSMALLINT fUnique,
+ SQLUSMALLINT fAccuracy);
+
+SQLRETURN SQL_API SQLTablesA(
+ SQLHSTMT hstmt,
+
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLCHAR *szTableType,
+
+ SQLSMALLINT cbTableType);
+
+
+
+SQLRETURN SQL_API SQLDataSourcesA(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+ SQLCHAR *szDSN,
+ SQLSMALLINT cbDSNMax,
+ SQLSMALLINT *pcbDSN,
+ SQLCHAR *szDescription,
+ SQLSMALLINT cbDescriptionMax,
+ SQLSMALLINT *pcbDescription);
+
+
+
+
+SQLRETURN SQL_API SQLDriverConnectA(
+ SQLHDBC hdbc,
+ SQLHWND hwnd,
+ SQLCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut,
+ SQLUSMALLINT fDriverCompletion);
+
+
+SQLRETURN SQL_API SQLBrowseConnectA(
+ SQLHDBC hdbc,
+ SQLCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut);
+
+SQLRETURN SQL_API SQLColumnPrivilegesA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLDescribeParamA(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT ipar,
+ SQLSMALLINT *pfSqlType,
+ SQLUINTEGER *pcbParamDef,
+ SQLSMALLINT *pibScale,
+ SQLSMALLINT *pfNullable);
+
+
+SQLRETURN SQL_API SQLForeignKeysA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szPkCatalogName,
+ SQLSMALLINT cbPkCatalogName,
+ SQLCHAR *szPkSchemaName,
+ SQLSMALLINT cbPkSchemaName,
+ SQLCHAR *szPkTableName,
+ SQLSMALLINT cbPkTableName,
+ SQLCHAR *szFkCatalogName,
+ SQLSMALLINT cbFkCatalogName,
+ SQLCHAR *szFkSchemaName,
+ SQLSMALLINT cbFkSchemaName,
+ SQLCHAR *szFkTableName,
+ SQLSMALLINT cbFkTableName);
+
+
+SQLRETURN SQL_API SQLNativeSqlA(
+ SQLHDBC hdbc,
+ SQLCHAR *szSqlStrIn,
+ SQLINTEGER cbSqlStrIn,
+ SQLCHAR *szSqlStr,
+ SQLINTEGER cbSqlStrMax,
+ SQLINTEGER *pcbSqlStr);
+
+
+SQLRETURN SQL_API SQLPrimaryKeysA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName);
+
+SQLRETURN SQL_API SQLProcedureColumnsA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szProcName,
+ SQLSMALLINT cbProcName,
+ SQLCHAR *szColumnName,
+ SQLSMALLINT cbColumnName);
+
+SQLRETURN SQL_API SQLProceduresA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szProcName,
+ SQLSMALLINT cbProcName);
+
+
+SQLRETURN SQL_API SQLTablePrivilegesA(
+ SQLHSTMT hstmt,
+ SQLCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLCHAR *szTableName,
+ SQLSMALLINT cbTableName);
+
+SQLRETURN SQL_API SQLDriversA(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+ SQLCHAR *szDriverDesc,
+ SQLSMALLINT cbDriverDescMax,
+ SQLSMALLINT *pcbDriverDesc,
+ SQLCHAR *szDriverAttributes,
+ SQLSMALLINT cbDrvrAttrMax,
+ SQLSMALLINT *pcbDrvrAttr);
+
+
+
+
+
+/*---------------------------------------------*/
+/* Mapping macros for Unicode */
+/*---------------------------------------------*/
+
+#ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */
+#ifdef UNICODE
+
+#define SQLColAttribute SQLColAttributeW
+#define SQLColAttributes SQLColAttributesW
+#define SQLConnect SQLConnectW
+#define SQLDescribeCol SQLDescribeColW
+#define SQLError SQLErrorW
+#define SQLExecDirect SQLExecDirectW
+#define SQLGetConnectAttr SQLGetConnectAttrW
+#define SQLGetCursorName SQLGetCursorNameW
+#define SQLGetDescField SQLGetDescFieldW
+#define SQLGetDescRec SQLGetDescRecW
+#define SQLGetDiagField SQLGetDiagFieldW
+#define SQLGetDiagRec SQLGetDiagRecW
+#define SQLPrepare SQLPrepareW
+#define SQLSetConnectAttr SQLSetConnectAttrW
+#define SQLSetCursorName SQLSetCursorNameW
+#define SQLSetDescField SQLSetDescFieldW
+#define SQLSetStmtAttr SQLSetStmtAttrW
+#define SQLGetStmtAttr SQLGetStmtAttrW
+#define SQLColumns SQLColumnsW
+#define SQLGetConnectOption SQLGetConnectOptionW
+#define SQLGetInfo SQLGetInfoW
+#define SQLGetTypeInfo SQLGetTypeInfoW
+#define SQLSetConnectOption SQLSetConnectOptionW
+#define SQLSpecialColumns SQLSpecialColumnsW
+#define SQLStatistics SQLStatisticsW
+#define SQLTables SQLTablesW
+#define SQLDataSources SQLDataSourcesW
+#define SQLDriverConnect SQLDriverConnectW
+#define SQLBrowseConnect SQLBrowseConnectW
+#define SQLColumnPrivileges SQLColumnPrivilegesW
+#define SQLForeignKeys SQLForeignKeysW
+#define SQLNativeSql SQLNativeSqlW
+#define SQLPrimaryKeys SQLPrimaryKeysW
+#define SQLProcedureColumns SQLProcedureColumnsW
+#define SQLProcedures SQLProceduresW
+#define SQLTablePrivileges SQLTablePrivilegesW
+#define SQLDrivers SQLDriversW
+
+#endif /* UNICODE */
+#endif /* SQL_NOUNICODEMAP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef __SQLEXT_H
+#include <odbx/sqlext.h>
+
+#endif
+
+
+#endif
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,vigra))
+
+ifeq ($(SYSTEM_VIGRA),)
+
+$(eval $(call gb_Module_add_targets,vigra,\
+ UnpackedTarball_vigra \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Computer vision library in C++ from [http://hci.iwr.uni-heidelberg.de/vigra/].
+
+Used only by basebmp.
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,vigra))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,vigra,$(VIGRA_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,vigra,\
+ external/vigra/vigra1.6.0.patch \
+ $(if $(filter GCC,$(COM)), \
+ external/vigra/vigra1.6.0-unused-parameters.patch) \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+--- misc/vigra1.6.0/include/vigra/basicimage.hxx 2012-01-19 22:49:11.232074631 +0100
++++ misc/build/vigra1.6.0/include/vigra/basicimage.hxx 2012-01-19 22:48:12.997439136 +0100
+@@ -72,7 +72,7 @@
+ difference_type offset_;
+ };
+
+- static void initialize(BaseType &) {}
++ static void initialize(__attribute__ ((unused)) BaseType &) {}
+
+ static reference dereference(BaseType const & d)
+ { return const_cast<reference>(*(*d.line_start_ + d.offset_)); }
+--- misc/vigra1.6.0/include/vigra/diff2d.hxx 2012-01-19 22:49:11.280074335 +0100
++++ misc/build/vigra1.6.0/include/vigra/diff2d.hxx 2012-01-19 22:49:00.129144170 +0100
+@@ -60,7 +60,7 @@
+ typedef Diff const * pointer;
+ typedef std::random_access_iterator_tag iterator_category;
+
+- static void initialize(BaseType &) {}
++ static void initialize(__attribute__ ((unused)) BaseType &) {}
+
+ static reference dereference(BaseType const & d)
+ { return d; }
+@@ -102,7 +102,7 @@
+ typedef Diff const * pointer;
+ typedef std::random_access_iterator_tag iterator_category;
+
+- static void initialize(BaseType & /*d*/) {}
++ static void initialize(__attribute__ ((unused)) BaseType & /*d*/) {}
+
+ static reference dereference(BaseType const & d)
+ { return d; }
+--- misc/vigra1.6.0/include/vigra/rgbvalue.hxx
++++ misc/build/vigra1.6.0/include/vigra/rgbvalue.hxx
+@@ -184,7 +184,7 @@
+ /** Construct from another sequence (must have length 3!)
+ */
+ template <class Iterator>
+- RGBValue(Iterator i, Iterator end)
++ RGBValue(Iterator i, __attribute__ ((unused)) Iterator)
+ : Base(i[0], i[1], i[2])
+ {
+ VIGRA_STATIC_ASSERT((RGBValue_bad_color_indices<RED_IDX, GREEN_IDX, BLUE_IDX>));
--- /dev/null
+diff -uprN misc/vigra1.6.0/configure misc/build/vigra1.6.0/configure
+--- misc/vigra1.6.0/configure 2008-08-13 08:15:32.000000000 -0500
++++ misc/build/vigra1.6.0/configure 2012-09-19 17:30:24.000000000 -0500
+@@ -7843,7 +7843,7 @@ kfreebsd*-gnu)
+ ;;
+
+ freebsd*)
+- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+@@ -11504,7 +11504,7 @@ kfreebsd*-gnu)
+ ;;
+
+ freebsd*)
+- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+@@ -14616,7 +14616,7 @@ kfreebsd*-gnu)
+ ;;
+
+ freebsd*)
+- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+@@ -16958,7 +16958,7 @@ kfreebsd*-gnu)
+ ;;
+
+ freebsd*)
+- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+diff -uprN misc/vigra1.6.0/include/vigra/array_vector.hxx misc/build/vigra1.6.0/include/vigra/array_vector.hxx
+--- misc/vigra1.6.0/include/vigra/array_vector.hxx 2008-08-13 08:15:34.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/array_vector.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -578,7 +578,38 @@ public:
+ iterator insert(iterator p, size_type n, value_type const & v);
+
+ template <class InputIterator>
+- iterator insert(iterator p, InputIterator i, InputIterator iend);
++ iterator insert(iterator p, InputIterator i, InputIterator iend)
++ {
++ difference_type n = iend - i;
++ difference_type pos = p - begin();
++ size_type new_size = size() + n;
++ if(new_size >= capacity_)
++ {
++ pointer new_data = reserve_raw(new_size);
++ std::uninitialized_copy(begin(), p, new_data);
++ std::uninitialized_copy(i, iend, new_data + pos);
++ std::uninitialized_copy(p, end(), new_data + pos + n);
++ deallocate(data_, size_);
++ capacity_ = new_size;
++ data_ = new_data;
++ }
++ else if(pos + n >= size_)
++ {
++ size_type diff = pos + n - size_;
++ std::uninitialized_copy(p, end(), end() + diff);
++ std::uninitialized_copy(iend - diff, iend, end());
++ std::copy(i, iend - diff, p);
++ }
++ else
++ {
++ size_type diff = size_ - (pos + n);
++ std::uninitialized_copy(end() - n, end(), end());
++ std::copy_backward(p, p + diff, end());
++ std::copy(i, iend, p);
++ }
++ size_ = new_size;
++ return begin() + pos;
++ }
+
+ iterator erase(iterator p);
+
+diff -uprN misc/vigra1.6.0/include/vigra/basicimage.hxx misc/build/vigra1.6.0/include/vigra/basicimage.hxx
+--- misc/vigra1.6.0/include/vigra/basicimage.hxx 2008-08-13 08:15:34.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/basicimage.hxx 2012-09-19 17:46:22.000000000 -0500
+@@ -572,7 +572,11 @@ class BasicImage
+ typedef Alloc allocator_type;
+
+ typedef Alloc Allocator;
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ typedef typename Alloc::template rebind<PIXELTYPE *>::other LineAllocator;
++#else
++ typedef std::allocator<PIXELTYPE*> LineAllocator;
++#endif
+
+ /** construct image of size 0x0
+ */
+@@ -589,39 +593,51 @@ class BasicImage
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
++#else
++ pallocator_()
++#endif
+ {}
+
+ /** construct image of size width x height, use the specified allocator.
+ */
+- BasicImage(int width, int height, Alloc const & alloc = Alloc())
++ BasicImage(int w, int h, Alloc const & alloc = Alloc())
+ : data_(0),
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
++#else
++ pallocator_()
++#endif
+ {
+- vigra_precondition((width >= 0) && (height >= 0),
+- "BasicImage::BasicImage(int width, int height): "
++ vigra_precondition((w >= 0) && (h >= 0),
++ "BasicImage::BasicImage(int w, int h): "
+ "width and height must be >= 0.\n");
+
+- resize(width, height, value_type());
++ resize(w, h, value_type());
+ }
+
+ /** construct image of size size.x x size.y, use the specified allocator.
+ */
+- explicit BasicImage(difference_type const & size, Alloc const & alloc = Alloc())
++ explicit BasicImage(difference_type const & sz, Alloc const & alloc = Alloc())
+ : data_(0),
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
+- {
+- vigra_precondition((size.x >= 0) && (size.y >= 0),
+- "BasicImage::BasicImage(Diff2D size): "
+- "size.x and size.y must be >= 0.\n");
++#else
++ pallocator_()
++#endif
++ {
++ vigra_precondition((sz.x >= 0) && (sz.y >= 0),
++ "BasicImage::BasicImage(Diff2D sz): "
++ "sz.x and sz.y must be >= 0.\n");
+
+- resize(size.x, size.y, value_type());
++ resize(sz.x, sz.y, value_type());
+ }
+
+ /** construct image of size width*height and initialize every
+@@ -629,71 +645,87 @@ class BasicImage
+ value_type doesn't have a default constructor).
+ Use the specified allocator.
+ */
+- BasicImage(int width, int height, value_type const & d, Alloc const & alloc = Alloc())
++ BasicImage(int w, int h, value_type const & d, Alloc const & alloc = Alloc())
+ : data_(0),
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
++#else
++ pallocator_()
++#endif
+ {
+- vigra_precondition((width >= 0) && (height >= 0),
+- "BasicImage::BasicImage(int width, int height, value_type const & ): "
++ vigra_precondition((w >= 0) && (h >= 0),
++ "BasicImage::BasicImage(int w, int h, value_type const & ): "
+ "width and height must be >= 0.\n");
+
+- resize(width, height, d);
++ resize(w, h, d);
+ }
+
+ /** construct image of size size.x x size.y and initialize
+ every pixel with given data (use this constructor, if
+ value_type doesn't have a default constructor). Use the specified allocator.
+ */
+- explicit BasicImage(difference_type const & size, value_type const & d, Alloc const & alloc = Alloc())
++ explicit BasicImage(difference_type const & sz, value_type const & d, Alloc const & alloc = Alloc())
+ : data_(0),
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
+- {
+- vigra_precondition((size.x >= 0) && (size.y >= 0),
+- "BasicImage::BasicImage(Diff2D const & size, value_type const & v): "
+- "size.x and size.y must be >= 0.\n");
++#else
++ pallocator_()
++#endif
++ {
++ vigra_precondition((sz.x >= 0) && (sz.y >= 0),
++ "BasicImage::BasicImage(Diff2D const & sz, value_type const & v): "
++ "sz.x and sz.y must be >= 0.\n");
+
+- resize(size.x, size.y, d);
++ resize(sz.x, sz.y, d);
+ }
+
+
+ /** construct image of size width*height and copy the data from the
+ given C-style array \a d. Use the specified allocator.
+ */
+- BasicImage(int width, int height, const_pointer d, Alloc const & alloc = Alloc())
++ BasicImage(int w, int h, const_pointer d, Alloc const & alloc = Alloc())
+ : data_(0),
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
++#else
++ pallocator_()
++#endif
+ {
+- vigra_precondition((width >= 0) && (height >= 0),
+- "BasicImage::BasicImage(int width, int height, const_pointer ): "
++ vigra_precondition((w >= 0) && (h >= 0),
++ "BasicImage::BasicImage(int w, int h, const_pointer ): "
+ "width and height must be >= 0.\n");
+
+- resizeCopy(width, height, d);
++ resizeCopy(w, h, d);
+ }
+
+ /** construct image of size size.x x size.y and copy the data from the
+ given C-style array. Use the specified allocator.
+ */
+- explicit BasicImage(difference_type const & size, const_pointer d, Alloc const & alloc = Alloc())
++ explicit BasicImage(difference_type const & sz, const_pointer d, Alloc const & alloc = Alloc())
+ : data_(0),
+ width_(0),
+ height_(0),
+ allocator_(alloc),
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ pallocator_(alloc)
+- {
+- vigra_precondition((size.x >= 0) && (size.y >= 0),
+- "BasicImage::BasicImage(Diff2D const & size, const_pointer): "
+- "size.x and size.y must be >= 0.\n");
++#else
++ pallocator_()
++#endif
++ {
++ vigra_precondition((sz.x >= 0) && (sz.y >= 0),
++ "BasicImage::BasicImage(Diff2D const & sz, const_pointer): "
++ "sz.x and sz.y must be >= 0.\n");
+
+- resizeCopy(size.x, size.y, d);
++ resizeCopy(sz.x, sz.y, d);
+ }
+
+ /** copy rhs image
+@@ -730,20 +762,20 @@ class BasicImage
+ /** reset image to specified size (dimensions must not be negative)
+ (old data are kept if new size matches old size)
+ */
+- void resize(int width, int height)
++ void resize(int w, int h)
+ {
+- if(width != width_ || height != height_)
+- resize(width, height, value_type());
++ if(w != width_ || h != height_)
++ resize(w, h, value_type());
+ }
+
+ /** reset image to specified size (dimensions must not be negative)
+ (old data are kept if new size matches old size)
+ */
+- void resize(difference_type const & size)
++ void resize(difference_type const & sz)
+ {
+- if(size.x != width_ || size.y != height_)
++ if(sz.x != width_ || sz.y != height_)
+ {
+- resize(size.x, size.y, value_type());
++ resize(sz.x, sz.y, value_type());
+ }
+ }
+
+@@ -752,12 +784,12 @@ class BasicImage
+ constructor, dimensions must not be negative,
+ old data are kept if new size matches old size)
+ */
+- void resize(int width, int height, value_type const & d);
++ void resize(int w, int h, value_type const & d);
+
+ /** resize image to given size and initialize by copying data
+ from the C-style arra \a data.
+ */
+- void resizeCopy(int width, int height, const_pointer data);
++ void resizeCopy(int w, int h, const_pointer data);
+
+ /** resize image to size of other image and copy it's data
+ */
+@@ -1066,30 +1098,30 @@ BasicImage<PIXELTYPE, Alloc>::init(value
+
+ template <class PIXELTYPE, class Alloc>
+ void
+-BasicImage<PIXELTYPE, Alloc>::resize(int width, int height, value_type const & d)
++BasicImage<PIXELTYPE, Alloc>::resize(int w, int h, value_type const & d)
+ {
+- vigra_precondition((width >= 0) && (height >= 0),
+- "BasicImage::resize(int width, int height, value_type const &): "
++ vigra_precondition((w >= 0) && (h >= 0),
++ "BasicImage::resize(int w, int h, value_type const &): "
+ "width and height must be >= 0.\n");
+
+- if (width_ != width || height_ != height) // change size?
++ if (width_ != w || height_ != h) // change size?
+ {
+ value_type * newdata = 0;
+ value_type ** newlines = 0;
+- if(width*height > 0)
++ if(w*h > 0)
+ {
+- if (width*height != width_*height_) // different sizes, must reallocate
++ if (w*h != width_*height_) // different sizes, must reallocate
+ {
+- newdata = allocator_.allocate(typename Alloc::size_type(width*height));
+- std::uninitialized_fill_n(newdata, width*height, d);
+- newlines = initLineStartArray(newdata, width, height);
++ newdata = allocator_.allocate(typename Alloc::size_type(w*h));
++ std::uninitialized_fill_n(newdata, w*h, d);
++ newlines = initLineStartArray(newdata, w, h);
+ deallocate();
+ }
+ else // need only to reshape
+ {
+ newdata = data_;
+- std::fill_n(newdata, width*height, d);
+- newlines = initLineStartArray(newdata, width, height);
++ std::fill_n(newdata, w*h, d);
++ newlines = initLineStartArray(newdata, w, h);
+ pallocator_.deallocate(lines_, typename Alloc::size_type(height_));
+ }
+ }
+@@ -1100,22 +1132,22 @@ BasicImage<PIXELTYPE, Alloc>::resize(int
+
+ data_ = newdata;
+ lines_ = newlines;
+- width_ = width;
+- height_ = height;
++ width_ = w;
++ height_ = h;
+ }
+- else if(width*height > 0) // keep size, re-init data
++ else if(w*h > 0) // keep size, re-init data
+ {
+- std::fill_n(data_, width*height, d);
++ std::fill_n(data_, w*h, d);
+ }
+ }
+
+
+ template <class PIXELTYPE, class Alloc>
+ void
+-BasicImage<PIXELTYPE, Alloc>::resizeCopy(int width, int height, const_pointer data)
++BasicImage<PIXELTYPE, Alloc>::resizeCopy(int w, int h, const_pointer src_data)
+ {
+- int newsize = width*height;
+- if (width_ != width || height_ != height) // change size?
++ int newsize = w*h;
++ if (width_ != w || height_ != h) // change size?
+ {
+ value_type * newdata = 0;
+ value_type ** newlines = 0;
+@@ -1124,15 +1156,15 @@ BasicImage<PIXELTYPE, Alloc>::resizeCopy
+ if (newsize != width_*height_) // different sizes, must reallocate
+ {
+ newdata = allocator_.allocate(typename Alloc::size_type(newsize));
+- std::uninitialized_copy(data, data + newsize, newdata);
+- newlines = initLineStartArray(newdata, width, height);
++ std::uninitialized_copy(src_data, src_data + newsize, newdata);
++ newlines = initLineStartArray(newdata, w, h);
+ deallocate();
+ }
+ else // need only to reshape
+ {
+ newdata = data_;
+- std::copy(data, data + newsize, newdata);
+- newlines = initLineStartArray(newdata, width, height);
++ std::copy(src_data, src_data + newsize, newdata);
++ newlines = initLineStartArray(newdata, w, h);
+ pallocator_.deallocate(lines_, typename Alloc::size_type(height_));
+ }
+ }
+@@ -1143,12 +1175,12 @@ BasicImage<PIXELTYPE, Alloc>::resizeCopy
+
+ data_ = newdata;
+ lines_ = newlines;
+- width_ = width;
+- height_ = height;
++ width_ = w;
++ height_ = h;
+ }
+ else if(newsize > 0) // keep size, copy data
+ {
+- std::copy(data, data + newsize, data_);
++ std::copy(src_data, src_data + newsize, data_);
+ }
+ }
+
+@@ -1183,11 +1215,11 @@ BasicImage<PIXELTYPE, Alloc>::deallocate
+
+ template <class PIXELTYPE, class Alloc>
+ PIXELTYPE **
+-BasicImage<PIXELTYPE, Alloc>::initLineStartArray(value_type * data, int width, int height)
++BasicImage<PIXELTYPE, Alloc>::initLineStartArray(value_type * src_data, int w, int h)
+ {
+- value_type ** lines = pallocator_.allocate(typename Alloc::size_type(height));
+- for(int y=0; y<height; ++y)
+- lines[y] = data + y*width;
++ value_type ** lines = pallocator_.allocate(typename Alloc::size_type(h));
++ for(int y=0; y<h; ++y)
++ lines[y] = src_data + y*w;
+ return lines;
+ }
+
+diff -uprN misc/vigra1.6.0/include/vigra/basicimageview.hxx misc/build/vigra1.6.0/include/vigra/basicimageview.hxx
+--- misc/vigra1.6.0/include/vigra/basicimageview.hxx 2008-08-13 08:15:34.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/basicimageview.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -176,20 +176,20 @@ class BasicImageView
+
+ /** construct view of size w x h
+ */
+- BasicImageView(const_pointer data, int w, int h, int stride = 0)
+- : data_(const_cast<pointer>(data)),
++ BasicImageView(const_pointer src_data, int w, int h, int data_stride = 0)
++ : data_(const_cast<pointer>(src_data)),
+ width_(w),
+ height_(h),
+- stride_(stride == 0 ? w : stride)
++ stride_(data_stride == 0 ? w : data_stride)
+ {}
+
+ /** construct view of size size.x x size.y
+ */
+- BasicImageView(const_pointer data, difference_type const & size, int stride = 0)
+- : data_(const_cast<pointer>(data)),
+- width_(size.x),
+- height_(size.y),
+- stride_(stride == 0 ? size.x : stride)
++ BasicImageView(const_pointer src_data, difference_type const & sz, int data_stride = 0)
++ : data_(const_cast<pointer>(src_data)),
++ width_(sz.x),
++ height_(sz.y),
++ stride_(data_stride == 0 ? sz.x : data_stride)
+ {}
+
+ /** set Image with const value
+diff -uprN misc/vigra1.6.0/include/vigra/boundarytensor.hxx misc/build/vigra1.6.0/include/vigra/boundarytensor.hxx
+--- misc/vigra1.6.0/include/vigra/boundarytensor.hxx 2008-08-13 08:15:34.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/boundarytensor.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -71,8 +71,8 @@ initGaussianPolarFilters1(double std_dev
+ int radius = (int)(4.0*std_dev + 0.5);
+ std_dev *= 1.08179074376;
+ double f = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / std_dev; // norm
+- double a = 0.558868151788 / VIGRA_CSTD::pow(std_dev, 5);
+- double b = -2.04251639729 / VIGRA_CSTD::pow(std_dev, 3);
++ double a = 0.558868151788 / VIGRA_CSTD::pow(std_dev, 5.0);
++ double b = -2.04251639729 / VIGRA_CSTD::pow(std_dev, 3.0);
+ double sigma22 = -0.5 / std_dev / std_dev;
+
+
+@@ -175,7 +175,7 @@ initGaussianPolarFilters3(double std_dev
+ std_dev *= 1.15470053838;
+ double sigma22 = -0.5 / std_dev / std_dev;
+ double f = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / std_dev; // norm
+- double a = 0.883887052922 / VIGRA_CSTD::pow(std_dev, 5);
++ double a = 0.883887052922 / VIGRA_CSTD::pow(std_dev, 5.0);
+
+ for(unsigned int i=0; i<k.size(); ++i)
+ {
+diff -uprN misc/vigra1.6.0/include/vigra/config.hxx misc/build/vigra1.6.0/include/vigra/config.hxx
+--- misc/vigra1.6.0/include/vigra/config.hxx 2008-08-13 08:15:35.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/config.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -84,6 +84,12 @@
+ #endif // VIGRA_NO_STD_MINMAX
+ #endif // (_MSC_VER < 1300)
+
++ #if _MSC_VER <= 1310
++ #ifndef CMATH_NOT_IN_STD
++ #define CMATH_NOT_IN_STD
++ #endif
++ #endif // _MSC_VER < 1310
++
+ #if _MSC_VER < 1310
+ #define NO_PARTIAL_TEMPLATE_SPECIALIZATION
+ #define NO_OUT_OF_LINE_MEMBER_TEMPLATES
+diff -uprN misc/vigra1.6.0/include/vigra/diff2d.hxx misc/build/vigra1.6.0/include/vigra/diff2d.hxx
+--- misc/vigra1.6.0/include/vigra/diff2d.hxx 2008-08-13 08:15:35.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/diff2d.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -490,8 +490,8 @@ public:
+
+ /** Construct point at given position.
+ */
+- Size2D(int width, int height)
+- : Diff2D(width, height)
++ Size2D(int w, int h)
++ : Diff2D(w, h)
+ {}
+
+ /** Copy Constructor.
+@@ -620,8 +620,8 @@ public:
+
+ /** Construct point at given position.
+ */
+- Point2D(int x, int y)
+- : Diff2D(x, y)
++ Point2D(int x_, int y_)
++ : Diff2D(x_, y_)
+ {}
+
+ /** Copy Constructor.
+@@ -884,26 +884,26 @@ public:
+ * (lowerRight is considered to be outside the rectangle as
+ * usual in the VIGRA)
+ */
+- Rect2D(Point2D const &upperLeft, Point2D const &lowerRight)
+- : upperLeft_(upperLeft), lowerRight_(lowerRight)
++ Rect2D(Point2D const &ul, Point2D const &lr)
++ : upperLeft_(ul), lowerRight_(lr)
+ {}
+
+ /** Construct a rectangle representing the given range
+ */
+- Rect2D(int left, int top, int right, int bottom)
+- : upperLeft_(left, top), lowerRight_(right, bottom)
++ Rect2D(int l, int t, int r, int b)
++ : upperLeft_(l,t), lowerRight_(r,b)
+ {}
+
+ /** Construct a rectangle of given position and size
+ */
+- Rect2D(Point2D const &upperLeft, Size2D const &size)
+- : upperLeft_(upperLeft), lowerRight_(upperLeft + size)
++ Rect2D(Point2D const &ul, Size2D const &sz)
++ : upperLeft_(ul), lowerRight_(ul + sz)
+ {}
+
+ /** Construct a rectangle of given size at position (0,0)
+ */
+- explicit Rect2D(Size2D const &size)
+- : lowerRight_(Point2D(size))
++ explicit Rect2D(Size2D const &sz)
++ : lowerRight_(Point2D(sz))
+ {}
+
+ /** Return the first point (scan-order wise) which is
+@@ -950,9 +950,9 @@ public:
+ /** Move the whole rectangle so that upperLeft() will become
+ * Point2D(left, top) afterwards.
+ */
+- void moveTo(int left, int top)
++ void moveTo(int l, int t)
+ {
+- moveTo(Point2D(left, top));
++ moveTo(Point2D(l, t));
+ }
+
+ /** Move the whole rectangle by the given 2D offset.
+@@ -1037,17 +1037,17 @@ public:
+ /** Resize this rectangle to the given extents. This will move
+ * the lower right corner only.
+ */
+- void setSize(Size2D const &size)
++ void setSize(Size2D const &sz)
+ {
+- lowerRight_ = upperLeft_ + size;
++ lowerRight_ = upperLeft_ + sz;
+ }
+
+ /** Resize this rectangle to the given extents. This will move
+ * the lower right corner only.
+ */
+- void setSize(int width, int height)
++ void setSize(int w, int h)
+ {
+- lowerRight_ = upperLeft_ + Size2D(width, height);
++ lowerRight_ = upperLeft_ + Size2D(w, h);
+ }
+
+ /** Increase the size of the rectangle by the given offset. This
+@@ -1131,7 +1131,7 @@ public:
+ bool contains(Rect2D const &r) const
+ {
+ return r.isEmpty() ||
+- contains(r.upperLeft()) && contains(r.lowerRight()-Diff2D(1,1));
++ (contains(r.upperLeft()) && contains(r.lowerRight()-Diff2D(1,1)));
+ }
+
+ /** Return whether this rectangle overlaps with the given
+diff -uprN misc/vigra1.6.0/include/vigra/fftw.hxx misc/build/vigra1.6.0/include/vigra/fftw.hxx
+--- misc/vigra1.6.0/include/vigra/fftw.hxx 2008-08-13 08:15:36.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/fftw.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -399,8 +399,6 @@ inline FFTWComplex operator /(FFTWComple
+ return a;
+ }
+
+-using VIGRA_CSTD::abs;
+-
+ inline FFTWComplex::value_type abs(const FFTWComplex &a)
+ {
+ return a.magnitude();
+diff -uprN misc/vigra1.6.0/include/vigra/fftw3.hxx misc/build/vigra1.6.0/include/vigra/fftw3.hxx
+--- misc/vigra1.6.0/include/vigra/fftw3.hxx 2008-08-13 08:15:36.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/fftw3.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -572,8 +572,6 @@ inline FFTWComplex operator /(FFTWComple
+ return a;
+ }
+
+-using VIGRA_CSTD::abs;
+-
+ /// absolute value (= magnitude)
+ inline FFTWComplex::value_type abs(const FFTWComplex &a)
+ {
+diff -uprN misc/vigra1.6.0/include/vigra/fixedpoint.hxx misc/build/vigra1.6.0/include/vigra/fixedpoint.hxx
+--- misc/vigra1.6.0/include/vigra/fixedpoint.hxx 2008-08-13 08:15:36.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/fixedpoint.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -118,20 +118,18 @@ enum FixedPointNoShift { FPNoShift };
+
+ namespace detail {
+
+-template <bool MustRound>
++template <bool MustRound, int N>
+ struct FPAssignWithRound;
+
+-template <>
+-struct FPAssignWithRound<false>
++template <int N>
++struct FPAssignWithRound<false, N>
+ {
+- template <int N>
+ static inline int exec(int v) { return v << (-N); }
+ };
+
+-template <>
+-struct FPAssignWithRound<true>
++template <int N>
++struct FPAssignWithRound<true, N>
+ {
+- template <int N>
+ static inline int exec(int const v)
+ {
+ return (v + (1 << (N - 1))) >> (N);
+@@ -276,7 +274,7 @@ public:
+ */
+ template <unsigned Int2, unsigned Frac2>
+ FixedPoint(const FixedPoint<Int2, Frac2> &other)
+- : value(detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec<Frac2 - FractionalBits>(other.value))
++ : value(detail::FPAssignWithRound<(Frac2 > FractionalBits), Frac2 - FractionalBits>::exec(other.value))
+ {
+ VIGRA_STATIC_ASSERT((FixedPoint_overflow_error__More_than_31_bits_requested<(IntBits + FractionalBits)>));
+ VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>));
+@@ -321,7 +319,7 @@ public:
+ FixedPoint & operator=(const FixedPoint<Int2, Frac2> &other)
+ {
+ VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>));
+- value = detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec<Frac2 - FractionalBits>(other.value);
++ value = detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value);
+ return *this;
+ }
+
+@@ -373,7 +371,7 @@ public:
+ FixedPoint & operator+=(const FixedPoint<Int2, Frac2> &other)
+ {
+ VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>));
+- value += detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec<Frac2 - FractionalBits>(other.value);
++ value += detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value);
+ return *this;
+ }
+
+@@ -384,7 +382,7 @@ public:
+ FixedPoint & operator-=(const FixedPoint<Int2, Frac2> &other)
+ {
+ VIGRA_STATIC_ASSERT((FixedPoint_assignment_error__Target_object_has_too_few_integer_bits<(IntBits >= Int2)>));
+- value -= detail::FPAssignWithRound<(Frac2 > FractionalBits)>::template exec<Frac2 - FractionalBits>(other.value);
++ value -= detail::FPAssignWithRound<(Frac2 > FractionalBits),Frac2 - FractionalBits>::exec(other.value);
+ return *this;
+ }
+
+diff -uprN misc/vigra1.6.0/include/vigra/gaborfilter.hxx misc/build/vigra1.6.0/include/vigra/gaborfilter.hxx
+--- misc/vigra1.6.0/include/vigra/gaborfilter.hxx 2008-08-13 08:15:36.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/gaborfilter.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -287,7 +287,11 @@ inline double angularGaborSigma(int dire
+ Namespace: vigra
+ */
+ template <class ImageType,
++#ifndef VIGRA_WITHOUT_NESTED_TEMPLATE_PARAMS
+ class Alloc = typename ImageType::allocator_type::template rebind<ImageType>::other >
++#else
++ class Alloc = std::allocator<ImageType> >
++#endif
+ class GaborFilterFamily
+ : public ImageArray<ImageType, Alloc>
+ {
+diff -uprN misc/vigra1.6.0/include/vigra/gaussians.hxx misc/build/vigra1.6.0/include/vigra/gaussians.hxx
+--- misc/vigra1.6.0/include/vigra/gaussians.hxx 2008-08-13 08:15:36.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/gaussians.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -88,26 +88,26 @@ class Gaussian
+ sigma > 0.0
+ \endcode
+ */
+- explicit Gaussian(T sigma = 1.0, unsigned int derivativeOrder = 0)
+- : sigma_(sigma),
+- sigma2_(-0.5 / sigma / sigma),
++ explicit Gaussian(T s = 1.0, unsigned int derivOrder = 0)
++ : sigma_(s),
++ sigma2_(-0.5 / s / s),
+ norm_(0.0),
+- order_(derivativeOrder),
+- hermitePolynomial_(derivativeOrder / 2 + 1)
++ order_(derivOrder),
++ hermitePolynomial_(derivOrder / 2 + 1)
+ {
+- vigra_precondition(sigma_ > 0.0,
++ vigra_precondition(s > 0.0,
+ "Gaussian::Gaussian(): sigma > 0 required.");
+ switch(order_)
+ {
+ case 1:
+ case 2:
+- norm_ = -1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(sigma) * sigma);
++ norm_ = -1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(s) * s);
+ break;
+ case 3:
+- norm_ = 1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(sigma) * sq(sigma) * sigma);
++ norm_ = 1.0 / (VIGRA_CSTD::sqrt(2.0 * M_PI) * sq(s) * sq(s) * s);
+ break;
+ default:
+- norm_ = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / sigma;
++ norm_ = 1.0 / VIGRA_CSTD::sqrt(2.0 * M_PI) / s;
+ }
+ calculateHermitePolynomial();
+ }
+--- misc/vigra1.6.0/include/vigra/mathutil.hxx 2008-08-13 08:15:38.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/mathutil.hxx 2012-09-21 02:16:23.000000000 -0500
+@@ -88,7 +88,7 @@ using VIGRA_CSTD::ceil;
+
+ // import abs(float), abs(double), abs(long double) from <cmath>
+ // and abs(int), abs(long), abs(long long) from <cstdlib>
+-using std::abs;
++//using std::abs;
+
+ // define the missing variants of abs() to avoid 'ambigous overload'
+ // errors in template functions
+@@ -100,17 +100,41 @@ VIGRA_DEFINE_UNSIGNED_ABS(unsigned char)
+ VIGRA_DEFINE_UNSIGNED_ABS(unsigned short)
+ VIGRA_DEFINE_UNSIGNED_ABS(unsigned int)
+ VIGRA_DEFINE_UNSIGNED_ABS(unsigned long)
++#ifdef VIGRA_HAS_LONG_LONG
+ VIGRA_DEFINE_UNSIGNED_ABS(unsigned long long)
++#endif
+
+ #undef VIGRA_DEFINE_UNSIGNED_ABS
+
+ #define VIGRA_DEFINE_MISSING_ABS(T) \
+ inline T abs(T t) { return t < 0 ? -t : t; }
+
+-VIGRA_DEFINE_MISSING_ABS(signed char)
+-VIGRA_DEFINE_MISSING_ABS(signed short)
++#define VIGRA_DEFINE_SIGNED_ABS(T) \
++ inline T abs(T t) { return (T)abs(t); }
++#define VIGRA_DEFINE_SIGNED_LABS(T) \
++ inline T abs(T t) { return (T)labs(t); }
++#define VIGRA_DEFINE_SIGNED_LLABS(T) \
++ inline T abs(T t) { return (T)llabs(t); }
++#define VIGRA_DEFINE_FABS(T) \
++ inline T abs(T t) { return (T)fabs(t); }
++
++VIGRA_DEFINE_SIGNED_ABS(signed char)
++VIGRA_DEFINE_SIGNED_ABS(signed short)
++VIGRA_DEFINE_SIGNED_ABS(signed int)
++VIGRA_DEFINE_SIGNED_LABS(signed long)
++#ifdef VIGRA_HAS_LONG_LONG
++VIGRA_DEFINE_SIGNED_LLABS(signed long long)
++#endif
++VIGRA_DEFINE_FABS(float)
++VIGRA_DEFINE_FABS(double)
++#ifdef VIGRA_HAS_LONG_DOUBLE
++VIGRA_DEFINE_FABS(long double)
++#endif
+
+-#undef VIGRA_DEFINE_MISSING_ABS
++#undef VIGRA_DEFINE_SIGNED_ABS
++#undef VIGRA_DEFINE_SIGNED_LABS
++#undef VIGRA_DEFINE_SIGNED_LLABS
++#undef VIGRA_DEFINE_FABS
+
+ /*! The rounding function.
+
+@@ -134,12 +158,14 @@ inline double round(double t)
+ : ceil(t - 0.5);
+ }
+
++#ifdef VIGRA_HAS_LONG_DOUBLE
+ inline long double round(long double t)
+ {
+ return t >= 0.0
+ ? floor(t + 0.5)
+ : ceil(t - 0.5);
+ }
++#endif
+
+ /*! Round up to the nearest power of 2.
+
+@@ -440,9 +466,15 @@ VIGRA_DEFINE_NORM(int)
+ VIGRA_DEFINE_NORM(unsigned int)
+ VIGRA_DEFINE_NORM(long)
+ VIGRA_DEFINE_NORM(unsigned long)
++#ifdef VIGRA_HAS_LONG_LONG
++VIGRA_DEFINE_NORM(long long)
++VIGRA_DEFINE_NORM(unsigned long long)
++#endif
+ VIGRA_DEFINE_NORM(float)
+ VIGRA_DEFINE_NORM(double)
++#ifdef VIGRA_HAS_LONG_DOUBLE
+ VIGRA_DEFINE_NORM(long double)
++#endif
+
+ #undef VIGRA_DEFINE_NORM
+
+diff -uprN misc/vigra1.6.0/include/vigra/numerictraits.hxx misc/build/vigra1.6.0/include/vigra/numerictraits.hxx
+--- misc/vigra1.6.0/include/vigra/numerictraits.hxx 2008-08-13 08:15:39.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/numerictraits.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -863,6 +863,90 @@ struct NumericTraits<long>
+ }
+ };
+
++#ifdef VIGRA_HAS_LONG_LONG
++template<>
++struct NumericTraits<long long>
++{
++ typedef long long Type;
++ typedef long long Promote;
++ typedef double RealPromote;
++ typedef std::complex<RealPromote> ComplexPromote;
++ typedef Type ValueType;
++
++ typedef VigraTrueType isIntegral;
++ typedef VigraTrueType isScalar;
++ typedef VigraTrueType isSigned;
++ typedef VigraTrueType isOrdered;
++ typedef VigraFalseType isComplex;
++
++ static long long zero() { return 0; }
++ static long long one() { return 1; }
++ static long long nonZero() { return 1; }
++ static long long min() { return LLONG_MIN; }
++ static long long max() { return LLONG_MAX; }
++
++#ifdef NO_INLINE_STATIC_CONST_DEFINITION
++ enum { minConst = LONG_MIN, maxConst = LLONG_MAX };
++#else
++ static const long long minConst = LLONG_MIN;
++ static const long long maxConst = LLONG_MAX;
++#endif
++
++ static Promote toPromote(long long v) { return v; }
++ static RealPromote toRealPromote(long long v) { return v; }
++ static long long fromPromote(Promote v) { return v; }
++ static long long fromRealPromote(RealPromote v) {
++ return ((v < 0.0)
++ ? ((v < (RealPromote)LLONG_MIN)
++ ? LLONG_MIN
++ : static_cast<long long>(v - 0.5))
++ : ((v > (RealPromote)LLONG_MAX)
++ ? LLONG_MAX
++ : static_cast<long long>(v + 0.5)));
++ }
++};
++
++template<>
++struct NumericTraits<unsigned long long>
++{
++ typedef unsigned long long Type;
++ typedef unsigned long long Promote;
++ typedef double RealPromote;
++ typedef std::complex<RealPromote> ComplexPromote;
++ typedef Type ValueType;
++
++ typedef VigraTrueType isIntegral;
++ typedef VigraTrueType isScalar;
++ typedef VigraFalseType isSigned;
++ typedef VigraTrueType isOrdered;
++ typedef VigraFalseType isComplex;
++
++ static unsigned long long zero() { return 0; }
++ static unsigned long long one() { return 1; }
++ static unsigned long long nonZero() { return 1; }
++ static unsigned long long min() { return 0; }
++ static unsigned long long max() { return ULLONG_MAX; }
++
++#ifdef NO_INLINE_STATIC_CONST_DEFINITION
++ enum { minConst = 0, maxConst = ULLONG_MAX };
++#else
++ static const unsigned long long minConst = 0;
++ static const unsigned long long maxConst = ULLONG_MAX;
++#endif
++
++ static Promote toPromote(unsigned long long v) { return v; }
++ static RealPromote toRealPromote(unsigned long long v) { return v; }
++ static unsigned long long fromPromote(Promote v) { return v; }
++ static unsigned long long fromRealPromote(RealPromote v) {
++ return ((v < 0.0)
++ ? 0
++ : ((v > (RealPromote)ULLONG_MAX)
++ ? ULLONG_MAX
++ : static_cast<unsigned long long>(v + 0.5)));
++ }
++};
++#endif
++
+ template<>
+ struct NumericTraits<unsigned long>
+ {
+@@ -1050,6 +1134,7 @@ struct NumericTraits<double>
+ static double fromRealPromote(RealPromote v) { return v; }
+ };
+
++#ifdef VIGRA_HAS_LONG_DOUBLE
+ template<>
+ struct NumericTraits<long double>
+ {
+@@ -1079,6 +1164,7 @@ struct NumericTraits<long double>
+ static long double fromPromote(Promote v) { return v; }
+ static long double fromRealPromote(RealPromote v) { return v; }
+ };
++#endif
+
+ #ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION
+
+@@ -1158,9 +1244,15 @@ VIGRA_DEFINE_NORM_TRAITS(int)
+ VIGRA_DEFINE_NORM_TRAITS(unsigned int)
+ VIGRA_DEFINE_NORM_TRAITS(long)
+ VIGRA_DEFINE_NORM_TRAITS(unsigned long)
++#ifdef VIGRA_HAS_LONG_LONG
++VIGRA_DEFINE_NORM_TRAITS(long long)
++VIGRA_DEFINE_NORM_TRAITS(unsigned long long)
++#endif
+ VIGRA_DEFINE_NORM_TRAITS(float)
+ VIGRA_DEFINE_NORM_TRAITS(double)
++#ifdef VIGRA_HAS_LONG_DOUBLE
+ VIGRA_DEFINE_NORM_TRAITS(long double)
++#endif
+
+ #ifdef LLONG_MAX
+ VIGRA_DEFINE_NORM_TRAITS(long long)
+diff -uprN misc/vigra1.6.0/include/vigra/orientedtensorfilters.hxx misc/build/vigra1.6.0/include/vigra/orientedtensorfilters.hxx
+--- misc/vigra1.6.0/include/vigra/orientedtensorfilters.hxx 2008-08-13 08:15:40.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/orientedtensorfilters.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -435,7 +435,7 @@ class Sin6RingKernel
+ if(x == 0 && y == 0)
+ return weights_(radius_, radius_);
+ double d = dot(vectors_(x+radius_, y+radius_), v);
+- return VIGRA_CSTD::pow(1.0 - d * d, 3) * weights_(x+radius_, y+radius_);
++ return VIGRA_CSTD::pow(1.0 - d * d, 3.0) * weights_(x+radius_, y+radius_);
+ }
+ };
+
+@@ -456,7 +456,7 @@ class Sin6Kernel
+ if(x == 0 && y == 0)
+ return weights_(radius_, radius_);
+ double d = dot(vectors_(x+radius_, y+radius_), v);
+- return VIGRA_CSTD::pow(1.0 - d * d, 3) * weights_(x+radius_, y+radius_);
++ return VIGRA_CSTD::pow(1.0 - d * d, 3.0) * weights_(x+radius_, y+radius_);
+ }
+ };
+
+@@ -477,7 +477,7 @@ class Cos6RingKernel
+ if(x == 0 && y == 0)
+ return weights_(radius_, radius_);
+ double d = dot(vectors_(x+radius_, y+radius_), v);
+- return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3)) * weights_(x+radius_, y+radius_);
++ return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3.0)) * weights_(x+radius_, y+radius_);
+ }
+ };
+
+@@ -498,7 +498,7 @@ class Cos6Kernel
+ if(x == 0 && y == 0)
+ return weights_(radius_, radius_);
+ double d = dot(vectors_(x+radius_, y+radius_), v);
+- return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3)) * weights_(x+radius_, y+radius_);
++ return (1.0 - VIGRA_CSTD::pow(1.0 - d * d, 3.0)) * weights_(x+radius_, y+radius_);
+ }
+ };
+
+diff -uprN misc/vigra1.6.0/include/vigra/polynomial.hxx misc/build/vigra1.6.0/include/vigra/polynomial.hxx
+--- misc/vigra1.6.0/include/vigra/polynomial.hxx 2008-08-13 08:15:40.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/polynomial.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -119,10 +119,10 @@ class PolynomialView
+ of subsequent algorithms (especially root finding) performed on the
+ polynomial.
+ */
+- PolynomialView(T * coeffs, unsigned int order, double epsilon = 1.0e-14)
++ PolynomialView(T * coeffs, unsigned int ord, double eps = 1.0e-14)
+ : coeffs_(coeffs),
+- order_(order),
+- epsilon_(epsilon)
++ order_(ord),
++ epsilon_(eps)
+ {}
+
+ /// Access the coefficient of x^i
+@@ -245,16 +245,16 @@ class PolynomialView
+ { epsilon_ = eps; }
+
+ protected:
+- PolynomialView(double epsilon = 1e-14)
++ PolynomialView(double eps = 1e-14)
+ : coeffs_(0),
+ order_(0),
+- epsilon_(epsilon)
++ epsilon_(eps)
+ {}
+
+- void setCoeffs(T * coeffs, unsigned int order)
++ void setCoeffs(T * coeffs, unsigned int ord)
+ {
+ coeffs_ = coeffs;
+- order_ = order;
++ order_ = ord;
+ }
+
+ T * coeffs_;
+@@ -397,9 +397,9 @@ PolynomialView<T>::deflateConjugatePair(
+
+ template <class T>
+ void
+-PolynomialView<T>::minimizeOrder(double epsilon)
++PolynomialView<T>::minimizeOrder(double eps)
+ {
+- while(std::abs(coeffs_[order_]) <= epsilon && order_ > 0)
++ while(std::abs(coeffs_[order_]) <= eps && order_ > 0)
+ --order_;
+ }
+
+diff -uprN misc/vigra1.6.0/include/vigra/recursiveconvolution.hxx misc/build/vigra1.6.0/include/vigra/recursiveconvolution.hxx
+--- misc/vigra1.6.0/include/vigra/recursiveconvolution.hxx 2008-08-13 08:15:40.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/recursiveconvolution.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -261,16 +261,16 @@ void recursiveFilterLine(SrcIterator is,
+ {
+ // correction factors for b
+ double bright = b;
+- double bleft = VIGRA_CSTD::pow(b, w);
++ double bleft = VIGRA_CSTD::pow(b, (double)w);
+
+ for(x=w-1; x>=0; --x, --is, --id)
+ {
+ TempType f = b * old;
+ old = as(is) + f;
+- double norm = (1.0 - b) / (1.0 + b - bleft - bright);
++ double norm2 = (1.0 - b) / (1.0 + b - bleft - bright);
+ bleft /= b;
+ bright *= b;
+- ad.set(norm * (line[x] + f), id);
++ ad.set(norm2 * (line[x] + f), id);
+ }
+ }
+ else if(border == BORDER_TREATMENT_AVOID)
+diff -uprN misc/vigra1.6.0/include/vigra/rgbvalue.hxx misc/build/vigra1.6.0/include/vigra/rgbvalue.hxx
+--- misc/vigra1.6.0/include/vigra/rgbvalue.hxx 2008-08-13 08:15:41.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/rgbvalue.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -702,8 +706,6 @@ operator/=(RGBValue<V, RIDX, GIDX, BIDX>
+ return l;
+ }
+
+-using VIGRA_CSTD::abs;
+-
+ /// component-wise absolute value
+ template <class T, unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
+ inline
+diff -uprN misc/vigra1.6.0/include/vigra/separableconvolution.hxx misc/build/vigra1.6.0/include/vigra/separableconvolution.hxx
+--- misc/vigra1.6.0/include/vigra/separableconvolution.hxx 2008-08-13 08:15:41.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/separableconvolution.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -1022,11 +1022,11 @@ class Kernel1D
+ */
+ InitProxy operator=(value_type const & v)
+ {
+- int size = right_ - left_ + 1;
++ int sz = right_ - left_ + 1;
+ for(unsigned int i=0; i<kernel_.size(); ++i) kernel_[i] = v;
+- norm_ = (double)size*v;
++ norm_ = (double)sz*v;
+
+- return InitProxy(kernel_.begin(), size, norm_);
++ return InitProxy(kernel_.begin(), sz, norm_);
+ }
+
+ /** Destructor.
+@@ -1663,8 +1663,8 @@ class Kernel1D
+ };
+
+ template <class ARITHTYPE>
+-void Kernel1D<ARITHTYPE>::normalize(value_type norm,
+- unsigned int derivativeOrder,
++void Kernel1D<ARITHTYPE>::normalize(value_type normFactor,
++ unsigned int derivOrder,
+ double offset)
+ {
+ typedef typename NumericTraits<value_type>::RealPromote TmpType;
+@@ -1673,7 +1673,7 @@ void Kernel1D<ARITHTYPE>::normalize(valu
+ Iterator k = kernel_.begin();
+ TmpType sum = NumericTraits<TmpType>::zero();
+
+- if(derivativeOrder == 0)
++ if(derivOrder == 0)
+ {
+ for(; k < kernel_.end(); ++k)
+ {
+@@ -1683,11 +1683,11 @@ void Kernel1D<ARITHTYPE>::normalize(valu
+ else
+ {
+ unsigned int faculty = 1;
+- for(unsigned int i = 2; i <= derivativeOrder; ++i)
++ for(unsigned int i = 2; i <= derivOrder; ++i)
+ faculty *= i;
+ for(double x = left() + offset; k < kernel_.end(); ++x, ++k)
+ {
+- sum += *k * VIGRA_CSTD::pow(-x, int(derivativeOrder)) / faculty;
++ sum += *k * VIGRA_CSTD::pow(-x, (double)derivOrder) / faculty;
+ }
+ }
+
+@@ -1695,21 +1695,21 @@ void Kernel1D<ARITHTYPE>::normalize(valu
+ "Kernel1D<ARITHTYPE>::normalize(): "
+ "Cannot normalize a kernel with sum = 0");
+ // normalize
+- sum = norm / sum;
++ sum = normFactor / sum;
+ k = kernel_.begin();
+ for(; k != kernel_.end(); ++k)
+ {
+ *k = *k * sum;
+ }
+
+- norm_ = norm;
++ norm_ = normFactor;
+ }
+
+ /***********************************************************************/
+
+ template <class ARITHTYPE>
+ void Kernel1D<ARITHTYPE>::initGaussian(double std_dev,
+- value_type norm)
++ value_type normFactor)
+ {
+ vigra_precondition(std_dev >= 0.0,
+ "Kernel1D::initGaussian(): Standard deviation must be >= 0.");
+@@ -1742,8 +1742,8 @@ void Kernel1D<ARITHTYPE>::initGaussian(d
+ right_ = 0;
+ }
+
+- if(norm != 0.0)
+- normalize(norm);
++ if(normFactor != 0.0)
++ normalize(normFactor);
+ else
+ norm_ = 1.0;
+
+@@ -1755,7 +1755,7 @@ void Kernel1D<ARITHTYPE>::initGaussian(d
+
+ template <class ARITHTYPE>
+ void Kernel1D<ARITHTYPE>::initDiscreteGaussian(double std_dev,
+- value_type norm)
++ value_type normFactor)
+ {
+ vigra_precondition(std_dev >= 0.0,
+ "Kernel1D::initDiscreteGaussian(): Standard deviation must be >= 0.");
+@@ -1797,7 +1797,7 @@ void Kernel1D<ARITHTYPE>::initDiscreteGa
+ er += warray[i];
+ }
+
+- double scale = norm / (2*er - warray[0]);
++ double scale = normFactor / (2*er - warray[0]);
+
+ initExplicitly(-radius, radius);
+ iterator c = center();
+@@ -1810,12 +1810,12 @@ void Kernel1D<ARITHTYPE>::initDiscreteGa
+ else
+ {
+ kernel_.erase(kernel_.begin(), kernel_.end());
+- kernel_.push_back(norm);
++ kernel_.push_back(normFactor);
+ left_ = 0;
+ right_ = 0;
+ }
+
+- norm_ = norm;
++ norm_ = normFactor;
+
+ // best border treatment for Gaussians is BORDER_TREATMENT_REFLECT
+ border_treatment_ = BORDER_TREATMENT_REFLECT;
+@@ -1826,15 +1826,15 @@ void Kernel1D<ARITHTYPE>::initDiscreteGa
+ template <class ARITHTYPE>
+ void
+ Kernel1D<ARITHTYPE>::initGaussianDerivative(double std_dev,
+- int order,
+- value_type norm)
++ int order,
++ value_type normFactor)
+ {
+ vigra_precondition(order >= 0,
+ "Kernel1D::initGaussianDerivative(): Order must be >= 0.");
+
+ if(order == 0)
+ {
+- initGaussian(std_dev, norm);
++ initGaussian(std_dev, normFactor);
+ return;
+ }
+
+@@ -1865,7 +1865,7 @@ Kernel1D<ARITHTYPE>::initGaussianDerivat
+
+ // remove DC, but only if kernel correction is permitted by a non-zero
+ // value for norm
+- if(norm != 0.0)
++ if(normFactor != 0.0)
+ {
+ for(unsigned int i=0; i < kernel_.size(); ++i)
+ {
+@@ -1876,8 +1876,8 @@ Kernel1D<ARITHTYPE>::initGaussianDerivat
+ left_ = -radius;
+ right_ = radius;
+
+- if(norm != 0.0)
+- normalize(norm, order);
++ if(normFactor != 0.0)
++ normalize(normFactor, order);
+ else
+ norm_ = 1.0;
+
+@@ -1891,7 +1891,7 @@ Kernel1D<ARITHTYPE>::initGaussianDerivat
+ template <class ARITHTYPE>
+ void
+ Kernel1D<ARITHTYPE>::initBinomial(int radius,
+- value_type norm)
++ value_type normFactor)
+ {
+ vigra_precondition(radius > 0,
+ "Kernel1D::initBinomial(): Radius must be > 0.");
+@@ -1921,12 +1921,12 @@ Kernel1D<ARITHTYPE>::initBinomial(int ra
+
+ for(i=0; i<=radius*2+1; ++i)
+ {
+- kernel_.push_back(kernel[i] * norm);
++ kernel_.push_back(kernel[i] * normFactor);
+ }
+
+ left_ = -radius;
+ right_ = radius;
+- norm_ = norm;
++ norm_ = normFactor;
+
+ // best border treatment for Binomial is BORDER_TREATMENT_REFLECT
+ border_treatment_ = BORDER_TREATMENT_REFLECT;
+@@ -1936,7 +1936,7 @@ Kernel1D<ARITHTYPE>::initBinomial(int ra
+
+ template <class ARITHTYPE>
+ void Kernel1D<ARITHTYPE>::initAveraging(int radius,
+- value_type norm)
++ value_type normFactor)
+ {
+ vigra_precondition(radius > 0,
+ "Kernel1D::initAveraging(): Radius must be > 0.");
+@@ -1950,12 +1950,12 @@ void Kernel1D<ARITHTYPE>::initAveraging(
+
+ for(int i=0; i<=radius*2+1; ++i)
+ {
+- kernel_.push_back(scale * norm);
++ kernel_.push_back(scale * normFactor);
+ }
+
+ left_ = -radius;
+ right_ = radius;
+- norm_ = norm;
++ norm_ = normFactor;
+
+ // best border treatment for Averaging is BORDER_TREATMENT_CLIP
+ border_treatment_ = BORDER_TREATMENT_CLIP;
+diff -uprN misc/vigra1.6.0/include/vigra/sized_int.hxx misc/build/vigra1.6.0/include/vigra/sized_int.hxx
+--- misc/vigra1.6.0/include/vigra/sized_int.hxx 2008-08-13 08:15:41.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/sized_int.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -73,8 +73,8 @@ struct SelectIntegerType<SIZE, Int_type_
+ template<class LIST>
+ struct SelectBiggestIntegerType
+ {
+- enum { cursize = LIST::size,
+- nextsize = SelectBiggestIntegerType<typename LIST::next>::size,
++ enum { cursize = static_cast< int >(LIST::size),
++ nextsize = static_cast< int >(SelectBiggestIntegerType<typename LIST::next>::size),
+ size = (cursize < nextsize) ? nextsize : cursize };
+ typedef typename
+ IfBool<(cursize < nextsize),
+diff -uprN misc/vigra1.6.0/include/vigra/splines.hxx misc/build/vigra1.6.0/include/vigra/splines.hxx
+--- misc/vigra1.6.0/include/vigra/splines.hxx 2008-08-13 08:15:41.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/splines.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -108,8 +108,8 @@ class BSplineBase
+ /** Create functor for gevine derivative of the spline. The spline's order
+ is specified spline by the template argument <TT>ORDER</tt>.
+ */
+- explicit BSplineBase(unsigned int derivativeOrder = 0)
+- : s1_(derivativeOrder)
++ explicit BSplineBase(unsigned int derivOrder = 0)
++ : s1_(derivOrder)
+ {}
+
+ /** Unary function call.
+@@ -280,8 +280,8 @@ class BSplineBase<0, T>
+ typedef T result_type;
+ enum StaticOrder { order = 0 };
+
+- explicit BSplineBase(unsigned int derivativeOrder = 0)
+- : derivativeOrder_(derivativeOrder)
++ explicit BSplineBase(unsigned int derivOrder = 0)
++ : derivativeOrder_(derivOrder)
+ {}
+
+ result_type operator()(argument_type x) const
+@@ -357,8 +357,8 @@ class BSpline<1, T>
+ typedef T result_type;
+ enum StaticOrder { order = 1 };
+
+- explicit BSpline(unsigned int derivativeOrder = 0)
+- : derivativeOrder_(derivativeOrder)
++ explicit BSpline(unsigned int derivOrder = 0)
++ : derivativeOrder_(derivOrder)
+ {}
+
+ result_type operator()(argument_type x) const
+@@ -454,8 +454,8 @@ class BSpline<2, T>
+ typedef T result_type;
+ enum StaticOrder { order = 2 };
+
+- explicit BSpline(unsigned int derivativeOrder = 0)
+- : derivativeOrder_(derivativeOrder)
++ explicit BSpline(unsigned int derivOrder = 0)
++ : derivativeOrder_(derivOrder)
+ {}
+
+ result_type operator()(argument_type x) const
+@@ -583,8 +583,8 @@ class BSpline<3, T>
+ typedef T result_type;
+ enum StaticOrder { order = 3 };
+
+- explicit BSpline(unsigned int derivativeOrder = 0)
+- : derivativeOrder_(derivativeOrder)
++ explicit BSpline(unsigned int derivOrder = 0)
++ : derivativeOrder_(derivOrder)
+ {}
+
+ result_type operator()(argument_type x) const
+@@ -735,8 +735,8 @@ class BSpline<4, T>
+ typedef T result_type;
+ enum StaticOrder { order = 4 };
+
+- explicit BSpline(unsigned int derivativeOrder = 0)
+- : derivativeOrder_(derivativeOrder)
++ explicit BSpline(unsigned int derivOrder = 0)
++ : derivativeOrder_(derivOrder)
+ {}
+
+ result_type operator()(argument_type x) const
+diff -uprN misc/vigra1.6.0/include/vigra/tinyvector.hxx misc/build/vigra1.6.0/include/vigra/tinyvector.hxx
+--- misc/vigra1.6.0/include/vigra/tinyvector.hxx 2008-08-13 08:15:42.000000000 -0500
++++ misc/build/vigra1.6.0/include/vigra/tinyvector.hxx 2012-09-19 17:30:24.000000000 -0500
+@@ -49,7 +53,6 @@
+
+ namespace vigra {
+
+-using VIGRA_CSTD::abs;
+ using VIGRA_CSTD::ceil;
+ using VIGRA_CSTD::floor;
+
+@@ -439,9 +442,9 @@ class TinyVectorBase
+ /** Initialize from another sequence (must have length SIZE!)
+ */
+ template <class Iterator>
+- void init(Iterator i, Iterator end)
++ void init(Iterator i, Iterator iend)
+ {
+- vigra_precondition(end-i == SIZE,
++ vigra_precondition(iend-i == SIZE,
+ "TinyVector::init(): Sequence has wrong size.");
+ Loop::assignCast(data_, i);
+ }
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,xsltml))
+
+ifeq ($(ENABLE_MEDIAWIKI),TRUE)
+
+$(eval $(call gb_Module_add_targets,xsltml,\
+ UnpackedTarball_xsltml \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+XSLT MathML Library from [http://xsltml.sourceforge.net/].
+
+This project is used in the Wiki filter that is installed
+with the WikiPublisher extension. The extension is built
+in mudule swext.
+
+Building of the module provides a set of xslt transformation
+related files that are used by the filter to transform
+embedded formula objects into media wiki format.
+
+The archive was downloaded from:
+[http://xsltml.sourceforge.net]
+on 2009-02-16.
+
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,xsltml))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,xsltml,$(XSLTML_TARBALL),0))
+
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,xsltml,\
+ cmarkup.xsl \
+ entities.xsl \
+ glayout.xsl \
+ mmltex.xsl \
+ scripts.xsl \
+ tables.xsl \
+ tokens.xsl \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,xsltml,\
+ external/xsltml/xsltml_2.1.2.patch \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,zlib))
+
+ifeq ($(SYSTEM_ZLIB),)
+
+$(eval $(call gb_Module_add_targets,zlib,\
+ StaticLibrary_zlib \
+ UnpackedTarball_zlib \
+))
+
+ifeq ($(BUILD_X64),TRUE)
+$(eval $(call gb_Module_add_targets,zlib,\
+ StaticLibrary_zlib_x64 \
+))
+endif
+
+endif
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+Compression library from [http://www.zlib.net/].
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,zlib))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,zlib,zlib))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,zlib))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,zlib,\
+ UnpackedTarball/zlib/adler32 \
+ UnpackedTarball/zlib/compress \
+ UnpackedTarball/zlib/crc32 \
+ UnpackedTarball/zlib/deflate \
+ UnpackedTarball/zlib/gzclose \
+ UnpackedTarball/zlib/gzlib \
+ UnpackedTarball/zlib/gzread \
+ UnpackedTarball/zlib/gzwrite \
+ UnpackedTarball/zlib/inffast \
+ UnpackedTarball/zlib/inflate \
+ UnpackedTarball/zlib/inftrees \
+ UnpackedTarball/zlib/trees \
+ UnpackedTarball/zlib/zutil \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,zlib_x64))
+
+$(eval $(call gb_StaticLibrary_set_x64,zlib_x64,YES))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,zlib_x64,zlib))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,zlib_x64))
+
+$(eval $(call gb_StaticLibrary_set_include,zlib_x64,\
+ -I$(call gb_UnpackedTarball_get_dir,zlib) \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_x64_generated_cobjects,zlib_x64,\
+ UnpackedTarball/zlib/x64/adler32 \
+ UnpackedTarball/zlib/x64/compress \
+ UnpackedTarball/zlib/x64/crc32 \
+ UnpackedTarball/zlib/x64/deflate \
+ UnpackedTarball/zlib/x64/inffast \
+ UnpackedTarball/zlib/x64/inflate \
+ UnpackedTarball/zlib/x64/inftrees \
+ UnpackedTarball/zlib/x64/trees \
+ UnpackedTarball/zlib/x64/zutil \
+))
+
+# vim: set noet sw=4 ts=4:
--- /dev/null
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,zlib))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,zlib,$(ZLIB_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_post_action,zlib,\
+ mkdir -p x64 && \
+ cp $(addsuffix .c,adler32 compress crc32 deflate inffast inflate inftrees trees zutil) x64 \
+))
+
+# vim: set noet sw=4 ts=4: